Re: [PATCH 10/10] staging: cxt1e1: sbecrc.c: fixes 80+ char linelength issue

From: Dan Carpenter
Date: Wed Nov 21 2012 - 04:05:04 EST


On Tue, Nov 20, 2012 at 07:28:52PM +0200, Johan Meiring wrote:
> This commit sorts out a single case where a line was longer than
> 80 characters.
>
> Signed-off-by: Johan Meiring <johanmeiring@xxxxxxxxx>
> ---
> drivers/staging/cxt1e1/sbecrc.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/staging/cxt1e1/sbecrc.c b/drivers/staging/cxt1e1/sbecrc.c
> index 87512a5..59dd7e2 100644
> --- a/drivers/staging/cxt1e1/sbecrc.c
> +++ b/drivers/staging/cxt1e1/sbecrc.c
> @@ -101,7 +101,8 @@ sbeCrc(u_int8_t *buffer, /* data buffer to crc */
> tbl = &CRCTable;
> genCrcTable(tbl);
> #else
> - tbl = (u_int32_t *) OS_kmalloc(CRC_TABLE_ENTRIES * sizeof(u_int32_t));
> + tbl = (u_int32_t *) OS_kmalloc(CRC_TABLE_ENTRIES
> + * sizeof(u_int32_t));

The way we would normally break this is:

tbl = (u_int32_t *)OS_kmalloc(CRC_TABLE_ENTRIES *
sizeof(u_int32_t));

* goes on the first line so that it shows this is a partial line.
The sizeof() lines up with the first parameter. You will have to
use spaces since it's not exactly on a tab stop.

But really it's better to just get rid of the call to OS_kmalloc().

tbl = kmalloc(CRC_TABLE_ENTRIES * sizeof(*tbl), GFP_KERNEL);

OS_kmalloc() adds a GFP_DMA flag and a memset() but it's not needed
here.

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/