lkml.org 
[lkml]   [2018]   [Apr]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] staging: speakup: separate 80+ chars lines.
On Thu, Apr 19, 2018 at 03:47:10AM -0300, Andrew Jye Shih Chuang wrote:
> Increase readability of code following the Kernel coding style by breaking long lines and thus eliminating the checkpatch.pl warning.
>

The commit message also needs to be wrapped. I do it at 72 characters
like an email. Roughly around the 70 character mark is fine.

> @@ -1233,7 +1234,8 @@ int spk_set_key_info(const u_char *key_info, u_char *k_buffer)
> key_data_len = (states + 1) * (num_keys + 1);
> if (key_data_len + SHIFT_TBL_SIZE + 4 >= sizeof(spk_key_buf)) {
> pr_debug("too many key_infos (%d over %u)\n",
> - key_data_len + SHIFT_TBL_SIZE + 4, (unsigned int)(sizeof(spk_key_buf)));
> + key_data_len + SHIFT_TBL_SIZE + 4,
> + (unsigned int)(sizeof(spk_key_buf)));

This cast isn't needed. Just change the %u to %lu in the printk:

pr_debug("too many key_infos (%d over %lu)\n",
key_data_len + SHIFT_TBL_SIZE + 4,
sizeof(spk_key_buf));

regards,
dan carpenter

\
 
 \ /
  Last update: 2018-04-19 09:53    [W:0.028 / U:20.588 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site