All of lore.kernel.org
 help / color / mirror / Atom feed
From: Randy Dunlap <rdunlap@infradead.org>
To: Joe Perches <joe@perches.com>,
	linux-kernel-mentees@lists.linuxfoundation.org
Cc: LKML <linux-kernel@vger.kernel.org>,
	kernel-janitors <kernel-janitors@vger.kernel.org>
Subject: Re: patch suggestion: Kconfig symbols
Date: Wed, 28 Jul 2021 12:41:33 -0700	[thread overview]
Message-ID: <09db53b9-7edf-44fc-c6b7-7c4e9198a2d4@infradead.org> (raw)
In-Reply-To: <e77e2329bdafdbea538be0d7edb8a9d7d3e45990.camel@perches.com>

On 7/28/21 8:37 AM, Joe Perches wrote:
> On Mon, 2021-07-26 at 17:21 -0700, Randy Dunlap wrote:
>> Running scripts/checkkconfigsymbols.py reports several hundred (maybe thousand)
>> Kconfig symbols that are used questionably. Lots of these are false positives
>> but lots of the remainder could use some cleaning up.
> []
>> False positive example:
>>
>> XCHOFFLD_MEM
>> Referencing files: drivers/scsi/qla2xxx/qla_mbx.c
>> Similar symbols: OF_PMEM, CXL_MEM, CXL_PMEM
>>
>> The Referencing source file does this:
>> #define CONFIG_XCHOFFLD_MEM	0x3
>>
>> which is legitimate, so no change is needed.
> 
> Legitimate is perhaps dubious.
> 
> It might be better if Kconfig has exclusive use of CONFIG_<foo> naming so
> renaming all the other existing CONFIG_<foo> defines might be appropriate.

I would prefer that as well -- maybe 15 years ago.
But I think it's too invasive to make that change now.

> 
> $ git grep -P '^\s*#\s*define\s+CONFIG_[A-Z]+\b'
> arch/alpha/kernel/smc37c93x.c:#define CONFIG_CONTROL            0x02
> arch/sh/drivers/pci/ops-sh4.c:#define CONFIG_CMD(bus, devfn, where) \
> arch/sh/include/asm/smc37c93x.h:#define CONFIG_PORT             0x3f0
> arch/sh/include/asm/smc37c93x.h:#define CONFIG_ENTER            0x55
> arch/sh/include/asm/smc37c93x.h:#define CONFIG_EXIT             0xaa
> arch/sparc/kernel/pcic.c:#define CONFIG_CMD(bus, device_fn, where) (0x80000000 | (((unsigned int)bus) << 16) | (((unsigned int)device_fn) << 8) | (where & ~3))
> arch/um/drivers/mconsole_kern.h:#define CONFIG_CHUNK(str, size, current, chunk, end) \
> drivers/atm/he.h:#define CONFIG_RSRA            0x00000
> drivers/atm/he.h:#define CONFIG_RCMLBM          0x08000
> drivers/atm/he.h:#define CONFIG_RCMABR          0x0d800
> drivers/atm/he.h:#define CONFIG_RSRB            0x0e000
> drivers/atm/he.h:#define CONFIG_TSRA            0x00000
> drivers/atm/he.h:#define CONFIG_TSRB            0x08000
> drivers/atm/he.h:#define CONFIG_TSRC            0x0c000
> drivers/atm/he.h:#define CONFIG_TSRD            0x0e000
> drivers/atm/he.h:#define CONFIG_TMABR           0x0f000
> drivers/atm/he.h:#define CONFIG_TPDBA           0x10000
> drivers/comedi/drivers/ni_at_a2150.c:#define CONFIG_REG         0x0
> drivers/crypto/atmel-i2c.h:#define CONFIG_ZONE                  0
> drivers/dma/idxd/perfmon.h:#define CONFIG_RESET         0x0000000000000001
> drivers/gpu/drm/amd/amdgpu/sid.h:#define        CONFIG_MEMSIZE                                  0x150A
> drivers/gpu/drm/amd/amdgpu/sid.h:#define CONFIG_CNTL    0x1509
> drivers/gpu/drm/radeon/cikd.h:#define   CONFIG_MEMSIZE                                  0x5428
> drivers/gpu/drm/radeon/evergreend.h:#define     CONFIG_MEMSIZE                                  0x5428
> drivers/gpu/drm/radeon/nid.h:#define    CONFIG_MEMSIZE                                  0x5428
> drivers/gpu/drm/radeon/r600d.h:#define  CONFIG_MEMSIZE                                  0x5428
> drivers/gpu/drm/radeon/r600d.h:#define CONFIG_CNTL                                      0x5424
> drivers/gpu/drm/radeon/rv515d.h:#define CONFIG_MEMSIZE                  0x00F8
> drivers/gpu/drm/radeon/rv770d.h:#define CONFIG_MEMSIZE                                  0x5428
> drivers/gpu/drm/radeon/sid.h:#define    CONFIG_MEMSIZE                                  0x5428
> drivers/macintosh/therm_adt746x.c:#define CONFIG_REG   0x40
> drivers/memory/ti-aemif.c:#define CONFIG_MASK   (TA(TA_MAX) | \
> drivers/mtd/spi-nor/controllers/aspeed-smc.c:#define CONFIG_REG                 0x0
> drivers/net/ethernet/smsc/smc91x.h:#define CONFIG_REG(lp)       SMC_REG(lp, 0x0000,     1)
> drivers/net/ethernet/smsc/smc91x.h:#define CONFIG_GPCNTRL       0x0400  // Inverse value drives pin nCNTRL
> drivers/net/ethernet/smsc/smc91x.h:#define CONFIG_DEFAULT       (CONFIG_EPH_POWER_EN)
> drivers/pcmcia/cs_internal.h:#define CONFIG_LOCKED              0x01
> drivers/pinctrl/mvebu/pinctrl-dove.c:#define CONFIG_PMU BIT(4)
> drivers/staging/vt6655/device_cfg.h:#define CONFIG_PATH            "/etc/vntconfiguration.dat"
> drivers/staging/vt6656/device.h:#define CONFIG_PATH                     "/etc/vntconfiguration.dat"
> drivers/thermal/qcom/tsens-8960.c:#define CONFIG_ADDR           0x3640
> drivers/thermal/qcom/tsens-8960.c:#define CONFIG_MASK           0xf
> drivers/usb/host/xhci.h:#define CONFIG_CIE              (1 << 9)
> drivers/video/fbdev/geode/display_gx1.h:#define CONFIG_GCR  0xb8
> tools/power/x86/intel-speed-select/isst.h:#define CONFIG_TDP                            0x7f
> tools/power/x86/intel-speed-select/isst.h:#define CONFIG_CLOS                           0xd0
> tools/testing/selftests/powerpc/copyloops/asm/ppc_asm.h:#define CONFIG_ALTIVEC
> tools/testing/selftests/powerpc/stringloops/asm/ppc_asm.h:#define CONFIG_ALTIVEC
> tools/testing/selftests/rcutorture/formal/srcu-cbmc/src/config.h:#define CONFIG_SMP
> tools/virtio/linux/kernel.h:#define CONFIG_SMP
> 
> 


-- 
~Randy


WARNING: multiple messages have this Message-ID (diff)
From: Randy Dunlap <rdunlap@infradead.org>
To: Joe Perches <joe@perches.com>,
	linux-kernel-mentees@lists.linuxfoundation.org
Cc: kernel-janitors <kernel-janitors@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: patch suggestion: Kconfig symbols
Date: Wed, 28 Jul 2021 12:41:33 -0700	[thread overview]
Message-ID: <09db53b9-7edf-44fc-c6b7-7c4e9198a2d4@infradead.org> (raw)
In-Reply-To: <e77e2329bdafdbea538be0d7edb8a9d7d3e45990.camel@perches.com>

On 7/28/21 8:37 AM, Joe Perches wrote:
> On Mon, 2021-07-26 at 17:21 -0700, Randy Dunlap wrote:
>> Running scripts/checkkconfigsymbols.py reports several hundred (maybe thousand)
>> Kconfig symbols that are used questionably. Lots of these are false positives
>> but lots of the remainder could use some cleaning up.
> []
>> False positive example:
>>
>> XCHOFFLD_MEM
>> Referencing files: drivers/scsi/qla2xxx/qla_mbx.c
>> Similar symbols: OF_PMEM, CXL_MEM, CXL_PMEM
>>
>> The Referencing source file does this:
>> #define CONFIG_XCHOFFLD_MEM	0x3
>>
>> which is legitimate, so no change is needed.
> 
> Legitimate is perhaps dubious.
> 
> It might be better if Kconfig has exclusive use of CONFIG_<foo> naming so
> renaming all the other existing CONFIG_<foo> defines might be appropriate.

I would prefer that as well -- maybe 15 years ago.
But I think it's too invasive to make that change now.

> 
> $ git grep -P '^\s*#\s*define\s+CONFIG_[A-Z]+\b'
> arch/alpha/kernel/smc37c93x.c:#define CONFIG_CONTROL            0x02
> arch/sh/drivers/pci/ops-sh4.c:#define CONFIG_CMD(bus, devfn, where) \
> arch/sh/include/asm/smc37c93x.h:#define CONFIG_PORT             0x3f0
> arch/sh/include/asm/smc37c93x.h:#define CONFIG_ENTER            0x55
> arch/sh/include/asm/smc37c93x.h:#define CONFIG_EXIT             0xaa
> arch/sparc/kernel/pcic.c:#define CONFIG_CMD(bus, device_fn, where) (0x80000000 | (((unsigned int)bus) << 16) | (((unsigned int)device_fn) << 8) | (where & ~3))
> arch/um/drivers/mconsole_kern.h:#define CONFIG_CHUNK(str, size, current, chunk, end) \
> drivers/atm/he.h:#define CONFIG_RSRA            0x00000
> drivers/atm/he.h:#define CONFIG_RCMLBM          0x08000
> drivers/atm/he.h:#define CONFIG_RCMABR          0x0d800
> drivers/atm/he.h:#define CONFIG_RSRB            0x0e000
> drivers/atm/he.h:#define CONFIG_TSRA            0x00000
> drivers/atm/he.h:#define CONFIG_TSRB            0x08000
> drivers/atm/he.h:#define CONFIG_TSRC            0x0c000
> drivers/atm/he.h:#define CONFIG_TSRD            0x0e000
> drivers/atm/he.h:#define CONFIG_TMABR           0x0f000
> drivers/atm/he.h:#define CONFIG_TPDBA           0x10000
> drivers/comedi/drivers/ni_at_a2150.c:#define CONFIG_REG         0x0
> drivers/crypto/atmel-i2c.h:#define CONFIG_ZONE                  0
> drivers/dma/idxd/perfmon.h:#define CONFIG_RESET         0x0000000000000001
> drivers/gpu/drm/amd/amdgpu/sid.h:#define        CONFIG_MEMSIZE                                  0x150A
> drivers/gpu/drm/amd/amdgpu/sid.h:#define CONFIG_CNTL    0x1509
> drivers/gpu/drm/radeon/cikd.h:#define   CONFIG_MEMSIZE                                  0x5428
> drivers/gpu/drm/radeon/evergreend.h:#define     CONFIG_MEMSIZE                                  0x5428
> drivers/gpu/drm/radeon/nid.h:#define    CONFIG_MEMSIZE                                  0x5428
> drivers/gpu/drm/radeon/r600d.h:#define  CONFIG_MEMSIZE                                  0x5428
> drivers/gpu/drm/radeon/r600d.h:#define CONFIG_CNTL                                      0x5424
> drivers/gpu/drm/radeon/rv515d.h:#define CONFIG_MEMSIZE                  0x00F8
> drivers/gpu/drm/radeon/rv770d.h:#define CONFIG_MEMSIZE                                  0x5428
> drivers/gpu/drm/radeon/sid.h:#define    CONFIG_MEMSIZE                                  0x5428
> drivers/macintosh/therm_adt746x.c:#define CONFIG_REG   0x40
> drivers/memory/ti-aemif.c:#define CONFIG_MASK   (TA(TA_MAX) | \
> drivers/mtd/spi-nor/controllers/aspeed-smc.c:#define CONFIG_REG                 0x0
> drivers/net/ethernet/smsc/smc91x.h:#define CONFIG_REG(lp)       SMC_REG(lp, 0x0000,     1)
> drivers/net/ethernet/smsc/smc91x.h:#define CONFIG_GPCNTRL       0x0400  // Inverse value drives pin nCNTRL
> drivers/net/ethernet/smsc/smc91x.h:#define CONFIG_DEFAULT       (CONFIG_EPH_POWER_EN)
> drivers/pcmcia/cs_internal.h:#define CONFIG_LOCKED              0x01
> drivers/pinctrl/mvebu/pinctrl-dove.c:#define CONFIG_PMU BIT(4)
> drivers/staging/vt6655/device_cfg.h:#define CONFIG_PATH            "/etc/vntconfiguration.dat"
> drivers/staging/vt6656/device.h:#define CONFIG_PATH                     "/etc/vntconfiguration.dat"
> drivers/thermal/qcom/tsens-8960.c:#define CONFIG_ADDR           0x3640
> drivers/thermal/qcom/tsens-8960.c:#define CONFIG_MASK           0xf
> drivers/usb/host/xhci.h:#define CONFIG_CIE              (1 << 9)
> drivers/video/fbdev/geode/display_gx1.h:#define CONFIG_GCR  0xb8
> tools/power/x86/intel-speed-select/isst.h:#define CONFIG_TDP                            0x7f
> tools/power/x86/intel-speed-select/isst.h:#define CONFIG_CLOS                           0xd0
> tools/testing/selftests/powerpc/copyloops/asm/ppc_asm.h:#define CONFIG_ALTIVEC
> tools/testing/selftests/powerpc/stringloops/asm/ppc_asm.h:#define CONFIG_ALTIVEC
> tools/testing/selftests/rcutorture/formal/srcu-cbmc/src/config.h:#define CONFIG_SMP
> tools/virtio/linux/kernel.h:#define CONFIG_SMP
> 
> 


-- 
~Randy

_______________________________________________
Linux-kernel-mentees mailing list
Linux-kernel-mentees@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees

  reply	other threads:[~2021-07-28 19:41 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-27  0:21 patch suggestion: Kconfig symbols Randy Dunlap
2021-07-27  0:33 ` Shuah Khan
2021-07-28 15:37 ` Joe Perches
2021-07-28 15:37   ` Joe Perches
2021-07-28 19:41   ` Randy Dunlap [this message]
2021-07-28 19:41     ` Randy Dunlap
2021-07-28 21:30     ` Joe Perches
2021-07-28 21:30       ` Joe Perches
2021-07-28 22:55       ` Randy Dunlap
2021-07-28 22:55         ` Randy Dunlap
2021-07-29  9:55   ` Greg KH
2021-07-29  9:55     ` Greg KH
2021-07-29 15:02 ` Lukas Bulwahn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=09db53b9-7edf-44fc-c6b7-7c4e9198a2d4@infradead.org \
    --to=rdunlap@infradead.org \
    --cc=joe@perches.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel-mentees@lists.linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.