lkml.org 
[lkml]   [2011]   [Nov]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] usb : gadget : usbstring : fix style problems
Hello.

On 16-11-2011 8:43, Tonylijo wrote:

> Minor fixes for problems found by checkpatch.pl in usbstring.c.

> Signed-off-by: Tonylijo Jose<mail@tonylijo.in>
> ---
> diff --git a/drivers/usb/gadget/usbstring.c
> b/drivers/usb/gadget/usbstring.c
> index 58c4d37..2bdc56a 100644
> --- a/drivers/usb/gadget/usbstring.c
> +++ b/drivers/usb/gadget/usbstring.c
[...]
> @@ -102,17 +104,17 @@ fail:
> * characters (which are also widely used in C strings).
> */
> int
> -usb_gadget_get_string (struct usb_gadget_strings *table, int id, u8
> *buf)
> +usb_gadget_get_string(struct usb_gadget_strings *table, int id, u8
> *buf)

The patch was line-wrapped by your mailer. Seems easy to fix though...

> @@ -124,13 +126,13 @@ usb_gadget_get_string (struct usb_gadget_strings
> *table, int id, u8 *buf)
> return -EINVAL;
>
> /* string descriptors have length, tag, then UTF16-LE text */
> - len = min ((size_t) 126, strlen (s->s));
> - memset (buf + 2, 0, 2 * len); /* zero all the bytes */
> + len = min((size_t) 126, strlen(s->s));

Worth converting to min_t() probably...

WBR, Sergei


\
 
 \ /
  Last update: 2011-11-16 13:11    [W:0.081 / U:2.576 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site