staging: Fix multiple issues
Subsystems (2)
cover staging: Fix multiple issues
This patchset fixes multiple issues found using checkpatch.pl
Amitoj Kaur Chawla (3):
staging: sm750fb: Replace uint32_t with u32
staging: sm750fb: Remove volatile modifier
staging: lustre: ptlrpc: Replace seq_printf() with seq_puts()
drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c | 2 +- drivers/staging/sm750fb/ddk750_power.c | 8 ++++---- drivers/staging/sm750fb/sm750.h | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-)
Signature · 1 line
1.9.1
PATCH 1/3 staging: sm750fb: Replace uint32_t with u32
Replace uint32_t with u32 consistent with Linux kernel coding practice.
Problem found using checkpatch.pl
--- drivers/staging/sm750fb/ddk750_power.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/staging/sm750fb/ddk750_power.c +4 -4
@@ -108,7 +108,7 @@ void setCurrentGate(unsigned int gate)*/ void enable2DEngine (unsigned int enable) { -uint32_t gate; +u32 gate; gate =PEEK32 (CURRENT_GATE );if (enable) {
@@ -124,7 +124,7 @@ void enable2DEngine(unsigned int enable)void enableDMA (unsigned int enable) { -uint32_t gate; +u32 gate;/* Enable DMA Gate */ gate =PEEK32 (CURRENT_GATE );
@@ -141,7 +141,7 @@ void enableDMA(unsigned int enable)*/ void enableGPIO (unsigned int enable) { -uint32_t gate; +u32 gate;/* Enable GPIO Gate */ gate =PEEK32 (CURRENT_GATE );
@@ -158,7 +158,7 @@ void enableGPIO(unsigned int enable)*/ void enableI2C (unsigned int enable) { -uint32_t gate; +u32 gate;/* Enable I2C Gate */ gate =PEEK32 (CURRENT_GATE );
Signature · 1 line
1.9.1
PATCH 2/3 staging: sm750fb: Remove volatile modifier
In reply to Amitoj Kaur Chawla'volatile' is not needed for regular variable. Problem found using checkpatch.pl
WARNING: Use of volatile is usually wrong: see Documentation/volatile-considered -harmful.txt
--- drivers/staging/sm750fb/sm750.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/staging/sm750fb/sm750.h +3 -3
@@ -15,9 +15,9 @@ extern int smi_indent;struct lynx_accel {/* base virtual address of DPR registers */ -volatile unsigned char __iomem *dprBase; +unsigned char __iomem *dprBase;/* base virtual address of de data port */ -volatile unsigned char __iomem *dpPortBase; +unsigned char __iomem *dpPortBase;/* function fointers */ void (*de_init)(struct lynx_accel *);
@@ -79,7 +79,7 @@ struct lynx_cursor {char __iomem *vstart;int offset;/* mmio addr of hw cursor */ -volatile char __iomem *mmio; +char __iomem *mmio;/* the lynx_share of this adaptor */ struct lynx_share *share;/* proc_routines */
Signature · 1 line
1.9.1
PATCH 3/3 staging: lustre: ptlrpc: Replace seq_printf() with seq_puts()
In reply to Amitoj Kaur ChawlaReplace seq_printf() with seq_puts() since it is more expensive than seq_puts(). Problem found using checkpatch.pl
WARNING: Prefer seq_puts to seq_printf
--- drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c +1 -1
@@ -923,7 +923,7 @@ static int ptlrpc_lprocfs_svc_req_history_show(struct seq_file *s, void *iter) (long )(req->rq_sent - req->rq_arrival_time.tv_sec), (long)(req->rq_sent - req->rq_deadline));if (svc->srv_ops.so_req_printer ==NULL ) -seq_printf (s,"\n" ); +seq_puts (s,"\n" );else svc->srv_ops.so_req_printer (s, srhi->srhi_req); }
Signature · 1 line
1.9.1
Greg KH
maintainerRe: [Outreachy kernel] [PATCH 3/3] staging: lustre: ptlrpc: Replace seq_printf() with seq_puts()
Quoted 14 lines · Amitoj Kaur Chawla
Replace
seq_printf()withseq_puts()since it is more expensive thanseq_puts(). Problem found using checkpatch.pl
WARNING: Preferseq_putstoseq_printfSigned-off-by Amitoj Kaur Chawla <[email protected]>--- drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c +0
-0
drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c static int ptlrpc_lprocfs_svc_req_history_show(struct seq_file *s, void *iter) · line 926
Quoted 5 lines
drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c +1
-1@@ -923,7 +923,7 @@ static int ptlrpc_lprocfs_svc_req_history_show(struct seq_file *s, void *iter) (long )(req->rq_sent - req->rq_arrival_time.tv_sec), (long)(req->rq_sent - req->rq_deadline));if (svc->srv_ops.so_req_printer ==NULL ) -seq_printf (s,"\n" ); +seq_puts (s,"\n" );
Shouldn't this really be seq_putc() instead?
thanks,
greg k-h
Greg KH
maintainerRe: [Outreachy kernel] [PATCH 2/3] staging: sm750fb: Remove volatile modifier
In reply to Amitoj Kaur ChawlaQuoted 25 lines · Amitoj Kaur Chawla
'volatile' is not needed for regular variable. Problem found using checkpatch.pl
WARNING: Use of volatile is usually wrong: seeDocumentation/volatile-considered-harmful.txtSigned-off-by Amitoj Kaur Chawla <[email protected]>--- drivers/staging/sm750fb/sm750.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)drivers/staging/sm750fb/sm750.h +2
-2@@ -15,9 +15,9 @@ extern int smi_indent;struct lynx_accel {/* base virtual address of DPR registers */ -volatile unsigned char __iomem *dprBase; +unsigned char __iomem *dprBase;/* base virtual address of de data port */ -volatile unsigned char __iomem *dpPortBase; +unsigned char __iomem *dpPortBase;/* function fointers */ void (*de_init)(struct lynx_accel *);
drivers/staging/sm750fb/sm750.h struct lynx_cursor { · line 82
Quoted 5 lines
drivers/staging/sm750fb/sm750.h +1
-1@@ -79,7 +79,7 @@ struct lynx_cursor {char __iomem *vstart;int offset;/* mmio addr of hw cursor */ -volatile char __iomem *mmio; +char __iomem *mmio;
Have you verified that the code is still working properly? Sometimes this isn't as simple as just deleting the modifier :(
thanks,
greg k-h
Re: [Outreachy kernel] [PATCH 3/3] staging: lustre: ptlrpc: Replace seq_printf() with seq_puts()
In reply to Greg KHQuoted 23 lines · Greg KH
Quoted 14 lines · Amitoj Kaur Chawla
Replace
seq_printf()withseq_puts()since it is more expensive thanseq_puts(). Problem found using checkpatch.pl
WARNING: Preferseq_putstoseq_printfSigned-off-by Amitoj Kaur Chawla <[email protected]>--- drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c +0
-0drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c static int ptlrpc_lprocfs_svc_req_history_show(struct seq_file *s, void *iter) · line 926
Quoted 5 lines
drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c +1
-1@@ -923,7 +923,7 @@ static int ptlrpc_lprocfs_svc_req_history_show(struct seq_file *s, void *iter) (long )(req->rq_sent - req->rq_arrival_time.tv_sec), (long)(req->rq_sent - req->rq_deadline));if (svc->srv_ops.so_req_printer ==NULL ) -seq_printf (s,"\n" ); +seq_puts (s,"\n" );Shouldn't this really be
seq_putc()instead?
Quoted 3 lines
thanks,
greg k-h
's' is not of char type but char *
I build tested this and sent. After your question I had doubts again so I tried seq_putc() but it breaks the build.
Signature · 1 line
Amitoj
Re: [Outreachy kernel] [PATCH 3/3] staging: lustre: ptlrpc: Replace seq_printf() with seq_puts()
Quoted 24 lines · Amitoj Kaur Chawla
Quoted 23 lines · Greg KH
Quoted 14 lines · Amitoj Kaur Chawla
Replace
seq_printf()withseq_puts()since it is more expensive thanseq_puts(). Problem found using checkpatch.pl
WARNING: Preferseq_putstoseq_printfSigned-off-by Amitoj Kaur Chawla <[email protected]>--- drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c +0
-0drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c static int ptlrpc_lprocfs_svc_req_history_show(struct seq_file *s, void *iter) · line 926
Quoted 5 lines
drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c +1
-1@@ -923,7 +923,7 @@ static int ptlrpc_lprocfs_svc_req_history_show(struct seq_file *s, void *iter) (long )(req->rq_sent - req->rq_arrival_time.tv_sec), (long)(req->rq_sent - req->rq_deadline));if (svc->srv_ops.so_req_printer ==NULL ) -seq_printf (s,"\n" ); +seq_puts (s,"\n" );Shouldn't this really be
seq_putc()instead?
Quoted 7 lines
Quoted 3 lines
thanks,
greg k-h
's' is not of char type but char *
I build tested this and sent. After your question I had doubts again so I triedseq_putc()but it breaks the build.
"\n" could be '\n'.
julia
Quoted 11 lines
--
Amitoj--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/CA%2B5yK5E%3D0Ed0HUtJoxx6VGKr6EuBGfdgnR8%3DJa_wEUTxk7whMw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Re: [Outreachy kernel] [PATCH 3/3] staging: lustre: ptlrpc: Replace seq_printf() with seq_puts()
Quoted 30 lines · Julia Lawall
Quoted 28 lines · Amitoj Kaur Chawla
Quoted 26 lines · Greg KH
Quoted 14 lines · Amitoj Kaur Chawla
Replace
seq_printf()withseq_puts()since it is more expensive thanseq_puts(). Problem found using checkpatch.pl
WARNING: Preferseq_putstoseq_printfSigned-off-by Amitoj Kaur Chawla <[email protected]>--- drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c +0
-0drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c static int ptlrpc_lprocfs_svc_req_history_show(struct seq_file *s, void *iter) · line 926
Quoted 5 lines
drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c +1
-1@@ -923,7 +923,7 @@ static int ptlrpc_lprocfs_svc_req_history_show(struct seq_file *s, void *iter) (long )(req->rq_sent - req->rq_arrival_time.tv_sec), (long)(req->rq_sent - req->rq_deadline));if (svc->srv_ops.so_req_printer ==NULL ) -seq_printf (s,"\n" ); +seq_puts (s,"\n" );Shouldn't this really be
seq_putc()instead?thanks,
greg k-h
Quoted 8 lines
Quoted 3 lines
's' is not of char type but char *
I build tested this and sent. After your question I had doubts again so I triedseq_putc()but it breaks the build."\n" could be '\n'.
julia
So I should write it as seq_puts(s, '\n');?
Should I resend this?
Signature · 1 line
Amitoj
Re: [Outreachy kernel] [PATCH 3/3] staging: lustre: ptlrpc: Replace seq_printf() with seq_puts()
Quoted 35 lines · Amitoj Kaur Chawla
Quoted 34 lines · Julia Lawall
Quoted 31 lines · Amitoj Kaur Chawla
Quoted 23 lines · Greg KH
Quoted 14 lines · Amitoj Kaur Chawla
Replace
seq_printf()withseq_puts()since it is more expensive thanseq_puts(). Problem found using checkpatch.pl
WARNING: Preferseq_putstoseq_printfSigned-off-by Amitoj Kaur Chawla <[email protected]>--- drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c +0
-0drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c static int ptlrpc_lprocfs_svc_req_history_show(struct seq_file *s, void *iter) · line 926
Quoted 5 lines
drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c +1
-1@@ -923,7 +923,7 @@ static int ptlrpc_lprocfs_svc_req_history_show(struct seq_file *s, void *iter) (long )(req->rq_sent - req->rq_arrival_time.tv_sec), (long)(req->rq_sent - req->rq_deadline));if (svc->srv_ops.so_req_printer ==NULL ) -seq_printf (s,"\n" ); +seq_puts (s,"\n" );Shouldn't this really be
seq_putc()instead?Quoted 3 lines
thanks,
greg k-h
's' is not of char type but char *
I build tested this and sent. After your question I had doubts again so I triedseq_putc()but it breaks the build.
Quoted 6 lines
Quoted 4 lines
"\n" could be '\n'.
julia
So I should write it as
seq_puts(s, '\n');?
You should use seq_putc.
Quoted 1 line
Should I resend this?
Yes.
julia