[PATCH 3/6] staging: mt7621-gpio: change 'to_mediatek_gpio' to make just a one line return

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

 



Function to_mediatek_gpio can directly return without declaring
anything else in its body improving readability. Also change
pointer '*' declaration to be with return type in the upper line.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@xxxxxxxxx>
---
 drivers/staging/mt7621-gpio/gpio-mt7621.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/mt7621-gpio/gpio-mt7621.c b/drivers/staging/mt7621-gpio/gpio-mt7621.c
index c96ae67..9132963 100644
--- a/drivers/staging/mt7621-gpio/gpio-mt7621.c
+++ b/drivers/staging/mt7621-gpio/gpio-mt7621.c
@@ -47,14 +47,10 @@ struct mtk_data {
 	struct mtk_gc *gc_map[MTK_BANK_CNT];
 };
 
-static inline struct mtk_gc
-*to_mediatek_gpio(struct gpio_chip *chip)
+static inline struct mtk_gc *
+to_mediatek_gpio(struct gpio_chip *chip)
 {
-	struct mtk_gc *mgc;
-
-	mgc = container_of(chip, struct mtk_gc, chip);
-
-	return mgc;
+	return container_of(chip, struct mtk_gc, chip);
 }
 
 static inline void
-- 
2.7.4

_______________________________________________
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