lkml.org 
[lkml]   [2022]   [Mar]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v2] block: use dedicated list iterator variable
From
On 3/31/22 3:12 AM, Jakob Koschel wrote:
> To move the list iterator variable into the list_for_each_entry_*()
> macro in the future it should be avoided to use the list iterator
> variable after the loop body.
>
> To *never* use the list iterator variable after the loop it was
> concluded to use a separate iterator variable instead of a
> found boolean [1].

Not a huge fan of doing a helper for this single use, but I guess it
does make the main function easier to code. So I guess that's fine. But
can you move the call down where the result is checked?

qe = blk_lookup_qe_pair(head, q);
if (!qe)
return;

I prefer no distance between call and check, makes it easier to read. I
can make the edit locally and note it in the commit message so you don't
have to re-send it. Let me know, or just resend a v3.

--
Jens Axboe

\
 
 \ /
  Last update: 2022-03-31 14:04    [W:0.087 / U:0.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site