Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755770Ab2FWTLJ (ORCPT ); Sat, 23 Jun 2012 15:11:09 -0400 Received: from rcsinet15.oracle.com ([148.87.113.117]:47921 "EHLO rcsinet15.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752802Ab2FWTLI (ORCPT ); Sat, 23 Jun 2012 15:11:08 -0400 Date: Sat, 23 Jun 2012 22:10:51 +0300 From: Dan Carpenter To: "devendra.aaru" Cc: Joe Perches , devel@driverdev.osuosl.org, Greg Kroah-Hartman , linux-kernel@vger.kernel.org, "Justin P. Mattock" Subject: Re: [PATCH V2 1/3] staging/rtl8192u: fix coding style problems Message-ID: <20120623191051.GF5333@mwanda> References: <1340132742-18849-1-git-send-email-devendra.aaru@gmail.com> <20120620230839.GA17883@kroah.com> <1340234315.29885.54.camel@joe2Laptop> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: ucsinet22.oracle.com [156.151.31.94] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1425 Lines: 47 On Sun, Jun 24, 2012 at 12:04:12AM +0530, devendra.aaru wrote: > Hi Joe, > > On Thu, Jun 21, 2012 at 4:48 AM, Joe Perches wrote: > > On Wed, 2012-06-20 at 16:08 -0700, Greg Kroah-Hartman wrote: > >> On Wed, Jun 20, 2012 at 12:35:42AM +0530, Devendra Naga wrote: > >> > fixed some of the coding style problems reported by checkpatch > > [] > >> > @@ -66,11 +69,10 @@ short eprom_r(struct net_device *dev) > >> > ?{ > >> > ? ? short bit; > >> > > >> > - ? bit=(read_nic_byte_E(dev, EPROM_CMD) & (1< >> > + ? bit = (read_nic_byte_E(dev, EPROM_CMD) & (1< >> > ? ? udelay(EPROM_DELAY); > >> > > >> > - ? if(bit) return 1; > >> > - ? return 0; > >> > + ? return !!bit; > >> > >> Oh come on, really? ?!! is more "clear" here? > > > > Depends on the reader. ?!! is pretty common. > > > >> No, please be painfully obvious, that's the only way to write kernel > >> code. ?Not like this. > > > > I'd just make the return a bool instead. > > > taking another variable and assign it like bool ret = !!bit, and > returning ret?, i think this doesn't look better. *eye roll* if (bit) return 1; return 0; regards, dan carpenter -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/