lkml.org 
[lkml]   [2015]   [Dec]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] staging: dgnc: Patch includes the checkpatch fixes
On Fri, Dec 11, 2015 at 03:21:49AM -0500, Sanidhya Solanki wrote:
> >From 1dbe78ce98037da5467d817a9db838d678b338ae Mon Sep 17 00:00:00 2001
> From: Sanidhya Solanki <jpage.lkml@gmail.com>
> Date: Fri, 11 Dec 2015 03:08:53 -0500
> Subject: [PATCH] staging: dgnc: Patch includes the checkpatch fixes


Don't include this stuff.

>
> Patch contains the checkpatch fixes as asked by the TODO.
> TODO file is updated as well.

Fix one type of warning at a time. This will be a series of patches.

>
> Signed-off-by: Sanidhya Solanki <jpage.lkml@gmail.com>
> @@ -110,7 +98,16 @@ static ssize_t dgnc_vpd_show(struct device *p, struct device_attribute *attr,
> int count = 0;
> int i = 0;
>
> - 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);

Google about why do while(0) loops are used in macros and then redo
this. Mostly the patch isn't bad, but I suspect I'm going to complain
about how you split up some of the long lines.

regards,
dan carpenter



\
 
 \ /
  Last update: 2015-12-11 14:21    [W:0.812 / U:0.052 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site