* [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
* Re: [Outreachy kernel] [PATCH] staging: media: parport: remove unused variable
2015-02-18 0:34 [PATCH] staging: media: parport: remove unused variable Aya Mahfouz
@ 2015-02-18 6:44 ` Julia Lawall
2015-02-26 18:48 ` Greg KH
1 sibling, 0 replies; 3+ messages in thread
From: Julia Lawall @ 2015-02-18 6:44 UTC (permalink / raw)
To: Aya Mahfouz; +Cc: outreachy-kernel
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
On Wed, 18 Feb 2015, Aya Mahfouz wrote:
> 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
>
> --
> 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 outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> 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.
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Outreachy kernel] [PATCH] staging: media: parport: remove unused variable
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
1 sibling, 0 replies; 3+ messages in thread
From: Greg KH @ 2015-02-26 18:48 UTC (permalink / raw)
To: Aya Mahfouz; +Cc: outreachy-kernel
On Wed, Feb 18, 2015 at 02:34:17AM +0200, Aya Mahfouz wrote:
> 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>
> Acked-by: Julia Lawall <julia.lawall@lip6.fr>
> ---
> drivers/staging/media/parport/pms.c | 5 +----
> 1 file changed, 1 insertion(+), 4 deletions(-)
This file is no longer in Linus's tree :(
^ permalink raw reply [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.