Skip to contentSkip to conversation

staging: media: lirc: lirc_bt829.c: Remove the explicit NULL comparison

PATCH Superseded Anchal Jain 2 participants 10 messages Sep 13, 2016 1 message not in the archive

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#1 lore raw

PATCH 1/6 staging: media: lirc: lirc_bt829.c: Remove the explicit NULL comparison

In reply to a message not in the archive

CHECK: Remove the explicit NULL comparison

---
 drivers/staging/media/lirc/lirc_bt829.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/media/lirc/lirc_bt829.c +1 -1
index 44f5655..f740115 100644
@@ -120,7 +120,7 @@ int init_module(void)
 	int rc;
 
 	pdev = do_pci_probe();
-	if (pdev == NULL)
+	if (!pdev)
 		return -ENODEV;
 
 	rc = pci_enable_device(pdev);
Signature · 1 line
1.9.1
#4 lore raw

PATCH 3/6 staging: media: lirc: lirc_imon.c: Remove a blank lines before a close brace '}'

In reply to a message not in the archive

CHECK: Remove a blank lines before a closed parenthesis '}'

---
 drivers/staging/media/lirc/lirc_imon.c | 1 -
 1 file changed, 1 deletion(-)
drivers/staging/media/lirc/lirc_imon.c +0 -1
index 1da5cc0..c12053d 100644
@@ -211,7 +211,6 @@ static void deregister_from_lirc(struct imon_context *context)
 	else
 		dev_info(&context->usbdev->dev,
 			 "Deregistered iMON driver (minor:%d)\n", minor);
-
 }
 
 /**
Signature · 1 line
1.9.1
#3 lore raw

PATCH 2/6 staging: media: lirc: lirc_imon.c: Remove multiple blank lines

In reply to a message not in the archive

CHECK: Remove multiple blank lines

---
 drivers/staging/media/lirc/lirc_imon.c | 1 -
 1 file changed, 1 deletion(-)
drivers/staging/media/lirc/lirc_imon.c +0 -1
index a183e68..1da5cc0 100644
@@ -32,7 +32,6 @@
 #include <media/lirc.h>
 #include <media/lirc_dev.h>
 
-
 #define MOD_AUTHOR	"Venky Raju <[email protected]>"
 #define MOD_DESC	"Driver for SoundGraph iMON MultiMedia IR/Display"
 #define MOD_NAME	"lirc_imon"
Signature · 1 line
1.9.1
#5 lore raw

PATCH 4/6 staging: media: lirc: lirc_imon.c: Remove unnecessary space after a cast

In reply to a message not in the archive

CHECK: Remove unnecessary space after cast

---
 drivers/staging/media/lirc/lirc_imon.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/media/lirc/lirc_imon.c +2 -2
index c12053d..e44f841 100644
@@ -427,7 +427,7 @@ static ssize_t vfd_write(struct file *file, const char __user *buf,
 
 	do {
 		memcpy(context->usb_tx_buf, context->tx.data_buf + offset, 7);
-		context->usb_tx_buf[7] = (unsigned char) seq;
+		context->usb_tx_buf[7] = (unsigned char)seq;
 
 		retval = send_packet(context);
 		if (retval) {
@@ -445,7 +445,7 @@ static ssize_t vfd_write(struct file *file, const char __user *buf,
 	if (context->vfd_proto_6p) {
 		/* Send packet #6 */
 		memcpy(context->usb_tx_buf, &vfd_packet6, sizeof(vfd_packet6));
-		context->usb_tx_buf[7] = (unsigned char) seq;
+		context->usb_tx_buf[7] = (unsigned char)seq;
 		retval = send_packet(context);
 		if (retval)
 			dev_err(&context->usbdev->dev,
Signature · 1 line
1.9.1
#2 lore raw
In reply to Anchal Jain
Quoted 1 line · Anchal Jain

CHECK: Remove the explicit NULL comparison

The change looks fine, but the patch should be CCd to some maintainers for this file, which you can find using the scripts/get_maintainer.pl command. Look at the section Submit a patch in the tutorial.

Also, the commit message should not just repeat the checkpatch warning, but rather say what you did to address that warning.

julia

Quoted 29 lines
---
 drivers/staging/media/lirc/lirc_bt829.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/media/lirc/lirc_bt829.c +1 -2
index 44f5655..f740115 100644
@@ -120,7 +120,7 @@ int init_module(void)
 	int rc;
 
 	pdev = do_pci_probe();
-	if (pdev == NULL)
+	if (!pdev)
 		return -ENODEV;
 
 	rc = pci_enable_device(pdev);
--

1.9.1

--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/6be9d24b82515d2758809431887a9b22b3fa61d8.1473758274.git.anchalj109%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

#8 lore raw

PATCH 5/6 staging: media: lirc: lirc_imon.c: add space around the operators

In reply to a message not in the archive

CHECK: Add space around the operators { "<<", "*"}.

---
 drivers/staging/media/lirc/lirc_imon.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/media/lirc/lirc_imon.c +1 -1
index e44f841..ee12da2 100644
@@ -561,7 +561,7 @@ static void submit_data(struct imon_context *context)
 		value |= PULSE_BIT;
 
 	for (i = 0; i < 4; ++i)
-		buf[i] = value>>(i*8);
+		buf[i] = value >> (i * 8);
 
 	lirc_buffer_write(context->driver->rbuf, buf);
 	wake_up(&context->driver->rbuf->wait_poll);
Signature · 1 line
1.9.1
#6 lore raw

Re: [Outreachy kernel] [PATCH 4/6] staging: media: lirc: lirc_imon.c: Remove unnecessary space after a cast

In reply to Anchal Jain
Quoted 1 line · Anchal Jain

CHECK: Remove unnecessary space after cast

This one does CC Greg, but when I run the get_maintainer command on this file, I get some other maintainers that should also be included.

julia

Quoted 38 lines
---
 drivers/staging/media/lirc/lirc_imon.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/media/lirc/lirc_imon.c +2 -3
index c12053d..e44f841 100644
@@ -427,7 +427,7 @@ static ssize_t vfd_write(struct file *file, const char __user *buf,
 
 	do {
 		memcpy(context->usb_tx_buf, context->tx.data_buf + offset, 7);
-		context->usb_tx_buf[7] = (unsigned char) seq;
+		context->usb_tx_buf[7] = (unsigned char)seq;
 
 		retval = send_packet(context);
 		if (retval) {
@@ -445,7 +445,7 @@ static ssize_t vfd_write(struct file *file, const char __user *buf,
 	if (context->vfd_proto_6p) {
 		/* Send packet #6 */
 		memcpy(context->usb_tx_buf, &vfd_packet6, sizeof(vfd_packet6));
-		context->usb_tx_buf[7] = (unsigned char) seq;
+		context->usb_tx_buf[7] = (unsigned char)seq;
 		retval = send_packet(context);
 		if (retval)
 			dev_err(&context->usbdev->dev,
--

1.9.1

--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/bb931375d1e4fa071e49eb8ea0dda0b5fd160337.1473758274.git.anchalj109%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

#9 lore raw

PATCH 6/6 staging: media: lirc: lirc_imon.c: Alignment should match open parenthesis

In reply to a message not in the archive

CHECK: Alignment should match open parenthesis

---
 drivers/staging/media/lirc/lirc_imon.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/staging/media/lirc/lirc_imon.c +7 -7
index ee12da2..b1c28e5 100644
@@ -587,7 +587,7 @@ static void imon_incoming_packet(struct imon_context *context,
 
 	if (len != 8) {
 		dev_warn(dev, "imon %s: invalid incoming packet size (len = %d, intf%d)\n",
-			__func__, len, intf);
+			 __func__, len, intf);
 		return;
 	}
 
@@ -828,7 +828,7 @@ static int imon_probe(struct usb_interface *interface,
 	}
 
 	dev_info(dev, "Registered iMON driver (lirc minor: %d)\n",
-			lirc_minor);
+		 lirc_minor);
 
 	/* Needed while unregistering! */
 	driver->minor = lirc_minor;
@@ -849,8 +849,8 @@ static int imon_probe(struct usb_interface *interface,
 		context->display = 1;
 
 	usb_fill_int_urb(context->rx_urb, context->usbdev,
-		usb_rcvintpipe(context->usbdev,
-			context->rx_endpoint->bEndpointAddress),
+			 usb_rcvintpipe(context->usbdev,
+			 context->rx_endpoint->bEndpointAddress),
 		context->usb_rx_buf, sizeof(context->usb_rx_buf),
 		usb_rx_callback, context,
 		context->rx_endpoint->bInterval);
@@ -875,7 +875,7 @@ static int imon_probe(struct usb_interface *interface,
 	}
 
 	dev_info(dev, "iMON device (%04x:%04x, intf%d) on usb<%d:%d> initialized\n",
-		vendor, product, ifnum, usbdev->bus->busnum, usbdev->devnum);
+		 vendor, product, ifnum, usbdev->bus->busnum, usbdev->devnum);
 
 	/* Everything went fine. Just unlock and return retval (with is 0) */
 	mutex_unlock(&context->ctx_lock);
@@ -966,8 +966,8 @@ static int imon_resume(struct usb_interface *intf)
 	struct imon_context *context = usb_get_intfdata(intf);
 
 	usb_fill_int_urb(context->rx_urb, context->usbdev,
-		usb_rcvintpipe(context->usbdev,
-			context->rx_endpoint->bEndpointAddress),
+			 usb_rcvintpipe(context->usbdev,
+			 context->rx_endpoint->bEndpointAddress),
 		context->usb_rx_buf, sizeof(context->usb_rx_buf),
 		usb_rx_callback, context,
 		context->rx_endpoint->bInterval);
Signature · 1 line
1.9.1
#7 lore raw

Re: [Outreachy kernel] [PATCH 4/6] staging: media: lirc: lirc_imon.c: Remove unnecessary space after a cast

In reply to Anchal Jain

The subject line is not correct. If you do git log --oneline drivers/staging/media/lirc/lirc_imon.c, then you get many examples, like the following:

f11055b staging: media: lirc: lirc_imon: don't print error when allocating urb f b833d0d [media] lirc_imon: do not leave imon_probe() with mutex held 2696f49 [media] Staging: media: lirc: use USB API functions rather than constant 7229f8c [media] staging:media:lirc Remove the extra braces in if statement of li af8a819 [media] lirc_imon: simplify error handling code
bb3a4dc staging: media: lirc: lirc_imon.c: remove extra parentheses around funct 8c6ccbe Staging: media: clean dev_err logging
dab363f Merge tag 'staging-3.19-rc1' of git://git.kernel.org/pub/scm/linux/kerne
f3a7550 [media] Staging: media: lirc: cleaned up packet dump in 2 files d82e62d staging: media: lirc: Remove useless cast on void pointer 732ba19 staging: media: lirc: lirc_imon.c: replace printk by dev_dbg 2c1bfc3 staging: media: lirc: Delete unused function tv2int

They are pretty varied, but only two have the full path and the file name
with .c at the end. staging: media: lirc: looks popular.

julia

Quoted 39 lines · Anchal Jain

CHECK: Remove unnecessary space after cast

---
 drivers/staging/media/lirc/lirc_imon.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/media/lirc/lirc_imon.c +2 -3
index c12053d..e44f841 100644
@@ -427,7 +427,7 @@ static ssize_t vfd_write(struct file *file, const char __user *buf,
 
 	do {
 		memcpy(context->usb_tx_buf, context->tx.data_buf + offset, 7);
-		context->usb_tx_buf[7] = (unsigned char) seq;
+		context->usb_tx_buf[7] = (unsigned char)seq;
 
 		retval = send_packet(context);
 		if (retval) {
@@ -445,7 +445,7 @@ static ssize_t vfd_write(struct file *file, const char __user *buf,
 	if (context->vfd_proto_6p) {
 		/* Send packet #6 */
 		memcpy(context->usb_tx_buf, &vfd_packet6, sizeof(vfd_packet6));
-		context->usb_tx_buf[7] = (unsigned char) seq;
+		context->usb_tx_buf[7] = (unsigned char)seq;
 		retval = send_packet(context);
 		if (retval)
 			dev_err(&context->usbdev->dev,
--

1.9.1

--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/bb931375d1e4fa071e49eb8ea0dda0b5fd160337.1473758274.git.anchalj109%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

#10 lore raw

Re: [Outreachy kernel] [PATCH 6/6] staging: media: lirc: lirc_imon.c: Alignment should match open parenthesis

In reply to Anchal Jain
Quoted 30 lines · Anchal Jain

CHECK: Alignment should match open parenthesis

---
 drivers/staging/media/lirc/lirc_imon.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/staging/media/lirc/lirc_imon.c +2 -2
index ee12da2..b1c28e5 100644
@@ -587,7 +587,7 @@ static void imon_incoming_packet(struct imon_context *context,
 
 	if (len != 8) {
 		dev_warn(dev, "imon %s: invalid incoming packet size (len = %d, intf%d)\n",
-			__func__, len, intf);
+			 __func__, len, intf);
 		return;
 	}
 
@@ -828,7 +828,7 @@ static int imon_probe(struct usb_interface *interface,
 	}
 
 	dev_info(dev, "Registered iMON driver (lirc minor: %d)\n",
-			lirc_minor);
+		 lirc_minor);
 
 	/* Needed while unregistering! */
 	driver->minor = lirc_minor;

drivers/staging/media/lirc/lirc_imon.c static int imon_probe(struct usb_interface *interface, · line 853

Quoted 7 lines
drivers/staging/media/lirc/lirc_imon.c +2 -2
@@ -849,8 +849,8 @@ static int imon_probe(struct usb_interface *interface,
 		context->display = 1;
 
 	usb_fill_int_urb(context->rx_urb, context->usbdev,
-		usb_rcvintpipe(context->usbdev,
-			context->rx_endpoint->bEndpointAddress),
+			 usb_rcvintpipe(context->usbdev,
+			 context->rx_endpoint->bEndpointAddress),

This looks odd. Perhaps it is not possible to indent

context->rx_endpoint->bEndpointAddress

as far as the ( after usb_rcvintpipe, but it should be indented more, to make apparent that it is an argument of a nested call.

julia

Quoted 33 lines
drivers/staging/media/lirc/lirc_imon.c +3 -4
 		context->usb_rx_buf, sizeof(context->usb_rx_buf),
 		usb_rx_callback, context,
 		context->rx_endpoint->bInterval);
@@ -875,7 +875,7 @@ static int imon_probe(struct usb_interface *interface,
 	}
 
 	dev_info(dev, "iMON device (%04x:%04x, intf%d) on usb<%d:%d> initialized\n",
-		vendor, product, ifnum, usbdev->bus->busnum, usbdev->devnum);
+		 vendor, product, ifnum, usbdev->bus->busnum, usbdev->devnum);
 
 	/* Everything went fine. Just unlock and return retval (with is 0) */
 	mutex_unlock(&context->ctx_lock);
@@ -966,8 +966,8 @@ static int imon_resume(struct usb_interface *intf)
 	struct imon_context *context = usb_get_intfdata(intf);
 
 	usb_fill_int_urb(context->rx_urb, context->usbdev,
-		usb_rcvintpipe(context->usbdev,
-			context->rx_endpoint->bEndpointAddress),
+			 usb_rcvintpipe(context->usbdev,
+			 context->rx_endpoint->bEndpointAddress),
 		context->usb_rx_buf, sizeof(context->usb_rx_buf),
 		usb_rx_callback, context,
 		context->rx_endpoint->bInterval);
--

1.9.1

--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/cf7e7362308491fa76f7de5d00e302fbbc583fde.1473758274.git.anchalj109%40gmail.com.
For more options, visit https://groups.google.com/d/optout.