drivers: usb: musb: musb_gadget: fixed coding style issues and removed unneeded code

Message ID 20230606065921.997102-1-neelchakrabortykernelwork@gmail.com
State New
Headers
Series drivers: usb: musb: musb_gadget: fixed coding style issues and removed unneeded code |

Commit Message

Neel Chakraborty June 6, 2023, 6:59 a.m. UTC
  Fixed a few coding style issues
Removed the static int musb_gadget_vbus_session function as it was
doing nothing.

Signed-off-by: Neel Chakraborty <neelchakrabortykernelwork@gmail.com>
---
 drivers/usb/musb/musb_gadget.c | 38 +++++++++++-----------------------
 1 file changed, 12 insertions(+), 26 deletions(-)
  

Comments

Greg KH June 6, 2023, 10:02 a.m. UTC | #1
On Tue, Jun 06, 2023 at 12:29:21PM +0530, Neel Chakraborty wrote:
> Fixed a few coding style issues
> Removed the static int musb_gadget_vbus_session function as it was
> doing nothing.
> 
> Signed-off-by: Neel Chakraborty <neelchakrabortykernelwork@gmail.com>
> ---
>  drivers/usb/musb/musb_gadget.c | 38 +++++++++++-----------------------
>  1 file changed, 12 insertions(+), 26 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
  

Patch

diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c
index 31c44325e828..ac5f9d325f71 100644
--- a/drivers/usb/musb/musb_gadget.c
+++ b/drivers/usb/musb/musb_gadget.c
@@ -521,7 +521,7 @@  static void rxstate(struct musb *musb, struct musb_request *req)
 	struct usb_request	*request = &req->request;
 	struct musb_ep		*musb_ep;
 	void __iomem		*epio = musb->endpoints[epnum].regs;
-	unsigned		len = 0;
+	unsigned int		len = 0;
 	u16			fifo_count;
 	u16			csr = musb_readw(epio, MUSB_RXCSR);
 	struct musb_hw_ep	*hw_ep = &musb->endpoints[epnum];
@@ -657,7 +657,7 @@  static void rxstate(struct musb *musb, struct musb_request *req)
 					musb_writew(epio, MUSB_RXCSR, csr);
 
 					transfer_size = min(request->length - request->actual,
-							(unsigned)fifo_count);
+							(unsigned int)fifo_count);
 					musb_ep->dma->desired_mode = 0;
 				}
 
@@ -695,7 +695,7 @@  static void rxstate(struct musb *musb, struct musb_request *req)
 					transfer_size = min_t(unsigned int,
 							request->length -
 							request->actual,
-							(unsigned)fifo_count);
+							(unsigned int)fifo_count);
 
 				csr &= ~MUSB_RXCSR_DMAMODE;
 				csr |= (MUSB_RXCSR_DMAENAB |
@@ -728,7 +728,7 @@  static void rxstate(struct musb *musb, struct musb_request *req)
 					fifo_count, len,
 					musb_ep->packet_sz);
 
-			fifo_count = min_t(unsigned, len, fifo_count);
+			fifo_count = min_t(unsigned int, len, fifo_count);
 
 			if (tusb_dma_omap(musb)) {
 				struct dma_controller *c = musb->dma_controller;
@@ -870,9 +870,8 @@  void musb_g_rx(struct musb *musb, u8 epnum)
 		if ((request->actual < request->length)
 				&& (musb_ep->dma->actual_len
 					== musb_ep->packet_sz)) {
-			/* In double buffer case, continue to unload fifo if
- 			 * there is Rx packet in FIFO.
- 			 **/
+			// In double buffer case, continue to unload fifo if
+			// there is Rx packet in FIFO.
 			csr = musb_readw(epio, MUSB_RXCSR);
 			if ((csr & MUSB_RXCSR_RXPKTRDY) &&
 				hw_ep->rx_double_buffered)
@@ -916,7 +915,7 @@  static int musb_gadget_enable(struct usb_ep *ep,
 	void __iomem	*mbase;
 	u8		epnum;
 	u16		csr;
-	unsigned	tmp;
+	unsigned int	tmp;
 	int		status = -EINVAL;
 
 	if (!ep || !desc)
@@ -1132,7 +1131,7 @@  struct usb_request *musb_alloc_request(struct usb_ep *ep, gfp_t gfp_flags)
 	struct musb_ep		*musb_ep = to_musb_ep(ep);
 	struct musb_request	*request = NULL;
 
-	request = kzalloc(sizeof *request, gfp_flags);
+	request = kzalloc(sizeof(*request), gfp_flags);
 	if (!request)
 		return NULL;
 
@@ -1161,7 +1160,7 @@  static LIST_HEAD(buffers);
 struct free_record {
 	struct list_head	list;
 	struct device		*dev;
-	unsigned		bytes;
+	unsigned int		bytes;
 	dma_addr_t		dma;
 };
 
@@ -1343,7 +1342,7 @@  static int musb_gadget_set_halt(struct usb_ep *ep, int value)
 
 	spin_lock_irqsave(&musb->lock, flags);
 
-	if ((USB_ENDPOINT_XFER_ISOC == musb_ep->type)) {
+	if (USB_ENDPOINT_XFER_ISOC == musb_ep->type) {
 		status = -EINVAL;
 		goto done;
 	}
@@ -1612,21 +1611,8 @@  static void musb_pullup(struct musb *musb, int is_on)
 	musb_writeb(musb->mregs, MUSB_POWER, power);
 }
 
-#if 0
-static int musb_gadget_vbus_session(struct usb_gadget *gadget, int is_active)
-{
-	musb_dbg(musb, "<= %s =>\n", __func__);
-
-	/*
-	 * FIXME iff driver's softconnect flag is set (as it is during probe,
-	 * though that can clear it), just musb_pullup().
-	 */
-
-	return -EINVAL;
-}
-#endif
 
-static int musb_gadget_vbus_draw(struct usb_gadget *gadget, unsigned mA)
+static int musb_gadget_vbus_draw(struct usb_gadget *gadget, unsigned int mA)
 {
 	struct musb	*musb = gadget_to_musb(gadget);
 
@@ -1744,7 +1730,7 @@  static inline void musb_g_init_endpoints(struct musb *musb)
 {
 	u8			epnum;
 	struct musb_hw_ep	*hw_ep;
-	unsigned		count = 0;
+	unsigned int		count = 0;
 
 	/* initialize endpoint list just once */
 	INIT_LIST_HEAD(&(musb->g.ep_list));