public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Drivers: usb: serial: Replace unsigned to unsigned int and fix line over 80 characters
@ 2017-08-03 20:51 Himanshu Jha
  2017-08-03 21:43 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: Himanshu Jha @ 2017-08-03 20:51 UTC (permalink / raw)
  To: johan; +Cc: gregkh, linux-usb, linux-kernel, Himanshu Jha

This patch fixes the following checkpatch.pl warnings:

WARNING: Block comments use * on subsequent lines
WARNING: Block comments use a trailing */ on a separate line
WARNING: Prefer 'unsigned int' to bare use of 'unsigned'
WARNING: Missing a blank line after declarations
WARNING: line over 80 characters

Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>
---
 drivers/usb/serial/ch341.c | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)

diff --git a/drivers/usb/serial/ch341.c b/drivers/usb/serial/ch341.c
index 351745a..f4ee53c 100644
--- a/drivers/usb/serial/ch341.c
+++ b/drivers/usb/serial/ch341.c
@@ -43,8 +43,10 @@
 /* second interrupt byte */
 #define CH341_MULT_STAT 0x04 /* multiple status since last interrupt event */
 
-/* status returned in third interrupt answer byte, inverted in data
-   from irq */
+/*
+ * status returned in third interrupt answer byte, inverted in data
+ * from irq
+ */
 #define CH341_BIT_CTS 0x01
 #define CH341_BIT_DSR 0x02
 #define CH341_BIT_RI  0x04
@@ -92,7 +94,7 @@ MODULE_DEVICE_TABLE(usb, id_table);
 
 struct ch341_private {
 	spinlock_t lock; /* access lock */
-	unsigned baud_rate; /* set baud rate */
+	unsigned int baud_rate; /* set baud rate */
 	u8 mcr;
 	u8 msr;
 	u8 lcr;
@@ -121,7 +123,7 @@ static int ch341_control_out(struct usb_device *dev, u8 request,
 
 static int ch341_control_in(struct usb_device *dev,
 			    u8 request, u16 value, u16 index,
-			    char *buf, unsigned bufsize)
+			    char *buf, unsigned int bufsize)
 {
 	int r;
 
@@ -289,6 +291,7 @@ static int ch341_port_remove(struct usb_serial_port *port)
 static int ch341_carrier_raised(struct usb_serial_port *port)
 {
 	struct ch341_private *priv = usb_get_serial_port_data(port);
+
 	if (priv->msr & CH341_BIT_DCD)
 		return 1;
 	return 0;
@@ -358,7 +361,7 @@ static void ch341_set_termios(struct tty_struct *tty,
 		struct usb_serial_port *port, struct ktermios *old_termios)
 {
 	struct ch341_private *priv = usb_get_serial_port_data(port);
-	unsigned baud_rate;
+	unsigned int baud_rate;
 	unsigned long flags;
 	u8 lcr;
 	int r;
@@ -442,11 +445,13 @@ static void ch341_break_ctl(struct tty_struct *tty, int break_state)
 	dev_dbg(&port->dev, "%s - initial ch341 break register contents - reg1: %x, reg2: %x\n",
 		__func__, break_reg[0], break_reg[1]);
 	if (break_state != 0) {
-		dev_dbg(&port->dev, "%s - Enter break state requested\n", __func__);
+		dev_dbg(&port->dev, "%s - Enter break state requested\n",
+			__func__);
 		break_reg[0] &= ~CH341_NBREAK_BITS;
 		break_reg[1] &= ~CH341_LCR_ENABLE_TX;
 	} else {
-		dev_dbg(&port->dev, "%s - Leave break state requested\n", __func__);
+		dev_dbg(&port->dev, "%s - Leave break state requested\n",
+			__func__);
 		break_reg[0] |= CH341_NBREAK_BITS;
 		break_reg[1] |= CH341_LCR_ENABLE_TX;
 	}
-- 
2.7.4

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

* Re: [PATCH] Drivers: usb: serial: Replace unsigned to unsigned int and fix line over 80 characters
  2017-08-03 20:51 [PATCH] Drivers: usb: serial: Replace unsigned to unsigned int and fix line over 80 characters Himanshu Jha
@ 2017-08-03 21:43 ` Greg KH
  0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2017-08-03 21:43 UTC (permalink / raw)
  To: Himanshu Jha; +Cc: johan, linux-usb, linux-kernel

On Fri, Aug 04, 2017 at 02:21:13AM +0530, Himanshu Jha wrote:
> This patch fixes the following checkpatch.pl warnings:
> 
> WARNING: Block comments use * on subsequent lines
> WARNING: Block comments use a trailing */ on a separate line
> WARNING: Prefer 'unsigned int' to bare use of 'unsigned'
> WARNING: Missing a blank line after declarations
> WARNING: line over 80 characters
> 
> Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>
> ---
>  drivers/usb/serial/ch341.c | 19 ++++++++++++-------
>  1 file changed, 12 insertions(+), 7 deletions(-)

Note, I'm not Johan, but I only take patches that do one thing at a
time, and no, "fixing all coding style issues" is not one thing :)

thanks,

greg k-h

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

end of thread, other threads:[~2017-08-03 21:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-03 20:51 [PATCH] Drivers: usb: serial: Replace unsigned to unsigned int and fix line over 80 characters Himanshu Jha
2017-08-03 21:43 ` Greg KH

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