All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] twl4030_charger: fix warnings
@ 2011-06-03 11:43 ` Grazvydas Ignotas
  0 siblings, 0 replies; 3+ messages in thread
From: Grazvydas Ignotas @ 2011-06-03 11:43 UTC (permalink / raw)
  To: Anton Vorontsov; +Cc: linux-omap, linux-kernel, Grazvydas Ignotas

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 2177 bytes --]

Fix warnings emitted by some versions of gcc:
drivers/power/twl4030_charger.c:490: warning: overflow in implicit constant conversion
drivers/power/twl4030_charger.c:498: warning: overflow in implicit constant conversion

While at it, also fix module_param permissions and a typo in my name.

Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
---
 drivers/power/twl4030_charger.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/power/twl4030_charger.c b/drivers/power/twl4030_charger.c
index 92c16e1..54b9198 100644
--- a/drivers/power/twl4030_charger.c
+++ b/drivers/power/twl4030_charger.c
@@ -62,7 +62,7 @@
 #define TWL4030_MSTATEC_COMPLETE4	0x0e
 
 static bool allow_usb;
-module_param(allow_usb, bool, 1);
+module_param(allow_usb, bool, 0644);
 MODULE_PARM_DESC(allow_usb, "Allow USB charge drawing default current");
 
 struct twl4030_bci {
@@ -425,7 +425,7 @@ static int __init twl4030_bci_probe(struct platform_device *pdev)
 {
 	struct twl4030_bci *bci;
 	int ret;
-	int reg;
+	u32 reg;
 
 	bci = kzalloc(sizeof(*bci), GFP_KERNEL);
 	if (bci == NULL)
@@ -486,7 +486,7 @@ static int __init twl4030_bci_probe(struct platform_device *pdev)
 	}
 
 	/* Enable interrupts now. */
-	reg = ~(TWL4030_ICHGLOW | TWL4030_ICHGEOC | TWL4030_TBATOR2 |
+	reg = ~(u32)(TWL4030_ICHGLOW | TWL4030_ICHGEOC | TWL4030_TBATOR2 |
 		TWL4030_TBATOR1 | TWL4030_BATSTS);
 	ret = twl_i2c_write_u8(TWL4030_MODULE_INTERRUPTS, reg,
 			       TWL4030_INTERRUPTS_BCIIMR1A);
@@ -495,7 +495,7 @@ static int __init twl4030_bci_probe(struct platform_device *pdev)
 		goto fail_unmask_interrupts;
 	}
 
-	reg = ~(TWL4030_VBATOV | TWL4030_VBUSOV | TWL4030_ACCHGOV);
+	reg = ~(u32)(TWL4030_VBATOV | TWL4030_VBUSOV | TWL4030_ACCHGOV);
 	ret = twl_i2c_write_u8(TWL4030_MODULE_INTERRUPTS, reg,
 			       TWL4030_INTERRUPTS_BCIIMR2A);
 	if (ret < 0)
@@ -572,7 +572,7 @@ static void __exit twl4030_bci_exit(void)
 }
 module_exit(twl4030_bci_exit);
 
-MODULE_AUTHOR("Gražydas Ignotas");
+MODULE_AUTHOR("Gražvydas Ignotas");
 MODULE_DESCRIPTION("TWL4030 Battery Charger Interface driver");
 MODULE_LICENSE("GPL");
 MODULE_ALIAS("platform:twl4030_bci");
-- 
1.7.0.4


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

* [PATCH] twl4030_charger: fix warnings
@ 2011-06-03 11:43 ` Grazvydas Ignotas
  0 siblings, 0 replies; 3+ messages in thread
From: Grazvydas Ignotas @ 2011-06-03 11:43 UTC (permalink / raw)
  To: Anton Vorontsov; +Cc: linux-omap, linux-kernel, Grazvydas Ignotas

Fix warnings emitted by some versions of gcc:
drivers/power/twl4030_charger.c:490: warning: overflow in implicit constant conversion
drivers/power/twl4030_charger.c:498: warning: overflow in implicit constant conversion

While at it, also fix module_param permissions and a typo in my name.

Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
---
 drivers/power/twl4030_charger.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/power/twl4030_charger.c b/drivers/power/twl4030_charger.c
index 92c16e1..54b9198 100644
--- a/drivers/power/twl4030_charger.c
+++ b/drivers/power/twl4030_charger.c
@@ -62,7 +62,7 @@
 #define TWL4030_MSTATEC_COMPLETE4	0x0e
 
 static bool allow_usb;
-module_param(allow_usb, bool, 1);
+module_param(allow_usb, bool, 0644);
 MODULE_PARM_DESC(allow_usb, "Allow USB charge drawing default current");
 
 struct twl4030_bci {
@@ -425,7 +425,7 @@ static int __init twl4030_bci_probe(struct platform_device *pdev)
 {
 	struct twl4030_bci *bci;
 	int ret;
-	int reg;
+	u32 reg;
 
 	bci = kzalloc(sizeof(*bci), GFP_KERNEL);
 	if (bci == NULL)
@@ -486,7 +486,7 @@ static int __init twl4030_bci_probe(struct platform_device *pdev)
 	}
 
 	/* Enable interrupts now. */
-	reg = ~(TWL4030_ICHGLOW | TWL4030_ICHGEOC | TWL4030_TBATOR2 |
+	reg = ~(u32)(TWL4030_ICHGLOW | TWL4030_ICHGEOC | TWL4030_TBATOR2 |
 		TWL4030_TBATOR1 | TWL4030_BATSTS);
 	ret = twl_i2c_write_u8(TWL4030_MODULE_INTERRUPTS, reg,
 			       TWL4030_INTERRUPTS_BCIIMR1A);
@@ -495,7 +495,7 @@ static int __init twl4030_bci_probe(struct platform_device *pdev)
 		goto fail_unmask_interrupts;
 	}
 
-	reg = ~(TWL4030_VBATOV | TWL4030_VBUSOV | TWL4030_ACCHGOV);
+	reg = ~(u32)(TWL4030_VBATOV | TWL4030_VBUSOV | TWL4030_ACCHGOV);
 	ret = twl_i2c_write_u8(TWL4030_MODULE_INTERRUPTS, reg,
 			       TWL4030_INTERRUPTS_BCIIMR2A);
 	if (ret < 0)
@@ -572,7 +572,7 @@ static void __exit twl4030_bci_exit(void)
 }
 module_exit(twl4030_bci_exit);
 
-MODULE_AUTHOR("Gražydas Ignotas");
+MODULE_AUTHOR("Gražvydas Ignotas");
 MODULE_DESCRIPTION("TWL4030 Battery Charger Interface driver");
 MODULE_LICENSE("GPL");
 MODULE_ALIAS("platform:twl4030_bci");
-- 
1.7.0.4

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

* Re: [PATCH] twl4030_charger: fix warnings
  2011-06-03 11:43 ` Grazvydas Ignotas
  (?)
@ 2011-07-08 13:08 ` Anton Vorontsov
  -1 siblings, 0 replies; 3+ messages in thread
From: Anton Vorontsov @ 2011-07-08 13:08 UTC (permalink / raw)
  To: Grazvydas Ignotas; +Cc: linux-omap, linux-kernel, Jean Delvare

On Fri, Jun 03, 2011 at 02:43:11PM +0300, Grazvydas Ignotas wrote:
> Fix warnings emitted by some versions of gcc:
> drivers/power/twl4030_charger.c:490: warning: overflow in implicit constant conversion
> drivers/power/twl4030_charger.c:498: warning: overflow in implicit constant conversion
> 
> While at it, also fix module_param permissions and a typo in my name.
> 
> Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
> ---

Applied, thanks.

I also added Jean's sign-off for the module_param persmissions
fix.

>  drivers/power/twl4030_charger.c |   10 +++++-----
>  1 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/power/twl4030_charger.c b/drivers/power/twl4030_charger.c
> index 92c16e1..54b9198 100644
> --- a/drivers/power/twl4030_charger.c
> +++ b/drivers/power/twl4030_charger.c
> @@ -62,7 +62,7 @@
>  #define TWL4030_MSTATEC_COMPLETE4	0x0e
>  
>  static bool allow_usb;
> -module_param(allow_usb, bool, 1);
> +module_param(allow_usb, bool, 0644);
>  MODULE_PARM_DESC(allow_usb, "Allow USB charge drawing default current");
>  
>  struct twl4030_bci {
> @@ -425,7 +425,7 @@ static int __init twl4030_bci_probe(struct platform_device *pdev)
>  {
>  	struct twl4030_bci *bci;
>  	int ret;
> -	int reg;
> +	u32 reg;
>  
>  	bci = kzalloc(sizeof(*bci), GFP_KERNEL);
>  	if (bci == NULL)
> @@ -486,7 +486,7 @@ static int __init twl4030_bci_probe(struct platform_device *pdev)
>  	}
>  
>  	/* Enable interrupts now. */
> -	reg = ~(TWL4030_ICHGLOW | TWL4030_ICHGEOC | TWL4030_TBATOR2 |
> +	reg = ~(u32)(TWL4030_ICHGLOW | TWL4030_ICHGEOC | TWL4030_TBATOR2 |
>  		TWL4030_TBATOR1 | TWL4030_BATSTS);
>  	ret = twl_i2c_write_u8(TWL4030_MODULE_INTERRUPTS, reg,
>  			       TWL4030_INTERRUPTS_BCIIMR1A);
> @@ -495,7 +495,7 @@ static int __init twl4030_bci_probe(struct platform_device *pdev)
>  		goto fail_unmask_interrupts;
>  	}
>  
> -	reg = ~(TWL4030_VBATOV | TWL4030_VBUSOV | TWL4030_ACCHGOV);
> +	reg = ~(u32)(TWL4030_VBATOV | TWL4030_VBUSOV | TWL4030_ACCHGOV);
>  	ret = twl_i2c_write_u8(TWL4030_MODULE_INTERRUPTS, reg,
>  			       TWL4030_INTERRUPTS_BCIIMR2A);
>  	if (ret < 0)
> @@ -572,7 +572,7 @@ static void __exit twl4030_bci_exit(void)
>  }
>  module_exit(twl4030_bci_exit);
>  
> -MODULE_AUTHOR("Gražydas Ignotas");
> +MODULE_AUTHOR("Gražvydas Ignotas");
>  MODULE_DESCRIPTION("TWL4030 Battery Charger Interface driver");
>  MODULE_LICENSE("GPL");
>  MODULE_ALIAS("platform:twl4030_bci");
> -- 
> 1.7.0.4
> 

-- 
Anton Vorontsov
Email: cbouatmailru@gmail.com

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

end of thread, other threads:[~2011-07-08 13:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-03 11:43 [PATCH] twl4030_charger: fix warnings Grazvydas Ignotas
2011-06-03 11:43 ` Grazvydas Ignotas
2011-07-08 13:08 ` Anton Vorontsov

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.