From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751967AbcJBPPp (ORCPT ); Sun, 2 Oct 2016 11:15:45 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:60071 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750927AbcJBPPj (ORCPT ); Sun, 2 Oct 2016 11:15:39 -0400 Date: Sun, 2 Oct 2016 17:15:44 +0200 From: Greg KH To: Joe Perches Cc: Harman Kalra , thomas.petazzoni@free-electrons.com, noralf@tronnes.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] Staging : fbtft: Removed "line over 80 characters" Warnings Message-ID: <20161002151543.GA12676@kroah.com> References: <1475094672-4895-1-git-send-email-harman4linux@gmail.com> <1475098057.2685.15.camel@perches.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1475098057.2685.15.camel@perches.com> User-Agent: Mutt/1.7.0 (2016-08-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 28, 2016 at 02:27:37PM -0700, Joe Perches wrote: > On Thu, 2016-09-29 at 02:01 +0530, Harman Kalra wrote: > > Removed "line over 80 characters" Warnings using checkpatch.pl > [] > > diff --git a/drivers/staging/fbtft/fbtft.h b/drivers/staging/fbtft/fbtft.h > [] > > @@ -402,7 +407,9 @@ static void __exit fbtft_driver_module_exit(void) \ > >  #define fbtft_init_dbg(dev, format, arg...) \ > >  do { \ > >   if (unlikely((dev)->platform_data && \ > > - (((struct fbtft_platform_data *)(dev)->platform_data)->display.debug & DEBUG_DRIVER_INIT_FUNCTIONS))) \ > > + (((struct fbtft_platform_data *) \ > > + (dev)->platform_data)->display.debug \ > > + & DEBUG_DRIVER_INIT_FUNCTIONS))) \ > >   dev_info(dev, format, ##arg); \ > >  } while (0) > > A nicer way to do might be a statement expression macro > > #define fbtft_init_dbg(dev, format, ...) \ > ({ \ > struct fbtft_platform_data *pdata; \ > pdata = (struct fbtft_platform_data *)((dev)->platform_data); \ > if (unlikely(pdata && \ > pdata->display.debug & DEBUG_DRIVER_INIT_FUNCTIONS)) \ > dev_info(dev, format, ##__VA_ARGS__); > }) Yes, that is almost readable, I like that a lot better :) thanks, greg k-h