Re: [PATCH] Staging: comedi: serial2002: fixed consistent spacingissue

From: Dan Carpenter
Date: Wed Mar 20 2013 - 08:48:27 EST


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@xxxxxxxxx>
> ---
> 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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/