lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <7560b341-27b4-45b9-8b73-202ec7f27200@wanadoo.fr>
Date: Mon, 15 Jul 2024 07:18:57 +0200
From: Christophe JAILLET <christophe.jaillet@...adoo.fr>
To: Waiman Long <longman@...hat.com>, kernel-janitors@...r.kernel.org,
 Boqun Feng <boqun.feng@...il.com>, Ingo Molnar <mingo@...hat.com>,
 Peter Zijlstra <peterz@...radead.org>, Will Deacon <will@...nel.org>
Cc: LKML <linux-kernel@...r.kernel.org>,
 Markus Elfring <Markus.Elfring@....de>
Subject: Re: [PATCH] locking/lockdep: Use seq_putc() in five functions

Le 14/07/2024 à 23:31, Waiman Long a écrit :
> On 7/14/24 06:25, Markus Elfring wrote:
>> From: Markus Elfring <elfring@...rs.sourceforge.net>
>> Date: Sun, 14 Jul 2024 12:18:16 +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@...rs.sourceforge.net>
>> ---

...

>> @@ -422,10 +422,10 @@ static void seq_line(struct seq_file *m, char c, 
>> int offset, int length)
>>       int i;
>>
>>       for (i = 0; i < offset; i++)
>> -        seq_puts(m, " ");
>> +        seq_putc(m, ' ');

Hi,

Most of the time, this kind of modification is useless because it is 
already done by the compiler, see [1].

>>       for (i = 0; i < length; i++)
>>           seq_printf(m, "%c", c);

But changing this seq_printf() into a seq_putc() would, IMHO, make sense 
and save a few cycles, should it matter.

CJ

[1]: 
https://elixir.bootlin.com/linux/v6.10-rc7/source/include/linux/seq_file.h#L123

>> -    seq_puts(m, "\n");
>> +    seq_putc(m, '\n');
>>   }
>>
...

>> -- 
>> 2.45.2
>>
> Acked-by: Waiman Long <longman@...hat.com>
> 


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ