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

Dan Carpenter
2012-11-21T09:05:12Z

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@gmail.com>
> ---
> 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