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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150706121524.GB2226@gmail.com>
Date:	Mon, 6 Jul 2015 17:45:24 +0530
From:	Ravi Teja Darbha <ravi2j@...il.com>
To:	Arjun Krishna Babu <arjunkrishnababu96@...il.com>
Cc:	lidza.louina@...il.com, markh@...pro.net,
	devel@...verdev.osuosl.org, gregkh@...uxfoundation.org,
	driverdev-devel@...uxdriverproject.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] staging: dgnc: Replace macro with flow control statement
 by a function

What you need to do is to replace all DGNC_VERIFY_BOARD() macro calls with its definition.

Regards,
Ravi Teja

On Sun, Jul 05, 2015 at 11:46:28PM +0530, Arjun Krishna Babu wrote:
> This patch fixes the checkpatch.pl warning:
> 
> WARNING: Macros with flow control statements should be avoided
> 
> Replace the macro with a function doing the exact same task as the
> macro.
> 
> Signed-off-by: Arjun Krishna Babu <arjunkrishnababu96@...il.com>
> ---
>  drivers/staging/dgnc/dgnc_sysfs.c | 22 ++++++++++------------
>  1 file changed, 10 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/staging/dgnc/dgnc_sysfs.c b/drivers/staging/dgnc/dgnc_sysfs.c
> index 44db870..8ab0922 100644
> --- a/drivers/staging/dgnc/dgnc_sysfs.c
> +++ b/drivers/staging/dgnc/dgnc_sysfs.c
> @@ -92,19 +92,17 @@ void dgnc_remove_driver_sysfiles(struct pci_driver *dgnc_driver)
>  }
>  
>  
> -#define DGNC_VERIFY_BOARD(p, bd)				\
> -	do {							\
> -		if (!p)						\
> -			return 0;				\
> -								\
> -		bd = dev_get_drvdata(p);			\
> -		if (!bd || bd->magic != DGNC_BOARD_MAGIC)	\
> -			return 0;				\
> -		if (bd->state != BOARD_READY)			\
> -			return 0;				\
> -	} while (0)
> -
> +static int DGNC_VERIFY_BOARD(struct device *p, struct dgnc_board *bd)
> +{
> +	if (!p)
> +		return 0;
>  
> +	bd = dev_get_drvdata(p);
> +	if (!bd || bd->magic != DGNC_BOARD_MAGIC)
> +		return 0;
> +	if (bd->state != BOARD_READY)
> +		return 0;
> +}
>  
>  static ssize_t dgnc_vpd_show(struct device *p, struct device_attribute *attr,
>  			     char *buf)
> -- 
> 1.9.1
> 
> _______________________________________________
> devel mailing list
> devel@...uxdriverproject.org
> http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
--
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