From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753937AbbIJIGC (ORCPT ); Thu, 10 Sep 2015 04:06:02 -0400 Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]:58393 "EHLO mail3-relais-sop.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753338AbbIJIF4 (ORCPT ); Thu, 10 Sep 2015 04:05:56 -0400 X-IronPort-AV: E=Sophos;i="5.17,503,1437429600"; d="scan'208";a="145316546" Date: Thu, 10 Sep 2015 10:05:51 +0200 (CEST) From: Julia Lawall X-X-Sender: jll@hadrien To: Joe Perches cc: Shraddha Barke , Greg Kroah-Hartman , Lars-Peter Clausen , Jonathan Cameron , Peter Meerwald , Hartmut Knaack , linux-kernel@vger.kernel.org, Julia Lawall Subject: Re: [PATCH 6/6] Staging: iio: resolver: Prefer using the BIT macro In-Reply-To: <1441859081.17219.125.camel@perches.com> Message-ID: References: <1441858434-2846-1-git-send-email-shraddha.6596@gmail.com> <1441858434-2846-6-git-send-email-shraddha.6596@gmail.com> <1441859081.17219.125.camel@perches.com> User-Agent: Alpine 2.10 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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