Skip to contentSkip to conversation

staging: media: parport: remove unused variable

PATCH In review Aya Mahfouz 3 participants 3 messages Feb 18, 2015 – Feb 26, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: media: parport: remove unused variable

This patch uses the following coccinelle script to remove a variable that was simply used to store the return value of a function call before returning it:

@@
identifier len,f;
@@

-int len;
... when != len
when strict
-len =
+return

	f(...);

-return len;

---
 drivers/staging/media/parport/pms.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/staging/media/parport/pms.c +1 -4
index e6b4975..56e1d1f 100644
@@ -875,10 +875,7 @@ static ssize_t pms_read(struct file *file, char __user *buf,
 		    size_t count, loff_t *ppos)
 {
 	struct pms *dev = video_drvdata(file);
-	int len;
-
-	len = pms_capture(dev, buf, (dev->depth == 15), count);
-	return len;
+	return pms_capture(dev, buf, (dev->depth == 15), count);
 }
 
 static unsigned int pms_poll(struct file *file, struct poll_table_struct *wait)
Signature · 1 line
1.9.3
Acked-by on v1 1/1
#1 lore raw
Quoted 47 lines · Aya Mahfouz

This patch uses the following coccinelle script to remove a variable that was simply used to store the return value of a function call before returning it:

@@
identifier len,f;
@@

(quoted diff) +1 -2
-int len;
 ... when != len
     when strict
-len = 
+return 
	f(...);

-return len;

---
 drivers/staging/media/parport/pms.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/staging/media/parport/pms.c +1 -4
index e6b4975..56e1d1f 100644
@@ -875,10 +875,7 @@ static ssize_t pms_read(struct file *file, char __user *buf,
 		    size_t count, loff_t *ppos)
 {
 	struct pms *dev = video_drvdata(file);
-	int len;
-
-	len = pms_capture(dev, buf, (dev->depth == 15), count);
-	return len;
+	return pms_capture(dev, buf, (dev->depth == 15), count);
 }
 
 static unsigned int pms_poll(struct file *file, struct poll_table_struct *wait)
Signature · 8 lines
1.9.3

-- 
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/20150218003417.GA16982%40localhost.localdomain.
For more options, visit https://groups.google.com/d/optout.
maintainer
#2 lore raw
In reply to Aya Mahfouz
Quoted 14 lines · Aya Mahfouz

This patch uses the following coccinelle script to remove a variable that was simply used to store the return value of a function call before returning it:

@@
identifier len,f;
@@

(quoted diff) +1 -2
-int len;
 ... when != len
     when strict
-len = 
+return 
	f(...);
Quoted 7 lines

-return len;

---
 drivers/staging/media/parport/pms.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

This file is no longer in Linus's tree :(