public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Alice Ferrazzi <alice.ferrazzi@gmail.com>
Cc: gregkh@linuxfoundation.org, devel@driverdev.osuosl.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Staging: comedi: serial2002: fixed consistent spacing issue
Date: Wed, 20 Mar 2013 15:47:53 +0300	[thread overview]
Message-ID: <20130320124753.GZ9138@mwanda> (raw)
In-Reply-To: <1363782411-11729-1-git-send-email-alice.ferrazzi@gmail.com>

On Wed, Mar 20, 2013 at 09:26:51PM +0900, Alice Ferrazzi wrote:
> Fixed consistent spacing around '*'.
> 

The original was correct, actually.

> Signed-off-by: Alice Ferrazzi <alice.ferrazzi@gmail.com>
> ---
>  drivers/staging/comedi/drivers/serial2002.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/comedi/drivers/serial2002.c b/drivers/staging/comedi/drivers/serial2002.c
> index e6177b4..858d364 100644
> --- a/drivers/staging/comedi/drivers/serial2002.c
> +++ b/drivers/staging/comedi/drivers/serial2002.c
> @@ -604,7 +604,7 @@ static int serial_2002_open(struct comedi_device *dev)
>  							    c[j].max;
>  							range_table_list[chan] =
>  							    (const struct
> -							     comedi_lrange *)
> +							     comedi_lrange*)
>  							    &range[j];

The original code here needs to broken up into functions so it isn't
squashed up against the 80 character limit.

For casts the spacing should look like:

	foo = (struct my_struct *)ptr;

There is a space after "my_struct" but no space after the closing
parenthesis.  Use that to remind yourself that casting is a high
precedence operation.

For declaring pointers the spacing is:

	struct my_struct *ptr;

For multiplication the spacing is:

	foo = x * y;

Or multplication with a dereference it would be:

	foo = x * *ptr;


regards,
dan carpenter


  reply	other threads:[~2013-03-20 12:48 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-20 12:26 [PATCH] Staging: comedi: serial2002: fixed consistent spacing issue Alice Ferrazzi
2013-03-20 12:47 ` Dan Carpenter [this message]
2013-03-20 15:29   ` Al Viro
2013-03-20 16:04     ` Joe Perches
2013-03-20 16:06       ` H Hartley Sweeten
2013-03-20 16:26     ` [PATCH] CodingStyle: Add tab indentation avoidance tips Joe Perches
2013-03-20 16:52       ` Al Viro
2013-03-20 22:57         ` Joe Perches

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=20130320124753.GZ9138@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=alice.ferrazzi@gmail.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    /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