diff mbox

mfd: axp20x: Remove unnecessary const qualifier from axp20x_supplies[]

Message ID 1400750311-15323-2-git-send-email-lee.jones@linaro.org
State New
Headers show

Commit Message

Lee Jones May 22, 2014, 9:18 a.m. UTC
drivers/mfd/axp20x.c:159:3:
  warning: initialization discards ‘const’ qualifier from pointer target type
   .parent_supplies = axp20x_supplies,
   ^
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/mfd/axp20x.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Joe Perches May 22, 2014, 3:59 p.m. UTC | #1
On Thu, 2014-05-22 at 10:18 +0100, Lee Jones wrote:
> drivers/mfd/axp20x.c:159:3:
>   warning: initialization discards ‘const’ qualifier from pointer target type
>    .parent_supplies = axp20x_supplies,
[]
> diff --git a/drivers/mfd/axp20x.c b/drivers/mfd/axp20x.c
[]
> @@ -140,7 +140,7 @@ static const struct regmap_irq_chip axp20x_regmap_irq_chip = {
>  	.init_ack_masked	= true,
>  };
>  
> -static const char * const axp20x_supplies[] = {
> +static const char * axp20x_supplies[] = {
>  	"acin",
>  	"vin2",
>  	"vin3",

Perhaps you're doing this the wrong way round.
Maybe this definition should change.

include/linux/mfd/core.h:       const char              **parent_supplies;


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
Lee Jones May 22, 2014, 4:08 p.m. UTC | #2
> > drivers/mfd/axp20x.c:159:3:
> >   warning: initialization discards ‘const’ qualifier from pointer target type
> >    .parent_supplies = axp20x_supplies,
> []
> > diff --git a/drivers/mfd/axp20x.c b/drivers/mfd/axp20x.c
> []
> > @@ -140,7 +140,7 @@ static const struct regmap_irq_chip axp20x_regmap_irq_chip = {
> >  	.init_ack_masked	= true,
> >  };
> >  
> > -static const char * const axp20x_supplies[] = {
> > +static const char * axp20x_supplies[] = {
> >  	"acin",
> >  	"vin2",
> >  	"vin3",
> 
> Perhaps you're doing this the wrong way round.
> Maybe this definition should change.
> 
> include/linux/mfd/core.h:       const char              **parent_supplies;

Are you asking me, or telling me? :)

To be frank, I've never known what the double const means.  Care to
enlighten?
Joe Perches May 22, 2014, 4:45 p.m. UTC | #3
On Thu, 2014-05-22 at 17:08 +0100, Lee Jones wrote:
> To be frank, I've never known what the double const means.  Care to
> enlighten?

There's a nice table here:

http://stackoverflow.com/questions/14562845/why-does-passing-char-as-const-char-generate-a-warning


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
Lee Jones May 23, 2014, 11:43 a.m. UTC | #4
> > To be frank, I've never known what the double const means.  Care to
> > enlighten?
> 
> There's a nice table here:
> 
> http://stackoverflow.com/questions/14562845/why-does-passing-char-as-const-char-generate-a-warning

Okay, I get it. I think you're right, I'll make the change and see
what else breaks and try to fix that too.
diff mbox

Patch

diff --git a/drivers/mfd/axp20x.c b/drivers/mfd/axp20x.c
index dee6539..5734f8c 100644
--- a/drivers/mfd/axp20x.c
+++ b/drivers/mfd/axp20x.c
@@ -140,7 +140,7 @@  static const struct regmap_irq_chip axp20x_regmap_irq_chip = {
 	.init_ack_masked	= true,
 };
 
-static const char * const axp20x_supplies[] = {
+static const char * axp20x_supplies[] = {
 	"acin",
 	"vin2",
 	"vin3",