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]
Date:   Wed, 22 Mar 2017 09:53:02 +0100
From:   Arnd Bergmann <arnd@...db.de>
To:     Arushi Singhal <arushisinghal19971997@...il.com>
Cc:     outreachy-kernel@...glegroups.com,
        Sudip Mukherjee <sudipm.mukherjee@...il.com>,
        Teddy Wang <teddy.wang@...iconmotion.com>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        linux-fbdev@...r.kernel.org, devel@...verdev.osuosl.org,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: staging: iio: Replace a bit shift by a use of BIT.

On Wed, Mar 22, 2017 at 3:49 AM, Arushi Singhal
<arushisinghal19971997@...il.com> wrote:

> @@ -232,7 +232,7 @@ static int ad7150_write_event_config(struct iio_dev *indio_dev,
>         if (ret < 0)
>                 goto error_ret;
>
> -       cfg = ret & ~((0x03 << 5) | (0x1 << 7));
> +       cfg = ret & ~((0x03 << 5) | (BIT(7)));
>
>         switch (type) {
>         case IIO_EV_TYPE_MAG_ADAPTIVE:

While the change in the #defines is not unusual, this particular change
here makes it harder to read, so I'd recommend leaving it alone, or changing
it to use symbolic names instead of the bit masks.

>  /* Voltage/Temperature Setup Register Bit Designations (AD7746_REG_VT_SETUP) */
> -#define AD7746_VTSETUP_VTEN            (1 << 7)
> +#define AD7746_VTSETUP_VTEN            (BIT(7))
>  #define AD7746_VTSETUP_VTMD_INT_TEMP   (0 << 5)
> -#define AD7746_VTSETUP_VTMD_EXT_TEMP   (1 << 5)
> +#define AD7746_VTSETUP_VTMD_EXT_TEMP   (BIT(5))

Why did you leave one of them unchanged?

    Arnd

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ