Skip to contentSkip to conversation

Staging: android: gio: fixes a variable type issue and tabbing issues

PATCH In review Thimo Braker 2 participants 5 messages May 7, 2016 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Staging: android: gio: fixes a variable type issue and tabbing issues

Fixes issues with the coding style checks.

---
 drivers/staging/android/timed_gpio.c   | 36 +++++++++++++++++-----------------
 drivers/staging/android/timed_gpio.h   |  8 ++++----
 drivers/staging/android/timed_output.c | 16 +++++++--------
 3 files changed, 30 insertions(+), 30 deletions(-)
drivers/staging/android/timed_gpio.c +18 -18
index 914fd10..61fbed7 100644
@@ -26,17 +26,17 @@
 #include "timed_gpio.h"
 
 struct timed_gpio_data {
-	struct timed_output_dev dev;
-	struct hrtimer timer;
-	spinlock_t lock;
-	unsigned gpio;
-	int max_timeout;
-	u8 active_low;
+	struct timed_output_dev	dev;
+	struct hrtimer		timer;
+	spinlock_t		lock;
+	unsigned int		gpio;
+	int			max_timeout;
+	u8			active_low;
 };
 
 static enum hrtimer_restart gpio_timer_func(struct hrtimer *timer)
 {
-	struct timed_gpio_data *data =
+	struct timed_gpio_data	*data =
 		container_of(timer, struct timed_gpio_data, timer);
 
 	gpio_direction_output(data->gpio, data->active_low ? 1 : 0);
@@ -45,8 +45,8 @@ static enum hrtimer_restart gpio_timer_func(struct hrtimer *timer)
 
 static int gpio_get_time(struct timed_output_dev *dev)
 {
-	struct timed_gpio_data *data;
-	ktime_t t;
+	struct timed_gpio_data	*data;
+	ktime_t			t;
 
 	data = container_of(dev, struct timed_gpio_data, dev);
 
@@ -60,9 +60,9 @@ static int gpio_get_time(struct timed_output_dev *dev)
 
 static void gpio_enable(struct timed_output_dev *dev, int value)
 {
-	struct timed_gpio_data *data =
+	struct timed_gpio_data	*data =
 		container_of(dev, struct timed_gpio_data, dev);
-	unsigned long flags;
+	unsigned long		flags;
 
 	spin_lock_irqsave(&data->lock, flags);
 
@@ -84,10 +84,10 @@ static void gpio_enable(struct timed_output_dev *dev, int value)
 
 static int timed_gpio_probe(struct platform_device *pdev)
 {
-	struct timed_gpio_platform_data *pdata = pdev->dev.platform_data;
-	struct timed_gpio *cur_gpio;
-	struct timed_gpio_data *gpio_data, *gpio_dat;
-	int i, ret;
+	struct timed_gpio_platform_data	*pdata = pdev->dev.platform_data;
+	struct timed_gpio		*cur_gpio;
+	struct timed_gpio_data		*gpio_data, *gpio_dat;
+	int				i, ret;
 
 	if (!pdata)
 		return -EBUSY;
@@ -139,9 +139,9 @@ err_out:
 
 static int timed_gpio_remove(struct platform_device *pdev)
 {
-	struct timed_gpio_platform_data *pdata = pdev->dev.platform_data;
-	struct timed_gpio_data *gpio_data = platform_get_drvdata(pdev);
-	int i;
+	struct timed_gpio_platform_data	*pdata = pdev->dev.platform_data;
+	struct timed_gpio_data		*gpio_data = platform_get_drvdata(pdev);
+	int				i;
 
 	for (i = 0; i < pdata->num_gpios; i++) {
 		timed_output_dev_unregister(&gpio_data[i].dev);
drivers/staging/android/timed_gpio.h +4 -4
index d29e169..2068c8f 100644
@@ -19,15 +19,15 @@
 #define TIMED_GPIO_NAME "timed-gpio"
 
 struct timed_gpio {
-	const char *name;
-	unsigned	gpio;
+	const char	*name;
+	unsigned int	gpio;
 	int		max_timeout;
 	u8		active_low;
 };
 
 struct timed_gpio_platform_data {
-	int		num_gpios;
-	struct timed_gpio *gpios;
+	int			num_gpios;
+	struct timed_gpio	*gpios;
 };
 
 #endif
drivers/staging/android/timed_output.c +8 -8
index aff9cdb..05d9863 100644
@@ -25,14 +25,14 @@
 
 #include "timed_output.h"
 
-static struct class *timed_output_class;
-static atomic_t device_count;
+static struct class	*timed_output_class;
+static atomic_t		device_count;
 
 static ssize_t enable_show(struct device *dev, struct device_attribute *attr,
 			   char *buf)
 {
-	struct timed_output_dev *tdev = dev_get_drvdata(dev);
-	int remaining = tdev->get_time(tdev);
+	struct timed_output_dev	*tdev = dev_get_drvdata(dev);
+	int			remaining = tdev->get_time(tdev);
 
 	return sprintf(buf, "%d\n", remaining);
 }
@@ -40,9 +40,9 @@ static ssize_t enable_show(struct device *dev, struct device_attribute *attr,
 static ssize_t enable_store(struct device *dev, struct device_attribute *attr,
 			    const char *buf, size_t size)
 {
-	struct timed_output_dev *tdev = dev_get_drvdata(dev);
-	int value;
-	int rc;
+	struct timed_output_dev	*tdev = dev_get_drvdata(dev);
+	int			value;
+	int			rc;
 
 	rc = kstrtoint(buf, 0, &value);
 	if (rc != 0)
@@ -75,7 +75,7 @@ static int create_timed_output_class(void)
 
 int timed_output_dev_register(struct timed_output_dev *tdev)
 {
-	int ret;
+	int	ret;
 
 	if (!tdev || !tdev->name || !tdev->enable || !tdev->get_time)
 		return -EINVAL;
Signature · 1 line
2.1.4
maintainer
#1 lore raw
Quoted 1 line · Thimo Braker

Fixes issues with the coding style checks.

What issues? Always be specific, and describe what you are doing. Also don't put more than one "thing" in a single patch (hint, "coding style cleanups" are not one thing.)

Quoted 6 lines
---
 drivers/staging/android/timed_gpio.c   | 36 +++++++++++++++++-----------------
 drivers/staging/android/timed_gpio.h   |  8 ++++----
 drivers/staging/android/timed_output.c | 16 +++++++--------

These files are not in linux-next, please always work from that, they have been gone from my tree for months now :(

thanks,

greg k-h

#2 lore raw

Thanks for the reply.
Will give that a check. :)
Got pointed to torvalds/linux-2.6 by some other guy.

Will have a look in the other repo.
Also, would you rather have me send a patch for every type (eg tabbing fix, capital fix, spelling fix, 80-char fix, etc)? (Just to be sure I properly understood you.)

Thanks,

Thimo B.

Quoted 17 lines · Greg KH
Quoted 1 line · Thimo Braker

Fixes issues with the coding style checks.

What issues? Always be specific, and describe what you are doing. Also don't put more than one "thing" in a single patch (hint, "coding style cleanups" are not one thing.)

Quoted 5 lines
---
  drivers/staging/android/timed_gpio.c   | 36 +++++++++++++++++-----------------
  drivers/staging/android/timed_gpio.h   |  8 ++++----
  drivers/staging/android/timed_output.c | 16 +++++++--------

These files are not in linux-next, please always work from that, they have been gone from my tree for months now :(

thanks,

greg k-h

maintainer
#3 lore raw

A: No.
Q: Should I include quotations after my reply?

http://daringfireball.net/2007/07/on_top

Quoted 8 lines · Thimo Braker

Thanks for the reply.
Will give that a check. :)
Got pointed to torvalds/linux-2.6 by some other guy.

Will have a look in the other repo.
Also, would you rather have me send a patch for every type (eg tabbing fix, capital fix, spelling fix, 80-char fix, etc)? (Just to be sure I properly understood you.)

Yes, a patch should only do one thing. Look at the patches sent the driverdevel mailing list for examples of this.

thanks,

greg kh

#4 lore raw
Quoted 1 line

Q: Should I include quotations after my reply?

Sorry about that, will do.

Quoted 1 line

Look at the patches sent the driverdevel mailing list for examples of this.

Just subscribed to that mailing list, will keep an eye out for proper patch mails.

Thanks,

Thimo B.