lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 11 Mar 2015 23:20:40 +0200
From:	Giedrius Statkevičius 
	<giedrius.statkevicius@...il.com>
To:	Janakarajan Natarajan <janakarajann@...il.com>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Joe Perches <joe@...ches.com>, devel@...verdev.osuosl.org
CC:	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/1] Drivers: Staging: ft1000: checkpatch warning fixes

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 <asm/bitops.h> and <asm/io.h> usage.
> 
Greg may complain that you've done too much in 1 patch.

> Signed-off-by: Janakarajan Natarajan <janakarajann@...il.com>
> ---
>  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 <linux/timer.h>
>  #include <linux/interrupt.h>
>  #include <linux/in.h>
> -#include <asm/io.h>
> -#include <asm/bitops.h>
> +#include <linux/io.h>
> +#include <linux/bitops.h>
>  
>  #include <linux/netdevice.h>
>  #include <linux/etherdevice.h>
> @@ -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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ