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: <a8d29094-2db3-495e-8a71-9d11992c4d9c@web.de>
Date: Thu, 4 Sep 2025 08:05:54 +0200
From: Markus Elfring <Markus.Elfring@....de>
To: Liao Yuanhong <liaoyuanhong@...o.com>, linux-block@...r.kernel.org,
 Jens Axboe <axboe@...nel.dk>, Damien Le Moal <dlemoal@...nel.org>
Cc: LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] elevator: avoid redundant conditions

…
> it avoids writing out a condition that is unnecessary. Let's drop such

                                                         Thus?


> unnecessary conditions.

  an unnecessary condition?


Would a summary phrase like “Avoid redundant condition in elv_rb_add()”
be nicer?


…
> +++ b/block/elevator.c
> @@ -240,7 +240,7 @@ void elv_rb_add(struct rb_root *root, struct request *rq)
>  
>  		if (blk_rq_pos(rq) < blk_rq_pos(__rq))
>  			p = &(*p)->rb_left;
> -		else if (blk_rq_pos(rq) >= blk_rq_pos(__rq))
> +		else
>  			p = &(*p)->rb_right;


Would you dare to apply a conditional expression here?

		p = (blk_rq_pos(rq) < blk_rq_pos(__rq)) ? &(*p)->rb_left : &(*p)->rb_right;


Regards,
Markus

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ