[PATCH] staging: fieldbus: anybuss: Remove unnecessary variables

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In the functions export_reset_0 and export_reset_1 in arcx-anybus.c,
the only operation performed before return is passing the variable cd
(which takes the value of a function call on one of the parameters) as
argument to another function. Hence the variable cd can be removed.
Issue found using Coccinelle.

Signed-off-by: Nishka Dasgupta <nishka.dasgupta@xxxxxxxxx>
---
 drivers/staging/fieldbus/anybuss/arcx-anybus.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/fieldbus/anybuss/arcx-anybus.c b/drivers/staging/fieldbus/anybuss/arcx-anybus.c
index 2ecffa42e561..e245f940a5c4 100644
--- a/drivers/staging/fieldbus/anybuss/arcx-anybus.c
+++ b/drivers/staging/fieldbus/anybuss/arcx-anybus.c
@@ -87,16 +87,12 @@ static int anybuss_reset(struct controller_priv *cd,
 
 static void export_reset_0(struct device *dev, bool assert)
 {
-	struct controller_priv *cd = dev_get_drvdata(dev);
-
-	anybuss_reset(cd, 0, assert);
+	anybuss_reset(dev_get_drvdata(dev), 0, assert);
 }
 
 static void export_reset_1(struct device *dev, bool assert)
 {
-	struct controller_priv *cd = dev_get_drvdata(dev);
-
-	anybuss_reset(cd, 1, assert);
+	anybuss_reset(dev_get_drvdata(dev), 1, assert);
 }
 
 /*
-- 
2.19.1

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux