Skip to contentSkip to conversation

sparc/kernel: Fix syntax error

PATCH In review [email protected] 2 participants 2 messages Jun 14, 2023 1 message not in the archive SPARC + UltraSPARC (sparc/sparc64)

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH 1/1 sparc/kernel: Fix syntax error

Fix the following checkpatch error:

ERROR: space required before the open parenthesis '('
ERROR: do not initialise statics to 0
ERROR: trailing whitespace

---
 arch/sparc/kernel/apc.c | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)
arch/sparc/kernel/apc.c +11 -11
index ecd05bc0a104..40b9c72ad4d9 100644
@@ -24,7 +24,7 @@
 #include <asm/processor.h>
 
 /* Debugging
- *
+ *
  * #define APC_DEBUG_LED
  */
 
@@ -33,20 +33,20 @@
 #define APC_DEVNAME "apc"
 
 static u8 __iomem *regs;
-static int apc_no_idle = 0;
+static int apc_no_idle;
 
 #define apc_readb(offs)        (sbus_readb(regs+offs))
 #define apc_writeb(val, offs)     (sbus_writeb(val, regs+offs))
 
-/* Specify "apc=noidle" on the kernel command line to
+/* Specify "apc=noidle" on the kernel command line to
  * disable APC CPU standby support.  Certain prototype
  * systems (SPARCstation-Fox) do not play well with APC
- * CPU idle, so disable this if your system has APC and
+ * CPU idle, so disable this if your system has APC and
  * crashes randomly.
  */
-static int __init apc_setup(char *str)
+static int __init apc_setup(char *str)
 {
-    if(!strncmp(str, "noidle", strlen("noidle"))) {
+    if (!strncmp(str, "noidle", strlen("noidle"))) {
         apc_no_idle = 1;
         return 1;
     }
@@ -54,22 +54,22 @@ static int __init apc_setup(char *str)
 }
 __setup("apc=", apc_setup);
 
-/*
+/*
  * CPU idle callback function
  * See .../arch/sparc/kernel/process.c
  */
 static void apc_swift_idle(void)
 {
 #ifdef APC_DEBUG_LED
-    set_auxio(0x00, AUXIO_LED);
+    set_auxio(0x00, AUXIO_LED);
 #endif
 
     apc_writeb(apc_readb(APC_IDLE_REG) | APC_IDLE_ON, APC_IDLE_REG);
 
 #ifdef APC_DEBUG_LED
-    set_auxio(AUXIO_LED, 0x00);
+    set_auxio(AUXIO_LED, 0x00);
 #endif
-}
+}
 
 static inline void apc_free(struct platform_device *op)
 {
@@ -162,7 +162,7 @@ static int apc_probe(struct platform_device *op)
     if (!apc_no_idle)
         sparc_idle = apc_swift_idle;
 
-    printk(KERN_INFO "%s: power management initialized%s\n",
+    pr_info("%s: power management initialized%s\n",
            APC_DEVNAME, apc_no_idle ? " (CPU idle disabled)" : "");
 
     return 0;
#2 lore raw

Hi Yonggang,

Quoted 6 lines · On Wed, Jun 14, 2023 at 4:19 PM <[email protected]> wrote:

Fix the following checkpatch error:

ERROR: space required before the open parenthesis '('
ERROR: do not initialise statics to 0
ERROR: trailing whitespace

While this patch is mostly correct and is fixing real issues with this code, it is very old code in a very old part of the kernel and the maintainers are unlikely to apply it as they'd prefer to leave it as-is and not introduce any potential for regressions.

Quoted 11 lines
---
  arch/sparc/kernel/apc.c | 22 +++++++++++-----------
  1 file changed, 11 insertions(+), 11 deletions(-)
arch/sparc/kernel/apc.c +0 -0
index ecd05bc0a104..40b9c72ad4d9 100644

arch/sparc/kernel/apc.c static int apc_probe(struct platform_device *op) · line 165

Quoted 5 lines
arch/sparc/kernel/apc.c +1 -1
@@ -162,7 +162,7 @@ static int apc_probe(struct platform_device *op)
      if (!apc_no_idle)
          sparc_idle = apc_swift_idle;
 
-    printk(KERN_INFO "%s: power management initialized%s\n",
+    pr_info("%s: power management initialized%s\n",

While this is most likely harmless, this is technically a change in behaviour and should have been noted in the commit message. Also, as this is technically a change in behaviour, it will make it even less likely that this will be applied.

Thanks,

Signature · 4 lines
Julian Calaby

Email: [email protected]
Profile: http://www.google.com/profiles/julian.calaby/