public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] cifs: Use seq_putc() in two functions
@ 2024-07-14  8:35 Markus Elfring
  2024-07-14 21:31 ` Steve French
  0 siblings, 1 reply; 4+ messages in thread
From: Markus Elfring @ 2024-07-14  8:35 UTC (permalink / raw)
  To: samba-technical, linux-cifs, kernel-janitors, Bharath SM,
	Paulo Alcantara, Ronnie Sahlberg, Shyam Prasad N, Steve French,
	Tom Talpey
  Cc: LKML

From: Markus Elfring <elfring@users.sourceforge.net>
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.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 fs/smb/client/cifs_swn.c | 2 +-
 fs/smb/client/cifsfs.c   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/smb/client/cifs_swn.c b/fs/smb/client/cifs_swn.c
index 7233c6a7e6d7..68998c6ba7a2 100644
--- a/fs/smb/client/cifs_swn.c
+++ b/fs/smb/client/cifs_swn.c
@@ -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)
diff --git a/fs/smb/client/cifsfs.c b/fs/smb/client/cifsfs.c
index 6397fdefd876..ce5cb72bb81f 100644
--- a/fs/smb/client/cifsfs.c
+++ b/fs/smb/client/cifsfs.c
@@ -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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] cifs: Use seq_putc() in two functions
  2024-07-14  8:35 [PATCH] cifs: Use seq_putc() in two functions Markus Elfring
@ 2024-07-14 21:31 ` Steve French
  2024-07-15  5:16   ` Christophe JAILLET
  2024-07-15  5:57   ` Markus Elfring
  0 siblings, 2 replies; 4+ messages in thread
From: Steve French @ 2024-07-14 21:31 UTC (permalink / raw)
  To: Markus Elfring
  Cc: samba-technical, linux-cifs, kernel-janitors, Bharath SM,
	Paulo Alcantara, Ronnie Sahlberg, Shyam Prasad N, Steve French,
	Tom Talpey, LKML

are there other examples of modules where similar changes have been made?

On Sun, Jul 14, 2024 at 3:35 AM Markus Elfring <Markus.Elfring@web.de> wrote:
>
> From: Markus Elfring <elfring@users.sourceforge.net>
> 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.
>
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
> ---
>  fs/smb/client/cifs_swn.c | 2 +-
>  fs/smb/client/cifsfs.c   | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/fs/smb/client/cifs_swn.c b/fs/smb/client/cifs_swn.c
> index 7233c6a7e6d7..68998c6ba7a2 100644
> --- a/fs/smb/client/cifs_swn.c
> +++ b/fs/smb/client/cifs_swn.c
> @@ -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)
> diff --git a/fs/smb/client/cifsfs.c b/fs/smb/client/cifsfs.c
> index 6397fdefd876..ce5cb72bb81f 100644
> --- a/fs/smb/client/cifsfs.c
> +++ b/fs/smb/client/cifsfs.c
> @@ -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
>
>


-- 
Thanks,

Steve

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] cifs: Use seq_putc() in two functions
  2024-07-14 21:31 ` Steve French
@ 2024-07-15  5:16   ` Christophe JAILLET
  2024-07-15  5:57   ` Markus Elfring
  1 sibling, 0 replies; 4+ messages in thread
From: Christophe JAILLET @ 2024-07-15  5:16 UTC (permalink / raw)
  To: Steve French
  Cc: samba-technical, linux-cifs, kernel-janitors, Bharath SM,
	Paulo Alcantara, Ronnie Sahlberg, Shyam Prasad N, Steve French,
	Tom Talpey, LKML, Markus Elfring

Le 14/07/2024 à 23:31, Steve French a écrit :
> 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

> On Sun, Jul 14, 2024 at 3:35 AM Markus Elfring <Markus.Elfring@web.de> wrote:
>>
>> From: Markus Elfring <elfring@users.sourceforge.net>
>> 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.
>>
>> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
>> ---
>>   fs/smb/client/cifs_swn.c | 2 +-
>>   fs/smb/client/cifsfs.c   | 2 +-
>>   2 files changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/fs/smb/client/cifs_swn.c b/fs/smb/client/cifs_swn.c
>> index 7233c6a7e6d7..68998c6ba7a2 100644
>> --- a/fs/smb/client/cifs_swn.c
>> +++ b/fs/smb/client/cifs_swn.c
>> @@ -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)
>> diff --git a/fs/smb/client/cifsfs.c b/fs/smb/client/cifsfs.c
>> index 6397fdefd876..ce5cb72bb81f 100644
>> --- a/fs/smb/client/cifsfs.c
>> +++ b/fs/smb/client/cifsfs.c
>> @@ -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
>>
>>
> 
> 


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] cifs: Use seq_putc() in two functions
  2024-07-14 21:31 ` Steve French
  2024-07-15  5:16   ` Christophe JAILLET
@ 2024-07-15  5:57   ` Markus Elfring
  1 sibling, 0 replies; 4+ messages in thread
From: Markus Elfring @ 2024-07-15  5:57 UTC (permalink / raw)
  To: Steve French, samba-technical, linux-cifs, kernel-janitors
  Cc: Bharath SM, Paulo Alcantara, Ronnie Sahlberg, Shyam Prasad N,
	Steve French, Tom Talpey, LKML

> 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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-07-15  5:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-14  8:35 [PATCH] cifs: Use seq_putc() in two functions Markus Elfring
2024-07-14 21:31 ` Steve French
2024-07-15  5:16   ` Christophe JAILLET
2024-07-15  5:57   ` Markus Elfring

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox