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: <alpine.DEB.2.10.1509101005020.3228@hadrien>
Date:	Thu, 10 Sep 2015 10:05:51 +0200 (CEST)
From:	Julia Lawall <julia.lawall@...6.fr>
To:	Joe Perches <joe@...ches.com>
cc:	Shraddha Barke <shraddha.6596@...il.com>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Lars-Peter Clausen <lars@...afoo.de>,
	Jonathan Cameron <jic23@...nel.org>,
	Peter Meerwald <pmeerw@...erw.net>,
	Hartmut Knaack <knaack.h@....de>, linux-kernel@...r.kernel.org,
	Julia Lawall <julia.lawall@...6.fr>
Subject: Re: [PATCH 6/6] Staging: iio: resolver: Prefer using the BIT macro



On Wed, 9 Sep 2015, Joe Perches wrote:

> On Thu, 2015-09-10 at 09:43 +0530, Shraddha Barke wrote:
> > This patch replaces bit shifting on 1 with the BIT(x) macro
> > as it's extensively used by other function in this driver.
> []
> > diff --git a/drivers/staging/iio/resolver/ad2s1210.c b/drivers/staging/iio/resolver/ad2s1210.c
> []
> > @@ -149,7 +149,7 @@ int ad2s1210_update_frequency_control_word(struct ad2s1210_state *st)
> >  	int ret;
> >  	unsigned char fcw;
> >
> > -	fcw = (unsigned char)(st->fexcit * (1 << 15) / st->fclkin);
> > +	fcw = (unsigned char)(st->fexcit * BIT(15) / st->fclkin);
>
> Multiplying by a bit isn't very obvious.
> Maybe just shift it.
>
> 	fcw = (unsigned char)((st->fexcit << 15) / st->fclkin);

That looks nicer.  Shraddha maybe you can find this issue elsewhere.

julia
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ