Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758615Ab3FTSSq (ORCPT ); Thu, 20 Jun 2013 14:18:46 -0400 Received: from perches-mx.perches.com ([206.117.179.246]:52314 "EHLO labridge.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1758593Ab3FTSSp (ORCPT ); Thu, 20 Jun 2013 14:18:45 -0400 Message-ID: <1371752324.2146.25.camel@joe-AO722> Subject: Re: Re: [PATCH] gpio MIPS/OCTEON: Add a driver for OCTEON's on-chip GPIO pins. From: Joe Perches To: David Daney Cc: Linus Walleij , linux-mips@linux-mips.org, Ralf Baechle , Grant Likely , Rob Herring , "linux-kernel@vger.kernel.org" , "devicetree-discuss@lists.ozlabs.org" , David Daney Date: Thu, 20 Jun 2013 11:18:44 -0700 In-Reply-To: <51C34584.8070301@gmail.com> References: <1371251915-18271-1-git-send-email-ddaney.cavm@gmail.com> <51C34584.8070301@gmail.com> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.6.4-0ubuntu1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1069 Lines: 28 On Thu, 2013-06-20 at 11:10 -0700, David Daney wrote: > Sorry for not responding earlier, but my e-mail system seems to have > malfunctioned with respect to this message... [] > On 06/17/2013 01:51 AM, Linus Walleij wrote: > >> +static int octeon_gpio_get(struct gpio_chip *chip, unsigned offset) > >> +{ > >> + struct octeon_gpio *gpio = container_of(chip, struct octeon_gpio, chip); > >> + u64 read_bits = cvmx_read_csr(gpio->register_base + RX_DAT); > >> + > >> + return ((1ull << offset) & read_bits) != 0; > > > > A common idiom we use for this is: > > > > return !!(read_bits & (1ull << offset)); > > I hate that idiom, but if its use is a condition of accepting the patch, > I will change it. Or use an even more common idiom and change the function to return bool and let the compiler do it. -- 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/