Skip to contentSkip to conversation

staging: lustre: fix coding style errors in drivers/staging/lustre/lustre/libcfs/linux/linux-proc.c

PATCH Superseded Tal Shorer 2 participants 2 messages Feb 5, 2015 Staging

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Tal Shorer

author
#0 lore raw

PATCH 1/1 staging: lustre: fix coding style errors in drivers/staging/lustre/lustre/libcfs/linux/linux-proc.c

---
 drivers/staging/lustre/lustre/libcfs/linux/linux-proc.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/staging/lustre/lustre/libcfs/linux/linux-proc.c +3 -3
index c539e37..acc2e10 100644
@@ -65,7 +65,7 @@
 #include <asm/div64.h>
 #include "../tracefile.h"
 
-static struct ctl_table_header *lnet_table_header = NULL;
+static struct ctl_table_header *lnet_table_header;
 extern char lnet_upcall[1024];
 /**
  * The path of debug log dump upcall script.
@@ -165,7 +165,7 @@ static int proc_dobitmasks(struct ctl_table *table, int write,
 				 __proc_dobitmasks);
 }
 
-static int min_watchdog_ratelimit = 0;	  /* disable ratelimiting */
+static int min_watchdog_ratelimit;	  /* disable ratelimiting */
 static int max_watchdog_ratelimit = (24*60*60); /* limit to once per day */
 
 static int __proc_dump_kernel(void *data, int write,
@@ -308,7 +308,7 @@ static int proc_console_backoff(struct ctl_table *table, int write,
 	dummy.proc_handler = &proc_dointvec;
 
 	if (!write) { /* read */
-		backoff= libcfs_console_backoff;
+		backoff = libcfs_console_backoff;
 		rc = proc_dointvec(&dummy, write, buffer, lenp, ppos);
 		return rc;
 	}
Signature · 1 line
2.2.2
#1 lore raw
Quoted 19 lines · Tal Shorer

---
drivers/staging/lustre/lustre/libcfs/linux/linux-proc.c | 6 +++---

1 file changed, 3 insertions(+), 3 deletions(-)
drivers/staging/lustre/lustre/libcfs/linux/linux-proc.c +1 -1
index c539e37..acc2e10 100644
@@ -65,7 +65,7 @@
 #include <asm/div64.h>
 #include "../tracefile.h"
 
-static struct ctl_table_header *lnet_table_header = NULL;
+static struct ctl_table_header *lnet_table_header;
 extern char lnet_upcall[1024];
 /**
 * The path of debug log dump upcall script.

drivers/staging/lustre/lustre/libcfs/linux/linux-proc.c static int proc_dobitmasks(struct ctl_table *table, int write, · line 168

Quoted 5 lines
drivers/staging/lustre/lustre/libcfs/linux/linux-proc.c +1 -1
@@ -165,7 +165,7 @@ static int proc_dobitmasks(struct ctl_table *table, int write,
 				 __proc_dobitmasks);
 }
 
-static int min_watchdog_ratelimit = 0;	  /* disable ratelimiting */
+static int min_watchdog_ratelimit;	  /* disable ratelimiting */

I think you just made this comment nonsensical by this change.
= 0 is explained as that disables the rate limiting. With no assignment (I know it's a noop) it's now unclear what does the comment says and possibly needs to be expanded to say something like "0 to disable ratelimiting" or the like, but it's less readable.

Quoted 1 line

static int max_watchdog_ratelimit = (24*60*60); /* limit to once per day */

In reality these two "variables" are nothing more than constants, they are never changed too. Their only purpose is to be fed into procfs code (proc_dointvec_minmax) to know the range of values to accepted.
As such spelling them out makes the most sense in my view.

The rest of the patch I think is good.
Thanks.

Quoted 13 lines

static int __proc_dump_kernel(void *data, int write,

drivers/staging/lustre/lustre/libcfs/linux/linux-proc.c +1 -1
@@ -308,7 +308,7 @@ static int proc_console_backoff(struct ctl_table *table, int write,
 	dummy.proc_handler = &proc_dointvec;
 
 	if (!write) { /* read */
-		backoff= libcfs_console_backoff;
+		backoff = libcfs_console_backoff;
 		rc = proc_dointvec(&dummy, write, buffer, lenp, ppos);
 		return rc;
 	}
Signature · 1 line
2.2.2