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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20171012113017.a088595ca60df1d591aebe38@linux-foundation.org>
Date:   Thu, 12 Oct 2017 11:30:17 -0700
From:   Andrew Morton <akpm@...ux-foundation.org>
To:     Lukas Wunner <lukas@...ner.de>
Cc:     Linus Walleij <linus.walleij@...aro.org>,
        Mathias Duckeck <m.duckeck@...bus.de>,
        Phil Elwell <phil@...pberrypi.org>, linux-gpio@...r.kernel.org,
        Bart Van Assche <bart.vanassche@....com>,
        Alasdair Kergon <agk@...hat.com>,
        Mike Snitzer <snitzer@...hat.com>, Neil Brown <neilb@...e.com>,
        Peter Zijlstra <peterz@...radead.org>,
        Ingo Molnar <mingo@...hat.com>,
        "Theodore Ts'o" <tytso@....edu>, Borislav Petkov <bp@...en8.de>,
        "H. Peter Anvin" <hpa@...or.com>,
        Denys Vlasenko <dvlasenk@...hat.com>,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 1/5] bitops: Introduce assign_bit()

On Thu, 12 Oct 2017 12:40:10 +0200 Lukas Wunner <lukas@...ner.de> wrote:

> A common idiom is to assign a value to a bit with:
> 
>     if (value)
>         set_bit(nr, addr);
>     else
>         clear_bit(nr, addr);
> 
> Likewise common is the one-line expression variant:
> 
>     value ? set_bit(nr, addr) : clear_bit(nr, addr);
> 
> Commit 9a8ac3ae682e ("dm mpath: cleanup QUEUE_IF_NO_PATH bit
> manipulation by introducing assign_bit()") introduced assign_bit()
> to the md subsystem for brevity.
> 
> Make it available to others, specifically gpiolib and the upcoming
> driver for Maxim MAX3191x industrial serializer chips.
> 
> As requested by Peter Zijlstra, change the argument order to reflect
> traditional "dst = src" in C, hence "assign_bit(nr, addr, value)".

Acked-by: Andrew Morton <akpm@...ux-foundation.org>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ