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]
Date:	Wed, 19 Nov 2008 18:00:37 +0100
From:	"Kay Sievers" <kay.sievers@...y.org>
To:	"rae l" <crquan@...il.com>
Cc:	"Greg KH" <gregkh@...e.de>, "Jens Axboe" <jens.axboe@...cle.com>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] kobject_add: use constant strings directly as fmt strings

On Wed, Nov 19, 2008 at 17:17, rae l <crquan@...il.com> wrote:
> On Wed, Nov 19, 2008 at 11:57 PM, Greg KH <gregkh@...e.de> wrote:
>>>       ret = kobject_add(&q->kobj, kobject_get(&disk_to_dev(disk)->kobj),
>>> -                       "%s", "queue");
>>> +                       "queue");
>>
>> Why?  What does this change buy us?
>
> Dropping one parameter makes the function call a little faster, doesn't it?
>
> The results are the same,

Not that we should be able to measure it, but it should save some
cycles parsing the format character and retrieving the string pointer
from the stack, yes.

> so if the string is constant, why not use it directly as the fmt string?

It should be fine for strings, where you can be sure they can never
contain a '%', sure.

Thanks,
Kay
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ