mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: "Peter Hüwe" <PeterHuewe@gmx.de>
Cc: Petr Vandrovec <vandrove@vc.cvut.cz>,
	Andrew Morton <akpm@linux-foundation.org>,
	Jean Delvare <khali@linux-fr.org>,
	Krzysztof Helt <krzysztof.h1@wp.pl>,
	linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] video/matrox: Checkpatch cleanups for matroxfb_crtc2.c
Date: Mon, 18 Jan 2010 11:17:49 -0800	[thread overview]
Message-ID: <1263842269.26846.122.camel@Joe-Laptop.home> (raw)
In-Reply-To: <201001181934.49519.PeterHuewe@gmx.de>

On Mon, 2010-01-18 at 19:34 +0100, Peter Hüwe wrote:
> From: Peter Huewe <peterhuewe@gmx.de>
> Date: Mon, 18 Jan 2010 19:21:02 +0100
> This patch fixes all 77 errors reported by checkpatch - no functional
> change was made. The line over 80 chars warnings were left untouched.
> diff --git a/drivers/video/matrox/matroxfb_crtc2.c b/drivers/video/matrox/matroxfb_crtc2.c
> index 78414ba..790ca47 100644
> --- a/drivers/video/matrox/matroxfb_crtc2.c
> +++ b/drivers/video/matrox/matroxfb_crtc2.c
> @@ -42,42 +43,41 @@ static int matroxfb_dh_setcolreg(unsigned regno, unsigned red, unsigned green,
>  	blue = CNVT_TOHW(blue, m2info->fbcon.var.blue.length);
>  	transp = CNVT_TOHW(transp, m2info->fbcon.var.transp.length);
>  
> -	col = (red << m2info->fbcon.var.red.offset)     |
> -	      (green << m2info->fbcon.var.green.offset) |
> -	      (blue << m2info->fbcon.var.blue.offset)   |
> -	      (transp << m2info->fbcon.var.transp.offset);
> +	col =	(red << m2info->fbcon.var.red.offset)		|
> +			(green << m2info->fbcon.var.green.offset)	|
> +			(blue << m2info->fbcon.var.blue.offset)		|
> +			(transp << m2info->fbcon.var.transp.offset);

I think this is not an improvement.

[]

> +	case 16:
> +		tmp = 0x00400000;
> +		break;
>  /*		case 32: */

Even in a comment, you should change this indent.

[]
> @@ -428,133 +435,133 @@ static int matroxfb_dh_ioctl(struct fb_info *info,
>  	DBG(__func__)
>  
>  	switch (cmd) {
> -		case FBIOGET_VBLANK:
> -			{
> -				struct fb_vblank vblank;
> -				int err;
> -
> -				err = matroxfb_dh_get_vblank(m2info, &vblank);
> -				if (err)
> -					return err;
> -				if (copy_to_user((void __user *)arg, &vblank, sizeof(vblank)))
> -					return -EFAULT;
> -				return 0;
> -			}

I suggest putting the open braces on the same line as the case
because that's the more common (~2:1) kernel style and it saves
an indent level

	switch (foo) {
	case: bar {
	}
	}

[]

> +	case MATROXFB_SET_OUTPUT_MODE:
> +	case MATROXFB_GET_OUTPUT_MODE:
> +	case MATROXFB_GET_ALL_OUTPUTS:
> +		{
> +			return minfo->fbcon.fbops->fb_ioctl(&minfo->fbcon, cmd, arg);
> +		}

unnecessary braces, 1 indent level deeper than necessary.

cheers, Joe


  reply	other threads:[~2010-01-18 19:17 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-18 18:34 Peter Hüwe
2010-01-18 19:17 ` Joe Perches [this message]
2010-01-18 19:27   ` Peter Hüwe
2010-01-18 19:55     ` [PATCH v2] " Peter Huewe
2010-01-18 19:59     ` [PATCH] " Joe Perches
2010-01-18 21:11       ` Jean Delvare
2010-01-18 21:42         ` [PATCH v3] " Peter Hüwe
2010-01-19  9:39           ` Jean Delvare

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1263842269.26846.122.camel@Joe-Laptop.home \
    --to=joe@perches.com \
    --cc=PeterHuewe@gmx.de \
    --cc=akpm@linux-foundation.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=khali@linux-fr.org \
    --cc=krzysztof.h1@wp.pl \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vandrove@vc.cvut.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®