From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757955AbbKSHvt (ORCPT ); Thu, 19 Nov 2015 02:51:49 -0500 Received: from userp1040.oracle.com ([156.151.31.81]:44154 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757284AbbKSHvs (ORCPT ); Thu, 19 Nov 2015 02:51:48 -0500 Date: Thu, 19 Nov 2015 10:51:32 +0300 From: Dan Carpenter To: Ian Abbott Cc: Ranjith Thangavel , gregkh@linuxfoundation.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] comedi: dmm32at: Fix coding style - use BIT macro Message-ID: <20151119075132.GT18797@mwanda> References: <1447521036-23550-1-git-send-email-ranjithece24@gmail.com> <564CA6CC.6010600@mev.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <564CA6CC.6010600@mev.co.uk> User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: aserv0021.oracle.com [141.146.126.233] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Nov 18, 2015 at 04:26:52PM +0000, Ian Abbott wrote: > >+#define DMM32AT_AI_CFG_SCINT_10US (BIT(5) & ~BIT(4)) > >+#define DMM32AT_AI_CFG_SCINT_5US (BIT(5) | BIT(4)) > > The values of DMM32AT_AI_CFG_SCINT_20US etc. are numerically > correct, but look a bit strange. The `(BIT(5) & ~BIT(4))` looks > especially strange and could be changed to `BIT(5)`. These are all > really shifted 2-bit values, so perhaps the BIT() macro isn't the > best representation. > BIT(5) & ~BIT(4) is silly. Don't do that. The original code was fine. regards, dan carpenter