mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/3] fixed errors from checkpatch.pl
@ 2017-03-04  2:42 Milian Reichardt
  2017-03-04  2:42 ` [PATCH 1/3] USB: misc: ldusb: fixed decimal permission coding issue Milian Reichardt
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Milian Reichardt @ 2017-03-04  2:42 UTC (permalink / raw)
  To: gregkh; +Cc: wsa-dev, mreichardt95, linux-usb, linux-kernel

Changed multiple errors output from checkpatch.pl to enhance readability

Milian Reichardt (3):
  USB: misc: ldusb: fixed decimal permission coding issue
  USB: misc: ldusb: changed '*' location to fit coding Style
  USB: misc: ldusb: Added Space after ',' to fit the coding style

 drivers/usb/misc/ldusb.c | 30 +++++++++++++++---------------
 1 file changed, 15 insertions(+), 15 deletions(-)

-- 
2.12.0

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

* [PATCH 1/3] USB: misc: ldusb: fixed decimal permission coding issue
  2017-03-04  2:42 [PATCH 0/3] fixed errors from checkpatch.pl Milian Reichardt
@ 2017-03-04  2:42 ` Milian Reichardt
  2017-03-04  2:42 ` [PATCH 2/3] USB: misc: ldusb: changed '*' location to fit coding Style Milian Reichardt
  2017-03-04  2:42 ` [PATCH 3/3] USB: misc: ldusb: Added Space after ',' to fit the coding style Milian Reichardt
  2 siblings, 0 replies; 4+ messages in thread
From: Milian Reichardt @ 2017-03-04  2:42 UTC (permalink / raw)
  To: gregkh; +Cc: wsa-dev, mreichardt95, linux-usb, linux-kernel

Fixed ERROR: Use 4 digit octal (0777) not decimal permissions to fulfill
the current coding-style.

Signed-of-by: Milian Reichardt <mreichardt95@gmail.com>
---
 drivers/usb/misc/ldusb.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/usb/misc/ldusb.c b/drivers/usb/misc/ldusb.c
index 3bc5356832db..e965ed24bb37 100644
--- a/drivers/usb/misc/ldusb.c
+++ b/drivers/usb/misc/ldusb.c
@@ -122,13 +122,13 @@ MODULE_SUPPORTED_DEVICE("LD USB Devices");
  * avoid racing conditions and get better performance of the driver.
  */
 static int ring_buffer_size = 128;
-module_param(ring_buffer_size, int, 0);
+module_param(ring_buffer_size, int, 0000);
 MODULE_PARM_DESC(ring_buffer_size, "Read ring buffer size in reports");
 
 /* The write_buffer can contain more than one interrupt out transfer.
  */
 static int write_buffer_size = 10;
-module_param(write_buffer_size, int, 0);
+module_param(write_buffer_size, int, 0000);
 MODULE_PARM_DESC(write_buffer_size, "Write buffer size in reports");
 
 /* As of kernel version 2.6.4 ehci-hcd uses an
@@ -141,11 +141,11 @@ MODULE_PARM_DESC(write_buffer_size, "Write buffer size in reports");
  * or set to 1 to use the standard interval from the endpoint descriptors.
  */
 static int min_interrupt_in_interval = 2;
-module_param(min_interrupt_in_interval, int, 0);
+module_param(min_interrupt_in_interval, int, 0000);
 MODULE_PARM_DESC(min_interrupt_in_interval, "Minimum interrupt in interval in ms");
 
 static int min_interrupt_out_interval = 2;
-module_param(min_interrupt_out_interval, int, 0);
+module_param(min_interrupt_out_interval, int, 0000);
 MODULE_PARM_DESC(min_interrupt_out_interval, "Minimum interrupt out interval in ms");
 
 /* Structure to hold all of our device specific stuff */
-- 
2.12.0

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

* [PATCH 2/3] USB: misc: ldusb: changed '*' location to fit coding Style
  2017-03-04  2:42 [PATCH 0/3] fixed errors from checkpatch.pl Milian Reichardt
  2017-03-04  2:42 ` [PATCH 1/3] USB: misc: ldusb: fixed decimal permission coding issue Milian Reichardt
@ 2017-03-04  2:42 ` Milian Reichardt
  2017-03-04  2:42 ` [PATCH 3/3] USB: misc: ldusb: Added Space after ',' to fit the coding style Milian Reichardt
  2 siblings, 0 replies; 4+ messages in thread
From: Milian Reichardt @ 2017-03-04  2:42 UTC (permalink / raw)
  To: gregkh; +Cc: wsa-dev, mreichardt95, linux-usb, linux-kernel

Changed the location of '*' to fit the current coding style and easy
readability.

Signed-of-by: Milian Reichardt <mreichardt95@gmail.com>
---
 drivers/usb/misc/ldusb.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/usb/misc/ldusb.c b/drivers/usb/misc/ldusb.c
index e965ed24bb37..2c68e5153539 100644
--- a/drivers/usb/misc/ldusb.c
+++ b/drivers/usb/misc/ldusb.c
@@ -151,20 +151,20 @@ MODULE_PARM_DESC(min_interrupt_out_interval, "Minimum interrupt out interval in
 /* Structure to hold all of our device specific stuff */
 struct ld_usb {
 	struct mutex		mutex;		/* locks this structure */
-	struct usb_interface*	intf;		/* save off the usb interface pointer */
+	struct usb_interface	*intf;		/* save off the usb interface pointer */
 
 	int			open_count;	/* number of times this port has been opened */
 
-	char*			ring_buffer;
+	char			*ring_buffer;
 	unsigned int		ring_head;
 	unsigned int		ring_tail;
 
 	wait_queue_head_t	read_wait;
 	wait_queue_head_t	write_wait;
 
-	char*			interrupt_in_buffer;
-	struct usb_endpoint_descriptor* interrupt_in_endpoint;
-	struct urb*		interrupt_in_urb;
+	char			*interrupt_in_buffer;
+	struct usb_endpoint_descriptor *interrupt_in_endpoint;
+	struct urb		*interrupt_in_urb;
 	int			interrupt_in_interval;
 	size_t			interrupt_in_endpoint_size;
 	int			interrupt_in_running;
@@ -172,9 +172,9 @@ struct ld_usb {
 	int			buffer_overflow;
 	spinlock_t		rbsl;
 
-	char*			interrupt_out_buffer;
-	struct usb_endpoint_descriptor* interrupt_out_endpoint;
-	struct urb*		interrupt_out_urb;
+	char			*interrupt_out_buffer;
+	struct usb_endpoint_descriptor *interrupt_out_endpoint;
+	struct urb		*interrupt_out_urb;
 	int			interrupt_out_interval;
 	size_t			interrupt_out_endpoint_size;
 	int			interrupt_out_busy;
@@ -244,7 +244,7 @@ static void ld_usb_interrupt_in_callback(struct urb *urb)
 	if (urb->actual_length > 0) {
 		next_ring_head = (dev->ring_head+1) % ring_buffer_size;
 		if (next_ring_head != dev->ring_tail) {
-			actual_buffer = (size_t*)(dev->ring_buffer + dev->ring_head*(sizeof(size_t)+dev->interrupt_in_endpoint_size));
+			actual_buffer = (size_t *)(dev->ring_buffer + dev->ring_head * (sizeof(size_t)+dev->interrupt_in_endpoint_size));
 			/* actual_buffer gets urb->actual_length + interrupt_in_buffer */
 			*actual_buffer = urb->actual_length;
 			memcpy(actual_buffer+1, dev->interrupt_in_buffer, urb->actual_length);
@@ -483,7 +483,7 @@ static ssize_t ld_usb_read(struct file *file, char __user *buffer, size_t count,
 	}
 
 	/* actual_buffer contains actual_length + interrupt_in_buffer */
-	actual_buffer = (size_t*)(dev->ring_buffer + dev->ring_tail*(sizeof(size_t)+dev->interrupt_in_endpoint_size));
+	actual_buffer = (size_t *)(dev->ring_buffer + dev->ring_tail * (sizeof(size_t)+dev->interrupt_in_endpoint_size));
 	bytes_to_read = min(count, *actual_buffer);
 	if (bytes_to_read < *actual_buffer)
 		dev_warn(&dev->intf->dev, "Read buffer overflow, %zd bytes dropped\n",
-- 
2.12.0

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

* [PATCH 3/3] USB: misc: ldusb: Added Space after ',' to fit the coding style
  2017-03-04  2:42 [PATCH 0/3] fixed errors from checkpatch.pl Milian Reichardt
  2017-03-04  2:42 ` [PATCH 1/3] USB: misc: ldusb: fixed decimal permission coding issue Milian Reichardt
  2017-03-04  2:42 ` [PATCH 2/3] USB: misc: ldusb: changed '*' location to fit coding Style Milian Reichardt
@ 2017-03-04  2:42 ` Milian Reichardt
  2 siblings, 0 replies; 4+ messages in thread
From: Milian Reichardt @ 2017-03-04  2:42 UTC (permalink / raw)
  To: gregkh; +Cc: wsa-dev, mreichardt95, linux-usb, linux-kernel

Added a Space after ',' to get rid of an error message in checkpatch.pl
and improve readability

Signed-of-by: Milian Reichardt <mreichardt95@gmail.com>
---
 drivers/usb/misc/ldusb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/misc/ldusb.c b/drivers/usb/misc/ldusb.c
index 2c68e5153539..77b76b468307 100644
--- a/drivers/usb/misc/ldusb.c
+++ b/drivers/usb/misc/ldusb.c
@@ -561,7 +561,7 @@ static ssize_t ld_usb_write(struct file *file, const char __user *buffer,
 	/* write the data into interrupt_out_buffer from userspace */
 	bytes_to_write = min(count, write_buffer_size*dev->interrupt_out_endpoint_size);
 	if (bytes_to_write < count)
-		dev_warn(&dev->intf->dev, "Write buffer overflow, %zd bytes dropped\n",count-bytes_to_write);
+		dev_warn(&dev->intf->dev, "Write buffer overflow, %zd bytes dropped\n", count-bytes_to_write);
 	dev_dbg(&dev->intf->dev, "%s: count = %zd, bytes_to_write = %zd\n",
 		__func__, count, bytes_to_write);
 
-- 
2.12.0

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

end of thread, other threads:[~2017-03-04  2:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-04  2:42 [PATCH 0/3] fixed errors from checkpatch.pl Milian Reichardt
2017-03-04  2:42 ` [PATCH 1/3] USB: misc: ldusb: fixed decimal permission coding issue Milian Reichardt
2017-03-04  2:42 ` [PATCH 2/3] USB: misc: ldusb: changed '*' location to fit coding Style Milian Reichardt
2017-03-04  2:42 ` [PATCH 3/3] USB: misc: ldusb: Added Space after ',' to fit the coding style Milian Reichardt

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

all inboxes | Powered by JetHome®