cifs: Use seq_putc() in two functions
Subsystems (3)
PATCH 1/1 cifs: Use seq_putc() in two functions
From: Markus Elfring <[email protected]>
Date: Sun, 14 Jul 2024 10:23:49 +0200
Single characters should be put into a sequence.
Thus use the corresponding function “seq_putc”.
This issue was transformed by using the Coccinelle software.
--- fs/smb/client/cifs_swn.c | 2 +- fs/smb/client/cifsfs.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
fs/smb/client/cifs_swn.c +1 -1
@@ -655,7 +655,7 @@ void cifs_swn_dump(struct seq_file *m)seq_printf (m,"%s" , swnreg->ip_notify ?"(y)" :"(n)" ); }mutex_unlock (&cifs_swnreg_idr_mutex); -seq_puts (m,"\n" ); +seq_putc (m,'\n' ); }void cifs_swn_check (void )
fs/smb/client/cifsfs.c +1 -1
@@ -491,7 +491,7 @@ cifs_show_security(struct seq_file *s, struct cifs_ses *ses) }if (ses->sign) -seq_puts (s,"i" ); +seq_putc (s,'i' );if (ses->sectype == Kerberos) seq_printf(s, ",cruid=%u",
--
2.45.2
are there other examples of modules where similar changes have been made?
Quoted 45 lines · Markus Elfring
From: Markus Elfring <[email protected]>
Date: Sun, 14 Jul 2024 10:23:49 +0200Single characters should be put into a sequence.
Thus use the corresponding function “seq_putc”.This issue was transformed by using the Coccinelle software.
Signed-off-by Markus Elfring <[email protected]>--- fs/smb/client/cifs_swn.c | 2 +- fs/smb/client/cifsfs.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)fs/smb/client/cifs_swn.c +1
-1@@ -655,7 +655,7 @@ void cifs_swn_dump(struct seq_file *m)seq_printf (m,"%s" , swnreg->ip_notify ?"(y)" :"(n)" ); }mutex_unlock (&cifs_swnreg_idr_mutex); -seq_puts (m,"\n" ); +seq_putc (m,'\n' ); }void cifs_swn_check (void )fs/smb/client/cifsfs.c +1
-2@@ -491,7 +491,7 @@ cifs_show_security(struct seq_file *s, struct cifs_ses *ses) }if (ses->sign) -seq_puts (s,"i" ); +seq_putc (s,'i' );if (ses->sectype == Kerberos) seq_printf(s, ",cruid=%u", --2.45.2
Signature · 3 lines
Thanks, Steve
Le 14/07/2024 à 23:31, Steve French a écrit :
Quoted 2 lines
are there other examples of modules where similar changes have been made?
Hi Steve,
Most of the time, this kind of modification is useless because it is already done by the compiler, see [1].
CJ
[1]: https://elixir.bootlin.com/linux/v6.10-rc7/source/include/linux/seq_file.h#L123
Quoted 48 lines · Markus Elfring
Quoted 45 lines
From: Markus Elfring <[email protected]>
Date: Sun, 14 Jul 2024 10:23:49 +0200Single characters should be put into a sequence.
Thus use the corresponding function “seq_putc”.This issue was transformed by using the Coccinelle software.
Signed-off-by Markus Elfring <[email protected]>--- fs/smb/client/cifs_swn.c | 2 +- fs/smb/client/cifsfs.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)fs/smb/client/cifs_swn.c +1
-1@@ -655,7 +655,7 @@ void cifs_swn_dump(struct seq_file *m)seq_printf (m,"%s" , swnreg->ip_notify ?"(y)" :"(n)" ); }mutex_unlock (&cifs_swnreg_idr_mutex); -seq_puts (m,"\n" ); +seq_putc (m,'\n' ); }void cifs_swn_check (void )fs/smb/client/cifsfs.c +1
-2@@ -491,7 +491,7 @@ cifs_show_security(struct seq_file *s, struct cifs_ses *ses) }if (ses->sign) -seq_puts (s,"i" ); +seq_putc (s,'i' );if (ses->sectype == Kerberos) seq_printf(s, ",cruid=%u", --2.45.2
Quoted 1 line
are there other examples of modules where similar changes have been made?
Similar source code adjustment possibilities were presented for several software components.
https://lore.kernel.org/all/?q=seq_puts
Regards,
Markus