Re: [PATCH2 6/6] isicom: More whitespaces and coding style

From: Dmitry Torokhov
Date: Sun Oct 09 2005 - 23:06:43 EST


On Sunday 09 October 2005 14:42, Jiri Slaby wrote:
> More whitespaces and coding style
>
> Wrap all the code to 80 chars on a line.
> Some `}\nelse' changed to `} else'.
> Clean whitespaces in header file.
>
> Generated in 2.6.14-rc2-mm2 kernel version
>
> Signed-off-by: Jiri Slaby <xslaby@xxxxxxxxxx>
>
> ---
> drivers/char/isicom.c | 148 +++++++++++++++++++++++-------------------------
> include/linux/isicom.h | 21 +++----
> 2 files changed, 82 insertions(+), 87 deletions(-)
>
> diff --git a/drivers/char/isicom.c b/drivers/char/isicom.c
> --- a/drivers/char/isicom.c
> +++ b/drivers/char/isicom.c
> @@ -467,33 +467,36 @@ static void isicom_tx(unsigned long _dat
> residue = NO;
> wrd = 0;
> while (1) {
> - cnt = min_t(int, txcount, (SERIAL_XMIT_SIZE - port->xmit_tail));
> + cnt = min_t(int, txcount, (SERIAL_XMIT_SIZE
> + - port->xmit_tail));

I am sorry but do you really consider the new form more readable?

> - wrd |= (port->xmit_buf[port->xmit_tail] << 8);
> - port->xmit_tail = (port->xmit_tail + 1) & (SERIAL_XMIT_SIZE - 1);
> + wrd |= (port->xmit_buf[port->xmit_tail]
> + << 8);

And this?

> -#ifdef ISICOM_DEBUG
> - printk(KERN_DEBUG "ISICOM: interrupt: DCD->low.\n");
> -#endif
> + pr_deb(KERN_DEBUG "ISICOM: "
> + "interrupt: "
> + "DCD->low.\n");

And this?

Simply limiting line length to 80 is not enough IMHO, you need to
keep the code readable at the same time.

--
Dmitry
-
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/