Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2437795ybl; Mon, 20 Jan 2020 03:01:03 -0800 (PST) X-Google-Smtp-Source: APXvYqy7Wx2XZCd9b8V/clzfY/klc7g5UdBlb7bIHKQiyK975zHsBX4rhjcl1ZYPFAR47lhcFb3g X-Received: by 2002:a9d:dc1:: with SMTP id 59mr15275096ots.250.1579518062874; Mon, 20 Jan 2020 03:01:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579518062; cv=none; d=google.com; s=arc-20160816; b=KoTPOv9nC7cvMk+o43WNx5QDP/+dQSAcbN+7UZDRBs53BFlT3am27xzsGoaUBBRFPE lwCXXj14lpbC659+Pl+MMZV3S8TkcU75oV87MSIByB/gb2oaH06WE1fh7g9d3OlNGSOe PZMS8SOjw4KnsihnJBBlU0EcPOcqeLDy8Lpx9YnLXff4Q1bdeqoBhFbZ8/RjUNoyhJL0 HCUupifVOuj9o9yEDxLI0I0+mTS5ZDHFemTQ0ML6WXsL2jWhO7S0Ab82Jk0D0dYUWd5X Lgs2fjosMNxh74IeBpHg5T5xILedxZvMrrUNOEfVNdc9Po7WGLCEy98/5l39S98UOkWP TBnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=BPiM5E5aW3vHr19FyjEvIWQNK+3HDMVU57/lQmCNbes=; b=uVd3URVvlJAgmyhFBO2IiBF3CMSnbTQpFK/DNoQQAM+BTzrGOJIWCuKLUUQimqkPF8 SgQxGp1K7o6riMd8U2d7jmmNthjfGPHim+6FZLoB9s7kvjw5tXfODK0N4ELo6xvtMIff A457V3Ef8NYqI2rDM+JVbcc1piXJDc0QZH3rwy3OB0i/AULbRoSMpq1hzeRJheIGBr7R pPnGgcTZ0nkke9BQvC0I0Ylda3eekwl9JaK0qM83juokMUuwa8PgOjtoX1yNGstLzU0r EQ0Xrr15ydbd8CRhx0WD0h9raLwetZLLpBoJ4Ge3F7DSSLNuRuYxlAzgEW12gWUK614i 36Ag== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k9si18484963oih.157.2020.01.20.03.00.50; Mon, 20 Jan 2020 03:01:02 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726621AbgATK7w (ORCPT + 99 others); Mon, 20 Jan 2020 05:59:52 -0500 Received: from mout.kundenserver.de ([212.227.17.13]:59333 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726148AbgATK7w (ORCPT ); Mon, 20 Jan 2020 05:59:52 -0500 Received: from mail-qv1-f42.google.com ([209.85.219.42]) by mrelayeu.kundenserver.de (mreue109 [212.227.15.145]) with ESMTPSA (Nemesis) id 1M7auJ-1iyjaC3BjZ-0082pz for ; Mon, 20 Jan 2020 11:59:49 +0100 Received: by mail-qv1-f42.google.com with SMTP id u1so13769608qvk.13 for ; Mon, 20 Jan 2020 02:59:49 -0800 (PST) X-Gm-Message-State: APjAAAW/j4iAxaX1pgZAI4Sjxm7x2DBaTOF2Fds3uHpQgC1zEJt7mxW0 WVGK+HPQh6b6+W8iplNLByVlE2vAcZDk9Ct6+os= X-Received: by 2002:a0c:8e08:: with SMTP id v8mr20095619qvb.4.1579517988617; Mon, 20 Jan 2020 02:59:48 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Arnd Bergmann Date: Mon, 20 Jan 2020 11:59:32 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: Question about dynamic minor number of misc device To: Zhenzhong Duan Cc: Greg Kroah-Hartman , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" X-Provags-ID: V03:K1:oUuVCRVWt0NAiOBBkbU5zLjXESwHtBqBVnH3fc4p8P41XXXVIW8 XSDB8rTl3mUerkzkTnIZiyL1heoj98CWzm7QuRA2NxYBFJN3LWlsO8mfEyoJ/dsTKrGgeKG i6IH17tOJXQWNQ4AsLPNnyEKiRfqp7JdhJlIqWQG8R1ZqW7tRXh+qjXfv9N2rVujtn2jMfn ddfpudDwI3USen5Q4AJMA== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:Sg2/3O7aNec=:VghGxn/Th/V7iDoH4bHI07 /I603fPIDsrJH1ZnYgqPnHI3TRReC4+vwpayatAeBv03Gbnknx81aK6zswV3zhPKlpXBw2ZiQ njFJkzIcauekMsPgfJyCmp8GOkzH2KlJjNE5/TGgQdEEEOPr6e/lgH/VUiKc8zkJgtV7IFN0k BByA+nBOmaGdLfv4AMCKKdrCikd+YTt90xbVEVcvk6Zh6G4sHw4y5nDKZ9TkJ1xGIPTO0xyzA z/NyHEorPSRKNmahJDBlsDI/3AbBsw6OCkUh56N29iNDivxizBsZ1SVpMRAqK8KzPqF+DJYHl duytp8Dvf8Qx+lt5p+JgnwxEDi1N1oZiGxaKb8MnrUwuOCO7XyzDYRpzwJqJGWt9onQM78flO 6mpdWZCtudMXVr80HtYB+kd50J5BddCn4+UuZ8Rw5UckB3OhkZw4K95I24SY1uJ3n7hNlw6Jm cd4n2Dianj2cmoJGZtWI9qPpIb1iziIhBklqojSsl8GzLCkRmpOksgVGXus5iWcmK3QhW7c8H N+wyBybbNzhRMm38FLitjoU3qBa1cnTfLTC7lJe24Zlpe5smuZFqVgYr70nDtAQUhh0n2jBVr rZuG5p4iKq5gKSCoucc521ghBbXAsbLbMq7G2O57kKiHSGxseWg8MQAyLBRi/SgSFdAnUBIEn /7t0cmrSH3Q/YGlPDTMzDTFQyff3B4B0idv+BjsPiZSY9qBrlEcWkW3ZE4Sio/A5/5v/TtmRK 3W8PZ6oM19gkjCFY+1fSReuIFeaqKyPQtQb1yCGVIlNJvUeb9TR8Hus8OBUMiC43FEKlQvbvX SE1eKMzGhgkNIWoEWgfLNqkouRm4LXRM7I5DPFD9aSU48jkifR146Shv0Ri+0DZwb4hNkcZzm iYe4+CaW0dY//OYsvjhA== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 20, 2020 at 11:26 AM Zhenzhong Duan wrote: > On Mon, Jan 20, 2020 at 6:03 PM Arnd Bergmann wrote: > > On Mon, Jan 20, 2020 at 9:33 AM Zhenzhong Duan wrote: > > On a related note, I checked for drivers that call misc_register() > > with a minor number that is not defined in include/linux/misc.h > > and found a bunch, including some that have conflicting numbers, > > conflicting names or numbers from the dynamic range: > > > > drivers/staging/speakup/devsynth.c:#define SYNTH_MINOR 25 > > drivers/staging/speakup/speakup_soft.c:#define SOFTSYNTH_MINOR 26 /* > > drivers/staging/speakup/speakup_soft.c:#define SOFTSYNTHU_MINOR 27 /* > > drivers/macintosh/via-pmu.c:#define PMU_MINOR 154 > > drivers/macintosh/ans-lcd.h:#define ANSLCD_MINOR 156 > > drivers/auxdisplay/charlcd.c:#define LCD_MINOR 156 > > drivers/char/applicom.c:#define AC_MINOR 157 > > drivers/char/nwbutton.h:#define BUTTON_MINOR 158 > > arch/arm/include/asm/nwflash.h:#define FLASH_MINOR 160 > > drivers/sbus/char/envctrl.c:#define ENVCTRL_MINOR 162 > > drivers/sbus/char/flash.c:#define FLASH_MINOR 152 > > drivers/sbus/char/uctrl.c:#define UCTRL_MINOR 174 > > drivers/char/toshiba.c:#define TOSH_MINOR_DEV 181 > > arch/um/drivers/random.c:#define RNG_MISCDEV_MINOR > > drivers/auxdisplay/panel.c:#define KEYPAD_MINOR 185 > > drivers/video/fbdev/pxa3xx-gcu.c:#define MISCDEV_MINOR 197 > > kernel/power/user.c:#define SNAPSHOT_MINOR 231 > > drivers/parisc/eisa_eeprom.c:#define EISA_EEPROM_MINOR 241 > > > > If you would like to help clean that up, you are definitely welcome > > to send patches. > > Ok, should that be a patch for all drivers or seperate patch for each driver? I think one patch to move the ones with unique names would be fine, but then separate patches for - FLASH_MINOR move and rename to avoid conflict - change speakup to dynamic minors - support for high dynamic minor numbers if you are really motivated (probably nobody needs these) Arnd