public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] USB / dwc3: fix checkpatch warnings
@ 2022-05-01 13:16 Kushagra Verma
  2022-05-01 13:41 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: Kushagra Verma @ 2022-05-01 13:16 UTC (permalink / raw)
  To: balbi, gregkh, linux-usb, linux-kernel

This patch fixes the following checkpatch warnings in core.c and
core.h:
   1. WARNING: Prefer 'unsigned int' to bare use of 'unsigned'
   2. WARNING: Possible unnecessary 'out of memory' message
   3. WARNING: No space before tabs

It also changes 'Error to get property' to 'Couldn't get property' in
dev_err() as the latter one is more meaningful.

Signed-off-by: Kushagra Verma <kushagra765@outlook.com>
---
 drivers/usb/dwc3/core.c | 10 ++++------
 drivers/usb/dwc3/core.h | 28 ++++++++++++++--------------
 2 files changed, 18 insertions(+), 20 deletions(-)

diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
index 25c686a752b0..615215869fe5 100644
--- a/drivers/usb/dwc3/core.c
+++ b/drivers/usb/dwc3/core.c
@@ -339,7 +339,7 @@ static void dwc3_free_one_event_buffer(struct dwc3
*dwc,
  * otherwise ERR_PTR(errno).
  */
 static struct dwc3_event_buffer *dwc3_alloc_one_event_buffer(struct
dwc3 *dwc,
-		unsigned length)
+		unsigned int length)
 {
 	struct dwc3_event_buffer	*evt;
 
@@ -382,7 +382,7 @@ static void dwc3_free_event_buffers(struct dwc3
*dwc)
  * Returns 0 on success otherwise negative errno. In the error case,
dwc
  * may contain some buffers allocated but not all which were
requested.
  */
-static int dwc3_alloc_event_buffers(struct dwc3 *dwc, unsigned length)
+static int dwc3_alloc_event_buffers(struct dwc3 *dwc, unsigned int
length)
 {
 	struct dwc3_event_buffer *evt;
 
@@ -844,17 +844,15 @@ static void dwc3_set_incr_burst_type(struct dwc3
*dwc)
 		return;
 
 	vals = kcalloc(ntype, sizeof(u32), GFP_KERNEL);
-	if (!vals) {
-		dev_err(dev, "Error to get memory\n");
+	if (!vals)
 		return;
-	}
 
 	/* Get INCR burst type, and parse it */
 	ret = device_property_read_u32_array(dev,
 			"snps,incr-burst-type-adjustment", vals,
ntype);
 	if (ret) {
 		kfree(vals);
-		dev_err(dev, "Error to get property\n");
+		dev_err(dev, "Couldn't get property\n");
 		return;
 	}
 
diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h
index 013f42a2b5dc..033c58f489b1 100644
--- a/drivers/usb/dwc3/core.h
+++ b/drivers/usb/dwc3/core.h
@@ -634,7 +634,7 @@ struct dwc3_trb;
 struct dwc3_event_buffer {
 	void			*buf;
 	void			*cache;
-	unsigned		length;
+	unsigned int		length;
 	unsigned int		lpos;
 	unsigned int		count;
 	unsigned int		flags;
@@ -694,7 +694,7 @@ struct dwc3_ep {
 	struct dwc3		*dwc;
 
 	u32			saved_state;
-	unsigned		flags;
+	unsigned int		flags;
 #define DWC3_EP_ENABLED		BIT(0)
 #define DWC3_EP_STALL		BIT(1)
 #define DWC3_EP_WEDGE		BIT(2)
@@ -893,9 +893,9 @@ struct dwc3_request {
 	struct scatterlist	*sg;
 	struct scatterlist	*start_sg;
 
-	unsigned		num_pending_sgs;
+	unsigned int		num_pending_sgs;
 	unsigned int		num_queued_sgs;
-	unsigned		remaining;
+	unsigned int		remaining;
 
 	unsigned int		status;
 #define DWC3_REQUEST_STATUS_QUEUED	0
@@ -908,7 +908,7 @@ struct dwc3_request {
 	struct dwc3_trb		*trb;
 	dma_addr_t		trb_dma;
 
-	unsigned		num_trbs;
+	unsigned int		num_trbs;
 
 	unsigned		needs_extra_trb:1;
 	unsigned		direction:1;
@@ -1010,8 +1010,8 @@ struct dwc3_scratchpad_array {
  * @has_lpm_erratum: true when core was configured with LPM Erratum.
Note that
  *			there's now way for software to detect this in
runtime.
  * @is_utmi_l1_suspend: the core asserts output signal
- * 	0	- utmi_sleep_n
- * 	1	- utmi_l1_suspend_n
+ *	0	- utmi_sleep_n
+ *	1	- utmi_l1_suspend_n
  * @is_fpga: true when we are using the FPGA board
  * @pending_events: true when we have pending IRQs to be handled
  * @pullups_connected: true when Run/Stop bit is set
@@ -1047,10 +1047,10 @@ struct dwc3_scratchpad_array {
  *			instances in park mode.
  * @tx_de_emphasis_quirk: set if we enable Tx de-emphasis quirk
  * @tx_de_emphasis: Tx de-emphasis value
- * 	0	- -6dB de-emphasis
- * 	1	- -3.5dB de-emphasis
- * 	2	- No de-emphasis
- * 	3	- Reserved
+ *	0	- -6dB de-emphasis
+ *	1	- -3.5dB de-emphasis
+ *	2	- No de-emphasis
+ *	3	- Reserved
  * @dis_metastability_quirk: set to disable metastability quirk.
  * @imod_interval: set the interrupt moderation interval in 250ns
  *                 increments or 0 to disable.
@@ -1456,9 +1456,9 @@ void dwc3_gadget_exit(struct dwc3 *dwc);
 int dwc3_gadget_set_test_mode(struct dwc3 *dwc, int mode);
 int dwc3_gadget_get_link_state(struct dwc3 *dwc);
 int dwc3_gadget_set_link_state(struct dwc3 *dwc, enum dwc3_link_state
state);
-int dwc3_send_gadget_ep_cmd(struct dwc3_ep *dep, unsigned cmd,
+int dwc3_send_gadget_ep_cmd(struct dwc3_ep *dep, unsigned int cmd,
 		struct dwc3_gadget_ep_cmd_params *params);
-int dwc3_send_gadget_generic_command(struct dwc3 *dwc, unsigned cmd,
u32 param);
+int dwc3_send_gadget_generic_command(struct dwc3 *dwc, unsigned int
cmd, u32 param);
 #else
 static inline int dwc3_gadget_init(struct dwc3 *dwc)
 { return 0; }
@@ -1472,7 +1472,7 @@ static inline int
dwc3_gadget_set_link_state(struct dwc3 *dwc,
 		enum dwc3_link_state state)
 { return 0; }
 
-static inline int dwc3_send_gadget_ep_cmd(struct dwc3_ep *dep,
unsigned cmd,
+static inline int dwc3_send_gadget_ep_cmd(struct dwc3_ep *dep,
unsigned int cmd,
 		struct dwc3_gadget_ep_cmd_params *params)
 { return 0; }
 static inline int dwc3_send_gadget_generic_command(struct dwc3 *dwc,
-- 
2.32.0




^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] USB / dwc3: fix checkpatch warnings
  2022-05-01 13:16 [PATCH] USB / dwc3: fix checkpatch warnings Kushagra Verma
@ 2022-05-01 13:41 ` Greg KH
  0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2022-05-01 13:41 UTC (permalink / raw)
  To: Kushagra Verma; +Cc: balbi, linux-usb, linux-kernel

On Sun, May 01, 2022 at 06:46:46PM +0530, Kushagra Verma wrote:
> This patch fixes the following checkpatch warnings in core.c and
> core.h:
>    1. WARNING: Prefer 'unsigned int' to bare use of 'unsigned'
>    2. WARNING: Possible unnecessary 'out of memory' message
>    3. WARNING: No space before tabs
> 
> It also changes 'Error to get property' to 'Couldn't get property' in
> dev_err() as the latter one is more meaningful.
> 
> Signed-off-by: Kushagra Verma <kushagra765@outlook.com>
> ---
>  drivers/usb/dwc3/core.c | 10 ++++------
>  drivers/usb/dwc3/core.h | 28 ++++++++++++++--------------
>  2 files changed, 18 insertions(+), 20 deletions(-)

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 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.

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-05-01 13:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-05-01 13:16 [PATCH] USB / dwc3: fix checkpatch warnings Kushagra Verma
2022-05-01 13:41 ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox