[PATCH] Staging: vme: devices: vme_user: fix coding style issues

Dan Carpenter dan.carpenter at oracle.com
Mon May 28 13:39:21 UTC 2012


On Mon, May 28, 2012 at 02:22:14PM +0100, Adnan Ali wrote:
> This commit fixes coding style issues including long lines
> and string across multiple lines for driver
> 

You've sent this three times now.  It should have been 
[patch v3] Staging: vme: devices: vme_user: fix coding style issues

> Signed-off-by: Adnan Ali <adnan.ali at codethink.co.uk>
> ---

Here, below the "---" line then put.

v2:  (I have no idea what changed).
v3:  Fixed a typo in the signed-off-by line.

>  drivers/staging/vme/devices/vme_user.c |   38 ++++++++++++++++----------------
>  1 files changed, 19 insertions(+), 19 deletions(-)
> 
> diff --git a/drivers/staging/vme/devices/vme_user.c b/drivers/staging/vme/devices/vme_user.c
> index e24a6f9..3a55621 100644
> --- a/drivers/staging/vme/devices/vme_user.c
> +++ b/drivers/staging/vme/devices/vme_user.c
> @@ -397,7 +397,6 @@ static ssize_t vme_user_write(struct file *file, const char __user *buf,
>  	default:
>  		retval = -EINVAL;
>  	}
> -	

Remove the spaces, but leave the blank line.  Locks are important so
the original author wanted it to stand out.

>  	mutex_unlock(&image[minor].mutex);
>  
>  	if (retval > 0)
> @@ -504,8 +503,8 @@ static int vme_user_ioctl(struct inode *inode, struct file *file,
>  			copied = copy_to_user(argp, &master,
>  				sizeof(struct vme_master));
>  			if (copied != 0) {
> -				printk(KERN_WARNING "Partial copy to "
> -					"userspace\n");
> +				printk(KERN_WARNING
> +					"Partial copy to userspace\n");

Could you make it so the 'K' and the '"' line up?

				printk(KERN_WARNING
				       "Partial copy to userspace\n");
Actually these days we prefer dev_warn() to printk() but I'm not
sure which device struct you can use here.  Or you could use
pr_warn().

But actually these messages are for debugging.  Normally we don't
want to print an error when copy_to_user() fails...  Eventually
we're just going to delete them.

Btw, you are rushing too much.  Wait for overnight before sending
patches.  The next day you can review it and re-read the changelog
with fresh eyes.  Otherwise, you make silly mistakes like typos in
your email address.

regards,
dan carpenter





More information about the devel mailing list