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] [day] [month] [year] [list]
Message-ID: <9bfe2c52eca40102f5175a1421cf3059195d7663.camel@perches.com>
Date:   Mon, 29 Nov 2021 22:33:21 -0800
From:   Joe Perches <joe@...ches.com>
To:     Colin Ian King <colin.i.king@...glemail.com>,
        Ilya Dryomov <idryomov@...il.com>,
        Dongsheng Yang <dongsheng.yang@...ystack.cn>,
        Jens Axboe <axboe@...nel.dk>, ceph-devel@...r.kernel.org,
        linux-block@...r.kernel.org
Cc:     kernel-janitors@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] rbd: make const pointer speaces a static const array

On Sat, 2021-11-27 at 17:21 +0000, Colin Ian King wrote:
> Don't populate the const array spaces on the stack but make it static
> const and make the pointer an array to remove a dereference. Shrinks
> object code a little too.  Also clean up intent, currently it is spaces
> and should be a tab.
[]
> diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
[]
> @@ -6189,7 +6189,7 @@ static inline size_t next_token(const char **buf)
>          * These are the characters that produce nonzero for
>          * isspace() in the "C" and "POSIX" locales.
>          */
> -        const char *spaces = " \f\n\r\t\v";
> +	static const char spaces[] = " \f\n\r\t\v";
>  
>          *buf += strspn(*buf, spaces);	/* Find start of token */
>  

perhaps

	while (isspace(**buf))
		(*buf)++;

and not have or use spaces at all.


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ