Re: [PATCH] usb: gadget: f_serial: Modify sizeof format and Variable type

From: Greg KH
Date: Tue Jul 25 2023 - 11:35:07 EST


On Mon, Jul 10, 2023 at 11:09:20AM +0800, wuyonggang001@xxxxxxxxxx wrote:
>
> Fix the following checkpatch warning:
>
> WARNING: sizeof gser_ss_bulk_comp_desc should be
> sizeof(gser_ss_bulk_comp_desc)
> WARNING: Prefer 'unsigned int' to bare use of 'unsigned'
>
> Signed-off-by: Yonggang Wu <wuyonggang001@xxxxxxxxxx>
> ---
> drivers/usb/gadget/function/f_serial.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/usb/gadget/function/f_serial.c
> b/drivers/usb/gadget/function/f_serial.c
> index a9480b9e312e..d7770da75e01 100644
> --- a/drivers/usb/gadget/function/f_serial.c
> +++ b/drivers/usb/gadget/function/f_serial.c
> @@ -111,7 +111,7 @@ static struct usb_endpoint_descriptor gser_ss_out_desc =
> {
> };
>
> static struct usb_ss_ep_comp_descriptor gser_ss_bulk_comp_desc = {
> - .bLength = sizeof gser_ss_bulk_comp_desc,
> + .bLength = sizeof(gser_ss_bulk_comp_desc),
> .bDescriptorType = USB_DT_SS_ENDPOINT_COMP,
> };
>
> @@ -143,7 +143,7 @@ static struct usb_gadget_strings *gser_strings[] = {
>
> /*-------------------------------------------------------------------------*/
>
> -static int gser_set_alt(struct usb_function *f, unsigned intf, unsigned
> alt)
> +static int gser_set_alt(struct usb_function *f, unsigned int intf, unsigned
> int alt)
> {
> struct f_gser *gser = func_to_gser(f);
> struct usb_composite_dev *cdev = f->config->cdev;

Hi,

This is the friendly patch-bot of Greg Kroah-Hartman. You have sent him
a patch that has triggered this response. He used to manually respond
to these common problems, but in order to save his sanity (he kept
writing the same thing over and over, yet to different people), I was
created. Hopefully you will not take offence and will fix the problem
in your patch and resubmit it so that it can be accepted into the Linux
kernel tree.

You are receiving this message because of the following common error(s)
as indicated below:

- Your patch is malformed (tabs converted to spaces, linewrapped, etc.)
and can not be applied. Please read the file,
Documentation/process/email-clients.rst in order to fix this.

- Your patch did many different things all at once, making it difficult
to review. All Linux kernel patches need to only do one thing at a
time. If you need to do multiple things (such as clean up all coding
style issues in a file/driver), do it in a sequence of patches, each
one doing only one thing. This will make it easier to review the
patches to ensure that they are correct, and to help alleviate any
merge issues that larger patches can cause.

- You did not specify a description of why the patch is needed, or
possibly, any description at all, in the email body. Please read the
section entitled "The canonical patch format" in the kernel file,
Documentation/process/submitting-patches.rst for what is needed in
order to properly describe the change.

- You did not write a descriptive Subject: for the patch, allowing Greg,
and everyone else, to know what this patch is all about. Please read
the section entitled "The canonical patch format" in the kernel file,
Documentation/process/submitting-patches.rst for what a proper
Subject: line should look like.

If you wish to discuss this problem further, or you have questions about
how to resolve this issue, please feel free to respond to this email and
Greg will reply once he has dug out from the pending patches received
from other developers.

thanks,

greg k-h's patch email bot