From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751745AbbCKVVA (ORCPT ); Wed, 11 Mar 2015 17:21:00 -0400 Received: from mail-wg0-f41.google.com ([74.125.82.41]:44899 "EHLO mail-wg0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751356AbbCKVU7 (ORCPT ); Wed, 11 Mar 2015 17:20:59 -0400 Message-ID: <5500B1A8.1030807@gmail.com> Date: Wed, 11 Mar 2015 23:20:40 +0200 From: =?UTF-8?B?R2llZHJpdXMgU3RhdGtldmnEjWl1cw==?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Janakarajan Natarajan , Greg Kroah-Hartman , Joe Perches , devel@driverdev.osuosl.org CC: linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/1] Drivers: Staging: ft1000: checkpatch warning fixes References: <1426107804-54961-1-git-send-email-janakarajann@gmail.com> In-Reply-To: <1426107804-54961-1-git-send-email-janakarajann@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2015.03.11 23:03, Janakarajan Natarajan wrote: > Addition of blank line after declaration in ft1000_hw.c > Minor changes to remove {} from single line if and remove extra parenthesis. > Fixes checkpatch warning for and usage. > Greg may complain that you've done too much in 1 patch. > Signed-off-by: Janakarajan Natarajan > --- > drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c | 12 ++++++------ > drivers/staging/ft1000/ft1000-usb/ft1000_debug.c | 9 +++------ > 2 files changed, 9 insertions(+), 12 deletions(-) > > diff --git a/drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c b/drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c > index 017c3b9..a01b9e3 100644 > --- a/drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c > +++ b/drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c > @@ -28,8 +28,8 @@ > #include > #include > #include > -#include > -#include > +#include > +#include > > #include > #include > @@ -1948,11 +1948,11 @@ static irqreturn_t ft1000_interrupt(int irq, void *dev_id) > ft1000_read_reg(dev, > FT1000_REG_MAG_DFSR); > } > - if (tempword & 0x1f) { > + if (tempword & 0x1f) > ft1000_copy_up_pkt(dev); > - } else { > + else > break; > - } > + > cnt++; > } while (cnt < MAX_RCV_LOOP); > > @@ -2008,8 +2008,8 @@ static void ft1000_get_drvinfo(struct net_device *dev, > struct ethtool_drvinfo *info) > { > struct ft1000_info *ft_info; > - ft_info = netdev_priv(dev); > > + ft_info = netdev_priv(dev); You could just do: struct ft1000_info *ft_info = netdev_priv(dev) > strlcpy(info->driver, "ft1000", sizeof(info->driver)); > snprintf(info->bus_info, sizeof(info->bus_info), "PCMCIA 0x%lx", > dev->base_addr); > diff --git a/drivers/staging/ft1000/ft1000-usb/ft1000_debug.c b/drivers/staging/ft1000/ft1000-usb/ft1000_debug.c > index c8d2782..bd0d25c 100644 > --- a/drivers/staging/ft1000/ft1000-usb/ft1000_debug.c > +++ b/drivers/staging/ft1000/ft1000-usb/ft1000_debug.c > @@ -317,9 +317,8 @@ static int ft1000_open(struct inode *inode, struct file *file) > > /* Search for available application info block */ > for (i = 0; i < MAX_NUM_APP; i++) { > - if ((dev->app_info[i].fileobject == NULL)) { > + if (dev->app_info[i].fileobject == NULL) > break; > - } Here you can simply do: if (!dev->app_info[i].file_object) > } > > /* Fail due to lack of application info block */ > @@ -575,9 +574,8 @@ static long ft1000_ioctl(struct file *file, unsigned int command, > } else { > /* Check if this message came from a registered application */ > for (i = 0; i < MAX_NUM_APP; i++) { > - if (ft1000dev->app_info[i].fileobject == &file->f_owner) { > + if (ft1000dev->app_info[i].fileobject == &file->f_owner) > break; > - } > } > if (i == MAX_NUM_APP) { > pr_debug("No matching application fileobject\n"); > @@ -629,9 +627,8 @@ static long ft1000_ioctl(struct file *file, unsigned int command, > pmsg = (u16 *)&dpram_data->pseudohdr; > ppseudo_hdr = (struct pseudo_hdr *)pmsg; > total_len = msgsz+2; > - if (total_len & 0x1) { > + if (total_len & 0x1) > total_len++; > - } > > /* Insert slow queue sequence number */ > ppseudo_hdr->seq_num = info->squeseqnum++; > -- Thanks, Giedrius