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: <8fdbe81c-8f43-40bb-91b8-d5c8c978fbad@acm.org>
Date:   Sun, 30 Oct 2022 07:34:33 -0700
From:   Bart Van Assche <bvanassche@....org>
To:     Dawei Li <set_pte_at@...look.com>, axboe@...nel.dk
Cc:     hch@....de, linux-block@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3] block: simplify blksize_bits() implementation

On 10/29/22 22:20, Dawei Li wrote:
> @@ -1349,12 +1349,7 @@ static inline int blk_rq_aligned(struct request_queue *q, unsigned long addr,
>   /* assumes size > 256 */
>   static inline unsigned int blksize_bits(unsigned int size)
>   {
> -	unsigned int bits = 8;
> -	do {
> -		bits++;
> -		size >>= 1;
> -	} while (size > 256);
> -	return bits;
> +	return order_base_2(size >> SECTOR_SHIFT) + SECTOR_SHIFT;
>   }

Reviewed-by: Bart Van Assche <bvanassche@....org>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ