All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] staging: media: parport: remove unused variable
@ 2015-02-18  0:34 Aya Mahfouz
  2015-02-18  6:44 ` [Outreachy kernel] " Julia Lawall
  2015-02-26 18:48 ` Greg KH
  0 siblings, 2 replies; 3+ messages in thread
From: Aya Mahfouz @ 2015-02-18  0:34 UTC (permalink / raw)
  To: outreachy-kernel

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;

Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
---
 drivers/staging/media/parport/pms.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/staging/media/parport/pms.c b/drivers/staging/media/parport/pms.c
index e6b4975..56e1d1f 100644
--- a/drivers/staging/media/parport/pms.c
+++ b/drivers/staging/media/parport/pms.c
@@ -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)
-- 
1.9.3



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

end of thread, other threads:[~2015-02-26 18:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-18  0:34 [PATCH] staging: media: parport: remove unused variable Aya Mahfouz
2015-02-18  6:44 ` [Outreachy kernel] " Julia Lawall
2015-02-26 18:48 ` Greg KH

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.