2022-05-17 16:15:24

by Juerg Haefliger

[permalink] [raw]
Subject: [PATCH 0/3] ARM: Kconfig: Style cleanups

The majority of the Kconfig files use a single tab for basic indentation
and a single tab followed by two whitespaces for help text indentation.
Fix the lines that don't follow this convention.

While at it:
- Add trailing comments to endif/endmenu statements for better
readability.
- CLeanup some stray/extra/erronous tabs and/or single quotes
and/or whitespaces.

Juerg Haefliger (3):
ARM: Kconfig: Fix indentation and add comments
ARM: Kconfig-nommu: Fix indentation and quotes
ARM: Kconfig.debug: Fix indentation

arch/arm/Kconfig | 38 +++++++++++++++++++-------------------
arch/arm/Kconfig-nommu | 34 +++++++++++++++++-----------------
arch/arm/Kconfig.debug | 35 +++++++++++++++++------------------
3 files changed, 53 insertions(+), 54 deletions(-)

--
2.32.0



2022-05-18 03:14:49

by Juerg Haefliger

[permalink] [raw]
Subject: [PATCH 1/3] ARM: Kconfig: Fix indentation and add comments

The convention for indentation seems to be a single tab. Help text is
further indented by an additional two whitespaces. Fix the lines that
violate these rules.

While add it, add trailing comments to endif and endmenu statements for
better readability.

Signed-off-by: Juerg Haefliger <[email protected]>
---
arch/arm/Kconfig | 38 +++++++++++++++++++-------------------
1 file changed, 19 insertions(+), 19 deletions(-)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 2e8091e2d8a8..912716c99c82 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -181,7 +181,7 @@ config ARM_DMA_IOMMU_ALIGNMENT
specified order. The order is expressed as a power of two multiplied
by the PAGE_SIZE.

-endif
+endif # ARM_DMA_USE_IOMMU

config SYS_SUPPORTS_APM_EMULATION
bool
@@ -549,7 +549,7 @@ config ARCH_MULTI_CPU_AUTO
def_bool !(ARCH_MULTI_V4 || ARCH_MULTI_V4T || ARCH_MULTI_V6_V7)
select ARCH_MULTI_V5

-endmenu
+endmenu # "Multiple platform selection"

config ARCH_VIRT
bool "Dummy Virtual Machine"
@@ -771,7 +771,7 @@ config IWMMXT

if !MMU
source "arch/arm/Kconfig-nommu"
-endif
+endif # !MMU

config PJ4B_ERRATA_4742
bool "PJ4B Errata 4742: IDLE Wake Up Commands can Cause the CPU Core to Cease Operation"
@@ -973,14 +973,14 @@ config ARM_ERRATA_764369
in the diagnostic control register of the SCU.

config ARM_ERRATA_775420
- bool "ARM errata: A data cache maintenance operation which aborts, might lead to deadlock"
- depends on CPU_V7
- help
- This option enables the workaround for the 775420 Cortex-A9 (r2p2,
- r2p6,r2p8,r2p10,r3p0) erratum. In case a data cache maintenance
- operation aborts with MMU exception, it might cause the processor
- to deadlock. This workaround puts DSB before executing ISB if
- an abort may occur on cache maintenance.
+ bool "ARM errata: A data cache maintenance operation which aborts, might lead to deadlock"
+ depends on CPU_V7
+ help
+ This option enables the workaround for the 775420 Cortex-A9 (r2p2,
+ r2p6,r2p8,r2p10,r3p0) erratum. In case a data cache maintenance
+ operation aborts with MMU exception, it might cause the processor
+ to deadlock. This workaround puts DSB before executing ISB if
+ an abort may occur on cache maintenance.

config ARM_ERRATA_798181
bool "ARM errata: TLBI/DSB failure on Cortex-A15"
@@ -1073,7 +1073,7 @@ config ARM_ERRATA_857272
config option from the A12 erratum due to the way errata are checked
for and handled.

-endmenu
+endmenu # "System Type"

source "arch/arm/common/Kconfig"

@@ -1115,7 +1115,7 @@ config ARM_ERRATA_814220
This ERRATA only affected the Cortex-A7 and present in r0p2, r0p3,
r0p4, r0p5.

-endmenu
+endmenu # "Bus support"

menu "Kernel Features"

@@ -1631,7 +1631,7 @@ config STACKPROTECTOR_PER_TASK
Enable this option to switch to a different method that uses a
different canary value for each task.

-endmenu
+endmenu # "Kernel Features"

menu "Boot options"

@@ -1903,7 +1903,7 @@ config DMI
firmware need to be enabled. This would require the DMI subsystem
to be enabled much earlier than we do on ARM, which is non-trivial.

-endmenu
+endmenu # "Boot options"

menu "CPU Power Management"

@@ -1911,7 +1911,7 @@ source "drivers/cpufreq/Kconfig"

source "drivers/cpuidle/Kconfig"

-endmenu
+endmenu # "CPU Power Management"

menu "Floating point emulation"

@@ -1985,7 +1985,7 @@ config KERNEL_MODE_NEON
help
Say Y to include support for NEON in kernel mode.

-endmenu
+endmenu # "Floating point emulation"

menu "Power management options"

@@ -2005,10 +2005,10 @@ config ARCH_HIBERNATION_POSSIBLE
depends on MMU
default y if ARCH_SUSPEND_POSSIBLE

-endmenu
+endmenu # "Power management options"

if CRYPTO
source "arch/arm/crypto/Kconfig"
-endif
+endif # CRYPTO

source "arch/arm/Kconfig.assembler"
--
2.32.0


2022-05-18 03:38:41

by Juerg Haefliger

[permalink] [raw]
Subject: [PATCH 2/3] ARM: Kconfig-nommu: Fix indentation and quotes

The convention for indentation seems to be a single tab. Help text is
further indented by an additional two whitespaces. Fix the lines that
violate these rules.

While add it, replace single quotes with double-quotes.

Signed-off-by: Juerg Haefliger <[email protected]>
---
arch/arm/Kconfig-nommu | 34 +++++++++++++++++-----------------
1 file changed, 17 insertions(+), 17 deletions(-)

diff --git a/arch/arm/Kconfig-nommu b/arch/arm/Kconfig-nommu
index 36c80d3dd93f..5bc1b6d6526b 100644
--- a/arch/arm/Kconfig-nommu
+++ b/arch/arm/Kconfig-nommu
@@ -7,29 +7,29 @@
config SET_MEM_PARAM
bool "Set flash/sdram size and base addr"
help
- Say Y to manually set the base addresses and sizes.
- otherwise, the default values are assigned.
+ Say Y to manually set the base addresses and sizes.
+ otherwise, the default values are assigned.

config DRAM_BASE
- hex '(S)DRAM Base Address' if SET_MEM_PARAM
+ hex "(S)DRAM Base Address" if SET_MEM_PARAM
default 0x00800000

config DRAM_SIZE
- hex '(S)DRAM SIZE' if SET_MEM_PARAM
+ hex "(S)DRAM SIZE" if SET_MEM_PARAM
default 0x00800000

config FLASH_MEM_BASE
- hex 'FLASH Base Address' if SET_MEM_PARAM
+ hex "FLASH Base Address" if SET_MEM_PARAM
depends on CPU_ARM740T || CPU_ARM946E || CPU_ARM940T
default 0x00400000

config FLASH_SIZE
- hex 'FLASH Size' if SET_MEM_PARAM
+ hex "FLASH Size" if SET_MEM_PARAM
depends on CPU_ARM740T || CPU_ARM946E || CPU_ARM940T
default 0x00400000

config PROCESSOR_ID
- hex 'Hard wire the processor ID'
+ hex "Hard wire the processor ID"
default 0x00007700
depends on !(CPU_CP15 || CPU_V7M)
help
@@ -37,7 +37,7 @@ config PROCESSOR_ID
used instead of the auto-probing which utilizes the register.

config REMAP_VECTORS_TO_RAM
- bool 'Install vectors to the beginning of RAM'
+ bool "Install vectors to the beginning of RAM"
help
The kernel needs to change the hardware exception vectors.
In nommu mode, the hardware exception vectors are normally
@@ -54,13 +54,13 @@ config REMAP_VECTORS_TO_RAM
the writable versions located at DRAM_BASE.

config ARM_MPU
- bool 'Use the ARM v7 PMSA Compliant MPU'
- depends on CPU_V7 || CPU_V7M
- default y if CPU_V7
- help
- Some ARM systems without an MMU have instead a Memory Protection
- Unit (MPU) that defines the type and permissions for regions of
- memory.
+ bool "Use the ARM v7 PMSA Compliant MPU"
+ depends on CPU_V7 || CPU_V7M
+ default y if CPU_V7
+ help
+ Some ARM systems without an MMU have instead a Memory Protection
+ Unit (MPU) that defines the type and permissions for regions of
+ memory.

- If your CPU has an MPU then you should choose 'y' here unless you
- know that you do not want to use the MPU.
+ If your CPU has an MPU then you should choose 'y' here unless you
+ know that you do not want to use the MPU.
--
2.32.0


2022-05-18 03:50:14

by Russell King (Oracle)

[permalink] [raw]
Subject: Re: [PATCH 1/3] ARM: Kconfig: Fix indentation and add comments

Hi,

On Tue, May 17, 2022 at 04:14:22PM +0200, Juerg Haefliger wrote:
> The convention for indentation seems to be a single tab. Help text is
> further indented by an additional two whitespaces. Fix the lines that
> violate these rules.
>
> While add it, add trailing comments to endif and endmenu statements for
> better readability.

I have never been a fan of that practice, but I understand that some
people really like it. At the end of the day, it's subjective, so
let's leave it as-is for the time being.

The other changes are worth having though. Please send a patch making
just those changes.

Thanks.

--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!

2022-05-18 04:48:28

by Juerg Haefliger

[permalink] [raw]
Subject: [PATCH 3/3] ARM: Kconfig.debug: Fix indentation

The convention for indentation seems to be a single tab. Help text is
further indented by an additional two whitespaces. Fix the lines that
violate these rules.

Signed-off-by: Juerg Haefliger <[email protected]>
---
arch/arm/Kconfig.debug | 35 +++++++++++++++++------------------
1 file changed, 17 insertions(+), 18 deletions(-)

diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug
index 0c9497d549e3..4b00b1fd9ab3 100644
--- a/arch/arm/Kconfig.debug
+++ b/arch/arm/Kconfig.debug
@@ -22,28 +22,28 @@ config DEBUG_WX
depends on MMU
select ARM_PTDUMP_CORE
help
- Generate a warning if any W+X mappings are found at boot.
+ Generate a warning if any W+X mappings are found at boot.

- This is useful for discovering cases where the kernel is leaving
- W+X mappings after applying NX, as such mappings are a security risk.
+ This is useful for discovering cases where the kernel is leaving
+ W+X mappings after applying NX, as such mappings are a security risk.

- Look for a message in dmesg output like this:
+ Look for a message in dmesg output like this:

- arm/mm: Checked W+X mappings: passed, no W+X pages found.
+ arm/mm: Checked W+X mappings: passed, no W+X pages found.

- or like this, if the check failed:
+ or like this, if the check failed:

- arm/mm: Checked W+X mappings: FAILED, <N> W+X pages found.
+ arm/mm: Checked W+X mappings: FAILED, <N> W+X pages found.

- Note that even if the check fails, your kernel is possibly
- still fine, as W+X mappings are not a security hole in
- themselves, what they do is that they make the exploitation
- of other unfixed kernel bugs easier.
+ Note that even if the check fails, your kernel is possibly
+ still fine, as W+X mappings are not a security hole in
+ themselves, what they do is that they make the exploitation
+ of other unfixed kernel bugs easier.

- There is no runtime or memory usage effect of this option
- once the kernel has booted up - it's a one time check.
+ There is no runtime or memory usage effect of this option
+ once the kernel has booted up - it's a one time check.

- If in doubt, say "Y".
+ If in doubt, say "Y".

choice
prompt "Choose kernel unwinder"
@@ -293,7 +293,7 @@ choice
select DEBUG_UART_8250
help
Say Y here if you want the debug print routines to direct
- their output to the CNS3xxx UART0.
+ their output to the CNS3xxx UART0.

config DEBUG_DAVINCI_DA8XX_UART1
bool "Kernel low-level debugging on DaVinci DA8XX using UART1"
@@ -847,7 +847,7 @@ choice
select DEBUG_UART_8250
help
Say Y here if you want kernel low-level debugging support
- on Rockchip RV1108 based platforms.
+ on Rockchip RV1108 based platforms.

config DEBUG_RV1108_UART1
bool "Kernel low-level debugging messages via Rockchip RV1108 UART1"
@@ -1724,7 +1724,7 @@ config DEBUG_UART_PHYS
default 0xffffee00 if DEBUG_AT91_SAM9263_DBGU
default 0xfffff200 if DEBUG_AT91_RM9200_DBGU
depends on ARCH_EP93XX || \
- DEBUG_LL_UART_8250 || DEBUG_LL_UART_PL01X || \
+ DEBUG_LL_UART_8250 || DEBUG_LL_UART_PL01X || \
DEBUG_UART_8250 || DEBUG_UART_PL01X || DEBUG_MESON_UARTAO || \
DEBUG_QCOM_UARTDM || DEBUG_R7S72100_SCIF2 || \
DEBUG_R7S9210_SCIF2 || DEBUG_R7S9210_SCIF4 || \
@@ -1895,7 +1895,6 @@ config DEBUG_UNCOMPRESS
When this option is set, the selected DEBUG_LL output method
will be re-used for normal decompressor output on multiplatform
kernels.
-

config UNCOMPRESS_INCLUDE
string
--
2.32.0


2022-05-18 06:53:48

by Juerg Haefliger

[permalink] [raw]
Subject: [PATCH v2 1/3] ARM: Kconfig: Fix indentation

The convention for indentation seems to be a single tab. Help text is
further indented by an additional two whitespaces. Fix the lines that
violate these rules.

Signed-off-by: Juerg Haefliger <[email protected]>

---
v2:
Drop endif/endmenu trailing comments.
---
arch/arm/Kconfig | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 2e8091e2d8a8..e93653709f07 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -973,14 +973,14 @@ config ARM_ERRATA_764369
in the diagnostic control register of the SCU.

config ARM_ERRATA_775420
- bool "ARM errata: A data cache maintenance operation which aborts, might lead to deadlock"
- depends on CPU_V7
- help
- This option enables the workaround for the 775420 Cortex-A9 (r2p2,
- r2p6,r2p8,r2p10,r3p0) erratum. In case a data cache maintenance
- operation aborts with MMU exception, it might cause the processor
- to deadlock. This workaround puts DSB before executing ISB if
- an abort may occur on cache maintenance.
+ bool "ARM errata: A data cache maintenance operation which aborts, might lead to deadlock"
+ depends on CPU_V7
+ help
+ This option enables the workaround for the 775420 Cortex-A9 (r2p2,
+ r2p6,r2p8,r2p10,r3p0) erratum. In case a data cache maintenance
+ operation aborts with MMU exception, it might cause the processor
+ to deadlock. This workaround puts DSB before executing ISB if
+ an abort may occur on cache maintenance.

config ARM_ERRATA_798181
bool "ARM errata: TLBI/DSB failure on Cortex-A15"
--
2.32.0