All of lore.kernel.org
 help / color / mirror / Atom feed
From: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
To: outreachy-kernel@googlegroups.com
Subject: [PATCH] staging: media: parport: remove unused variable
Date: Wed, 18 Feb 2015 02:34:17 +0200	[thread overview]
Message-ID: <20150218003417.GA16982@localhost.localdomain> (raw)

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



             reply	other threads:[~2015-02-18  0:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-18  0:34 Aya Mahfouz [this message]
2015-02-18  6:44 ` [Outreachy kernel] [PATCH] staging: media: parport: remove unused variable Julia Lawall
2015-02-26 18:48 ` Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150218003417.GA16982@localhost.localdomain \
    --to=mahfouz.saif.elyazal@gmail.com \
    --cc=outreachy-kernel@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.