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: <YiXVD8O3qyDEOGni@smile.fi.intel.com>
Date:   Mon, 7 Mar 2022 11:49:03 +0200
From:   Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To:     Jakob Koschel <jakobkoschel@...il.com>
Cc:     Linus Torvalds <torvalds@...ux-foundation.org>,
        linux-kernel@...r.kernel.org,
        Andrew Morton <akpm@...ux-foundation.org>,
        Greg Kroah-Hartman <greg@...ah.com>,
        Mike Rapoport <rppt@...nel.org>,
        Brian Johannesmeyer <bjohannesmeyer@...il.com>,
        Cristiano Giuffrida <c.giuffrida@...nl>,
        "Bos, H.J." <h.j.bos@...nl>
Subject: Re: [PATCH] list: always set pos in list_prepare_entry()

On Sun, Mar 06, 2022 at 05:26:35PM +0100, Jakob Koschel wrote:
> In order to assign the result from list_prepare_entry() to another
> variable, it should also be set when pos != NULL.
> 
> This will be useful once the list iterator is no longer used after
> the loop.

...

>  #define list_prepare_entry(pos, head, member) \
> -	((pos) ? : list_entry(head, typeof(*pos), member))
> +	((pos) ? pos : list_entry(head, typeof(*pos), member))

I'm not sure why then we have () surrounding first pos.

Am I right that the original is an equivalent to

	((pos) ? (pos) : list_entry(head, typeof(*pos), member))

?

Then what the difference is made by not using parentheses?

-- 
With Best Regards,
Andy Shevchenko


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ