LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* Re: patch suggestion: Kconfig symbols
       [not found] <295b8f8c-4264-9f32-6723-9d2d574021ac@infradead.org>
@ 2021-07-28 15:37 ` Joe Perches
  2021-07-28 19:41   ` Randy Dunlap
  2021-07-29  9:55   ` Greg KH
  0 siblings, 2 replies; 5+ messages in thread
From: Joe Perches @ 2021-07-28 15:37 UTC (permalink / raw)
  To: Randy Dunlap, linux-kernel-mentees; +Cc: LKML, kernel-janitors

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.

$ 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



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: patch suggestion: Kconfig symbols
  2021-07-28 15:37 ` patch suggestion: Kconfig symbols Joe Perches
@ 2021-07-28 19:41   ` Randy Dunlap
  2021-07-28 21:30     ` Joe Perches
  2021-07-29  9:55   ` Greg KH
  1 sibling, 1 reply; 5+ messages in thread
From: Randy Dunlap @ 2021-07-28 19:41 UTC (permalink / raw)
  To: Joe Perches, linux-kernel-mentees; +Cc: LKML, kernel-janitors

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: patch suggestion: Kconfig symbols
  2021-07-28 19:41   ` Randy Dunlap
@ 2021-07-28 21:30     ` Joe Perches
  2021-07-28 22:55       ` Randy Dunlap
  0 siblings, 1 reply; 5+ messages in thread
From: Joe Perches @ 2021-07-28 21:30 UTC (permalink / raw)
  To: Randy Dunlap; +Cc: linux-kernel-mentees, LKML, kernel-janitors

On 2021-07-28 12:41, Randy Dunlap wrote:
> 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.

I do not think it's that invasive.

It's something that doesn't have to be done immediately either.

It's not too many macro defines and not too many uses of those defines.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: patch suggestion: Kconfig symbols
  2021-07-28 21:30     ` Joe Perches
@ 2021-07-28 22:55       ` Randy Dunlap
  0 siblings, 0 replies; 5+ messages in thread
From: Randy Dunlap @ 2021-07-28 22:55 UTC (permalink / raw)
  To: Joe Perches; +Cc: linux-kernel-mentees, LKML, kernel-janitors

On 7/28/21 2:30 PM, Joe Perches wrote:
> On 2021-07-28 12:41, Randy Dunlap wrote:
>> 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.
> 
> I do not think it's that invasive.
> 
> It's something that doesn't have to be done immediately either.
> 
> It's not too many macro defines and not too many uses of those defines.

OK :)

I'm not trying to prevent such a change.

Getting the exclusive use of CONFIG_symbols being dedicated to
Kconfig namespace is the bug hurdle (IMO).

-- 
~Randy


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: patch suggestion: Kconfig symbols
  2021-07-28 15:37 ` patch suggestion: Kconfig symbols Joe Perches
  2021-07-28 19:41   ` Randy Dunlap
@ 2021-07-29  9:55   ` Greg KH
  1 sibling, 0 replies; 5+ messages in thread
From: Greg KH @ 2021-07-29  9:55 UTC (permalink / raw)
  To: Joe Perches; +Cc: Randy Dunlap, linux-kernel-mentees, kernel-janitors, LKML

On Wed, Jul 28, 2021 at 08:37:26AM -0700, Joe Perches wrote:
> drivers/staging/vt6655/device_cfg.h:#define CONFIG_PATH            "/etc/vntconfiguration.dat"
> drivers/staging/vt6656/device.h:#define CONFIG_PATH                     "/etc/vntconfiguration.dat"

This can be removed right now, I'll go do that, this is totally
unused...

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-07-29  9:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <295b8f8c-4264-9f32-6723-9d2d574021ac@infradead.org>
2021-07-28 15:37 ` patch suggestion: Kconfig symbols Joe Perches
2021-07-28 19:41   ` Randy Dunlap
2021-07-28 21:30     ` Joe Perches
2021-07-28 22:55       ` Randy Dunlap
2021-07-29  9:55   ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).