public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix style issues in olpc_dcon
@ 2017-11-20 21:14 zebmccorkle
  2017-11-22  0:43 ` Tobin C. Harding
  0 siblings, 1 reply; 2+ messages in thread
From: zebmccorkle @ 2017-11-20 21:14 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Zebulon McCorkle, Jens Frederich, Daniel Drake, Jon Nettleton,
	Greg Kroah-Hartman, devel, linux-kernel

From: Zebulon McCorkle <zebmccorkle@disr.it>

The olpc_dcon driver had some slight style issues, mostly pertaining to
indentation in function calls and definitions. I've solved those, and
plan to work on the issues in the TODO.

Signed-off-by: Zebulon McCorkle <zebmccorkle@disr.it>
---
 drivers/staging/olpc_dcon/olpc_dcon.c      | 30 ++++++++++++++++++++----------
 drivers/staging/olpc_dcon/olpc_dcon.h      | 30 +++++++++++++++---------------
 drivers/staging/olpc_dcon/olpc_dcon_xo_1.c |  2 +-
 3 files changed, 36 insertions(+), 26 deletions(-)

diff --git a/drivers/staging/olpc_dcon/olpc_dcon.c b/drivers/staging/olpc_dcon/olpc_dcon.c
index 82bffd911435..2744c9f0920e 100644
--- a/drivers/staging/olpc_dcon/olpc_dcon.c
+++ b/drivers/staging/olpc_dcon/olpc_dcon.c
@@ -393,7 +393,8 @@ static void dcon_set_source_sync(struct dcon_priv *dcon, int arg)
 }
 
 static ssize_t dcon_mode_show(struct device *dev,
-	struct device_attribute *attr, char *buf)
+			      struct device_attribute *attr,
+			      char *buf)
 {
 	struct dcon_priv *dcon = dev_get_drvdata(dev);
 
@@ -401,7 +402,8 @@ static ssize_t dcon_mode_show(struct device *dev,
 }
 
 static ssize_t dcon_sleep_show(struct device *dev,
-	struct device_attribute *attr, char *buf)
+			       struct device_attribute *attr,
+			       char *buf)
 {
 	struct dcon_priv *dcon = dev_get_drvdata(dev);
 
@@ -409,7 +411,8 @@ static ssize_t dcon_sleep_show(struct device *dev,
 }
 
 static ssize_t dcon_freeze_show(struct device *dev,
-	struct device_attribute *attr, char *buf)
+				struct device_attribute *attr,
+				char *buf)
 {
 	struct dcon_priv *dcon = dev_get_drvdata(dev);
 
@@ -417,7 +420,8 @@ static ssize_t dcon_freeze_show(struct device *dev,
 }
 
 static ssize_t dcon_mono_show(struct device *dev,
-	struct device_attribute *attr, char *buf)
+			      struct device_attribute *attr,
+			      char *buf)
 {
 	struct dcon_priv *dcon = dev_get_drvdata(dev);
 
@@ -425,13 +429,15 @@ static ssize_t dcon_mono_show(struct device *dev,
 }
 
 static ssize_t dcon_resumeline_show(struct device *dev,
-	struct device_attribute *attr, char *buf)
+				    struct device_attribute *attr,
+				    char *buf)
 {
 	return sprintf(buf, "%d\n", resumeline);
 }
 
 static ssize_t dcon_mono_store(struct device *dev,
-	struct device_attribute *attr, const char *buf, size_t count)
+			       struct device_attribute *attr,
+			       const char *buf, size_t count)
 {
 	unsigned long enable_mono;
 	int rc;
@@ -446,7 +452,8 @@ static ssize_t dcon_mono_store(struct device *dev,
 }
 
 static ssize_t dcon_freeze_store(struct device *dev,
-	struct device_attribute *attr, const char *buf, size_t count)
+				 struct device_attribute *attr,
+				 const char *buf, size_t count)
 {
 	struct dcon_priv *dcon = dev_get_drvdata(dev);
 	unsigned long output;
@@ -474,7 +481,8 @@ static ssize_t dcon_freeze_store(struct device *dev,
 }
 
 static ssize_t dcon_resumeline_store(struct device *dev,
-	struct device_attribute *attr, const char *buf, size_t count)
+				     struct device_attribute *attr,
+				     const char *buf, size_t count)
 {
 	unsigned short rl;
 	int rc;
@@ -490,7 +498,8 @@ static ssize_t dcon_resumeline_store(struct device *dev,
 }
 
 static ssize_t dcon_sleep_store(struct device *dev,
-	struct device_attribute *attr, const char *buf, size_t count)
+				struct device_attribute *attr,
+				const char *buf, size_t count)
 {
 	unsigned long output;
 	int ret;
@@ -641,7 +650,8 @@ static int dcon_probe(struct i2c_client *client, const struct i2c_device_id *id)
 	/* Add the backlight device for the DCON */
 	dcon_bl_props.brightness = dcon->bl_val;
 	dcon->bl_dev = backlight_device_register("dcon-bl", &dcon_device->dev,
-		dcon, &dcon_bl_ops, &dcon_bl_props);
+						 dcon, &dcon_bl_ops,
+						 &dcon_bl_props);
 	if (IS_ERR(dcon->bl_dev)) {
 		dev_err(&client->dev, "cannot register backlight dev (%ld)\n",
 			PTR_ERR(dcon->bl_dev));
diff --git a/drivers/staging/olpc_dcon/olpc_dcon.h b/drivers/staging/olpc_dcon/olpc_dcon.h
index 8fbde5d3b4a6..fa89bb97c7b0 100644
--- a/drivers/staging/olpc_dcon/olpc_dcon.h
+++ b/drivers/staging/olpc_dcon/olpc_dcon.h
@@ -10,18 +10,18 @@
 #define DCON_REG_ID		 0
 #define DCON_REG_MODE		 1
 
-#define MODE_PASSTHRU	(1<<0)
-#define MODE_SLEEP	(1<<1)
-#define MODE_SLEEP_AUTO	(1<<2)
-#define MODE_BL_ENABLE	(1<<3)
-#define MODE_BLANK	(1<<4)
-#define MODE_CSWIZZLE	(1<<5)
-#define MODE_COL_AA	(1<<6)
-#define MODE_MONO_LUMA	(1<<7)
-#define MODE_SCAN_INT	(1<<8)
-#define MODE_CLOCKDIV	(1<<9)
-#define MODE_DEBUG	(1<<14)
-#define MODE_SELFTEST	(1<<15)
+#define MODE_PASSTHRU	BIT(0)
+#define MODE_SLEEP	BIT(1)
+#define MODE_SLEEP_AUTO	BIT(2)
+#define MODE_BL_ENABLE	BIT(3)
+#define MODE_BLANK	BIT(4)
+#define MODE_CSWIZZLE	BIT(5)
+#define MODE_COL_AA	BIT(6)
+#define MODE_MONO_LUMA	BIT(7)
+#define MODE_SCAN_INT	BIT(8)
+#define MODE_CLOCKDIV	BIT(9)
+#define MODE_DEBUG	BIT(14)
+#define MODE_SELFTEST	BIT(15)
 
 #define DCON_REG_HRES		0x2
 #define DCON_REG_HTOTAL		0x3
@@ -36,11 +36,11 @@
 #define DCON_REG_MEM_OPT_B	0x42
 
 /* Load Delay Locked Loop (DLL) settings for clock delay */
-#define MEM_DLL_CLOCK_DELAY	(1<<0)
+#define MEM_DLL_CLOCK_DELAY	BIT(0)
 /* Memory controller power down function */
-#define MEM_POWER_DOWN		(1<<8)
+#define MEM_POWER_DOWN		BIT(8)
 /* Memory controller software reset */
-#define MEM_SOFT_RESET		(1<<0)
+#define MEM_SOFT_RESET		BIT(0)
 
 /* Status values */
 
diff --git a/drivers/staging/olpc_dcon/olpc_dcon_xo_1.c b/drivers/staging/olpc_dcon/olpc_dcon_xo_1.c
index 0c5a10c69401..633c58ce24ee 100644
--- a/drivers/staging/olpc_dcon/olpc_dcon_xo_1.c
+++ b/drivers/staging/olpc_dcon/olpc_dcon_xo_1.c
@@ -69,7 +69,7 @@ static int dcon_init_xo_1(struct dcon_priv *dcon)
 	gpio_direction_input(OLPC_GPIO_DCON_IRQ);
 	gpio_direction_input(OLPC_GPIO_DCON_BLANK);
 	gpio_direction_output(OLPC_GPIO_DCON_LOAD,
-			dcon->curr_src == DCON_SOURCE_CPU);
+			      dcon->curr_src == DCON_SOURCE_CPU);
 
 	/* Set up the interrupt mappings */
 
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] Fix style issues in olpc_dcon
  2017-11-20 21:14 [PATCH] Fix style issues in olpc_dcon zebmccorkle
@ 2017-11-22  0:43 ` Tobin C. Harding
  0 siblings, 0 replies; 2+ messages in thread
From: Tobin C. Harding @ 2017-11-22  0:43 UTC (permalink / raw)
  To: zebmccorkle
  Cc: Greg Kroah-Hartman, devel, Daniel Drake, Jens Frederich,
	Greg Kroah-Hartman, Jon Nettleton, linux-kernel

Missing subsystem in subject line. Please use the same git brief
description format that has been used previously for files you want to
patch. You can view previous commits for a file using

	git log --pretty=oneline --abbrev --reverse

On Mon, Nov 20, 2017 at 03:14:21PM -0600, zebmccorkle@disr.it wrote:
> From: Zebulon McCorkle <zebmccorkle@disr.it>
> 
> The olpc_dcon driver had some slight style issues, mostly pertaining to
> indentation in function calls and definitions. I've solved those, and
> plan to work on the issues in the TODO.

Please read Documentation/process/submitting-patches.rst for tips on how to
write git commit log messages. Especially section '2) Describe your changes'.

> Signed-off-by: Zebulon McCorkle <zebmccorkle@disr.it>
> ---
>  drivers/staging/olpc_dcon/olpc_dcon.c      | 30 ++++++++++++++++++++----------
>  drivers/staging/olpc_dcon/olpc_dcon.h      | 30 +++++++++++++++---------------
>  drivers/staging/olpc_dcon/olpc_dcon_xo_1.c |  2 +-
>  3 files changed, 36 insertions(+), 26 deletions(-)
> 
> diff --git a/drivers/staging/olpc_dcon/olpc_dcon.c b/drivers/staging/olpc_dcon/olpc_dcon.c
> index 82bffd911435..2744c9f0920e 100644
> --- a/drivers/staging/olpc_dcon/olpc_dcon.c
> +++ b/drivers/staging/olpc_dcon/olpc_dcon.c
> @@ -393,7 +393,8 @@ static void dcon_set_source_sync(struct dcon_priv *dcon, int arg)
>  }
>  
>  static ssize_t dcon_mode_show(struct device *dev,
> -	struct device_attribute *attr, char *buf)
> +			      struct device_attribute *attr,
> +			      char *buf)
>  {
>  	struct dcon_priv *dcon = dev_get_drvdata(dev);
>  
> @@ -401,7 +402,8 @@ static ssize_t dcon_mode_show(struct device *dev,
>  }
>  
>  static ssize_t dcon_sleep_show(struct device *dev,
> -	struct device_attribute *attr, char *buf)
> +			       struct device_attribute *attr,
> +			       char *buf)
>  {
>  	struct dcon_priv *dcon = dev_get_drvdata(dev);
>  
> @@ -409,7 +411,8 @@ static ssize_t dcon_sleep_show(struct device *dev,
>  }
>  
>  static ssize_t dcon_freeze_show(struct device *dev,
> -	struct device_attribute *attr, char *buf)
> +				struct device_attribute *attr,
> +				char *buf)
>  {
>  	struct dcon_priv *dcon = dev_get_drvdata(dev);
>  
> @@ -417,7 +420,8 @@ static ssize_t dcon_freeze_show(struct device *dev,
>  }
>  
>  static ssize_t dcon_mono_show(struct device *dev,
> -	struct device_attribute *attr, char *buf)
> +			      struct device_attribute *attr,
> +			      char *buf)
>  {
>  	struct dcon_priv *dcon = dev_get_drvdata(dev);
>  
> @@ -425,13 +429,15 @@ static ssize_t dcon_mono_show(struct device *dev,
>  }
>  
>  static ssize_t dcon_resumeline_show(struct device *dev,
> -	struct device_attribute *attr, char *buf)
> +				    struct device_attribute *attr,
> +				    char *buf)
>  {
>  	return sprintf(buf, "%d\n", resumeline);
>  }
>  
>  static ssize_t dcon_mono_store(struct device *dev,
> -	struct device_attribute *attr, const char *buf, size_t count)
> +			       struct device_attribute *attr,
> +			       const char *buf, size_t count)
>  {
>  	unsigned long enable_mono;
>  	int rc;
> @@ -446,7 +452,8 @@ static ssize_t dcon_mono_store(struct device *dev,
>  }
>  
>  static ssize_t dcon_freeze_store(struct device *dev,
> -	struct device_attribute *attr, const char *buf, size_t count)
> +				 struct device_attribute *attr,
> +				 const char *buf, size_t count)
>  {
>  	struct dcon_priv *dcon = dev_get_drvdata(dev);
>  	unsigned long output;
> @@ -474,7 +481,8 @@ static ssize_t dcon_freeze_store(struct device *dev,
>  }
>  
>  static ssize_t dcon_resumeline_store(struct device *dev,
> -	struct device_attribute *attr, const char *buf, size_t count)
> +				     struct device_attribute *attr,
> +				     const char *buf, size_t count)
>  {
>  	unsigned short rl;
>  	int rc;
> @@ -490,7 +498,8 @@ static ssize_t dcon_resumeline_store(struct device *dev,
>  }
>  
>  static ssize_t dcon_sleep_store(struct device *dev,
> -	struct device_attribute *attr, const char *buf, size_t count)
> +				struct device_attribute *attr,
> +				const char *buf, size_t count)
>  {
>  	unsigned long output;
>  	int ret;
> @@ -641,7 +650,8 @@ static int dcon_probe(struct i2c_client *client, const struct i2c_device_id *id)
>  	/* Add the backlight device for the DCON */
>  	dcon_bl_props.brightness = dcon->bl_val;
>  	dcon->bl_dev = backlight_device_register("dcon-bl", &dcon_device->dev,
> -		dcon, &dcon_bl_ops, &dcon_bl_props);
> +						 dcon, &dcon_bl_ops,
> +						 &dcon_bl_props);
>  	if (IS_ERR(dcon->bl_dev)) {
>  		dev_err(&client->dev, "cannot register backlight dev (%ld)\n",
>  			PTR_ERR(dcon->bl_dev));
> diff --git a/drivers/staging/olpc_dcon/olpc_dcon.h b/drivers/staging/olpc_dcon/olpc_dcon.h
> index 8fbde5d3b4a6..fa89bb97c7b0 100644
> --- a/drivers/staging/olpc_dcon/olpc_dcon.h
> +++ b/drivers/staging/olpc_dcon/olpc_dcon.h
> @@ -10,18 +10,18 @@
>  #define DCON_REG_ID		 0
>  #define DCON_REG_MODE		 1
>  
> -#define MODE_PASSTHRU	(1<<0)
> -#define MODE_SLEEP	(1<<1)
> -#define MODE_SLEEP_AUTO	(1<<2)
> -#define MODE_BL_ENABLE	(1<<3)
> -#define MODE_BLANK	(1<<4)
> -#define MODE_CSWIZZLE	(1<<5)
> -#define MODE_COL_AA	(1<<6)
> -#define MODE_MONO_LUMA	(1<<7)
> -#define MODE_SCAN_INT	(1<<8)
> -#define MODE_CLOCKDIV	(1<<9)
> -#define MODE_DEBUG	(1<<14)
> -#define MODE_SELFTEST	(1<<15)
> +#define MODE_PASSTHRU	BIT(0)
> +#define MODE_SLEEP	BIT(1)
> +#define MODE_SLEEP_AUTO	BIT(2)
> +#define MODE_BL_ENABLE	BIT(3)
> +#define MODE_BLANK	BIT(4)
> +#define MODE_CSWIZZLE	BIT(5)
> +#define MODE_COL_AA	BIT(6)
> +#define MODE_MONO_LUMA	BIT(7)
> +#define MODE_SCAN_INT	BIT(8)
> +#define MODE_CLOCKDIV	BIT(9)
> +#define MODE_DEBUG	BIT(14)
> +#define MODE_SELFTEST	BIT(15)

This is a different change to the others in this patch. One change per
patch please. (The other change is re-align to match parenthesis).

Also, perhaps you could align all the BIT() calls.

Hope this helps,
Tobin.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-11-22  0:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-20 21:14 [PATCH] Fix style issues in olpc_dcon zebmccorkle
2017-11-22  0:43 ` Tobin C. Harding

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox