LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Randy Dunlap <randy.dunlap@oracle.com>
To: Jesper Juhl <jesper.juhl@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	LKML <linux-kernel@vger.kernel.org>, Andi Kleen <ak@suse.de>,
	Trent Waddington <trent.waddington@gmail.com>,
	Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>,
	Alan Cox <alan@lxorguk.ukuu.org.uk>
Subject: Re: [PATCH][1/5][resend] floppy.c: Initial (partial) CodingStyle cleanup
Date: Mon, 19 Mar 2007 08:31:59 -0700	[thread overview]
Message-ID: <20070319083159.0744cf5e.randy.dunlap@oracle.com> (raw)
In-Reply-To: <200703191610.13940.jesper.juhl@gmail.com>

On Mon, 19 Mar 2007 16:10:13 +0100 Jesper Juhl wrote:

>     This is a basic CodingStyle cleanup for drivers/block/floppy.c
>     
>     There are no functional changes in this patch.
> ---
> 
> diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c
> index 5231ed7..5da54b8 100644
> --- a/drivers/block/floppy.c
> +++ b/drivers/block/floppy.c

> @@ -1188,7 +1193,7 @@ static int output_byte(char byte)
>  	return -1;
>  }
>  
> -#define LAST_OUT(x) if (output_byte(x)<0){ reset_fdc();return;}
> +#define LAST_OUT(x) if (output_byte(x) < 0) { reset_fdc(); return; }

Not for a coding style cleanup, but that macro is Bad according to
CodingStyle, so hopefully it will be cleaned up in the future.

Things to avoid when using macros:
1) macros that affect control flow:

>  /* gets the response from the fdc */
>  static int result(void)

> @@ -3816,7 +3803,7 @@ static int check_floppy_change(struct gendisk *disk)
>   */
>  
>  static int floppy_rb0_complete(struct bio *bio, unsigned int bytes_done,
> -			       int err)
> +		int err)

I don't care one way or the other about most of these, but would
you explain that one above (and others like it), please?
It's not an < 80 columns thing.  My <cough> recollection is that
many indented function parameters in Linux are indented more like
the original here, near the opening '(' after the function name,
although I suppose that none of this is in CodingStyle.

>  {
>  	if (bio->bi_size)
>  		return 1;

---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***

  reply	other threads:[~2007-03-19 15:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-19 15:10 Jesper Juhl
2007-03-19 15:31 ` Randy Dunlap [this message]
2007-03-19 18:18   ` Jesper Juhl
2007-03-19 20:20     ` Adrian Bunk
2007-03-19 22:25       ` Jesper Juhl

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=20070319083159.0744cf5e.randy.dunlap@oracle.com \
    --to=randy.dunlap@oracle.com \
    --cc=ak@suse.de \
    --cc=akpm@linux-foundation.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=bzolnier@gmail.com \
    --cc=jesper.juhl@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=trent.waddington@gmail.com \
    --subject='Re: [PATCH][1/5][resend] floppy.c: Initial (partial) CodingStyle cleanup' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).