Skip to content

Commit

Permalink
powerpc/windfarm: don't pass const strings to snprintf
Browse files Browse the repository at this point in the history
Fixes these build warnings:

drivers/macintosh/windfarm_smu_sat.c: In function 'wf_sat_probe':
drivers/macintosh/windfarm_smu_sat.c:290:3: warning: passing argument 1 of 'snprintf' discards qualifiers from pointer target type
include/linux/kernel.h:323:5: note: expected 'char *' but argument is of type 'const char *'
drivers/macintosh/windfarm_smu_sat.c:317:3: warning: passing argument 1 of 'snprintf' discards qualifiers from pointer target type
include/linux/kernel.h:323:5: note: expected 'char *' but argument is of type 'const char *'

Introduced by commit e074d08 ("powerpc/windfarm: const'ify and add
"priv" field to controls & sensors").

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
  • Loading branch information
Stephen Rothwell authored and Benjamin Herrenschmidt committed May 3, 2012
1 parent ca7d593 commit 43671cc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/macintosh/windfarm_smu_sat.c
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ static int wf_sat_probe(struct i2c_client *client,
sens->sat = sat;
sens->sens.ops = &wf_sat_ops;
sens->sens.name = (char *) (sens + 1);
snprintf(sens->sens.name, 16, "%s-%d", name, cpu);
snprintf((char *)sens->sens.name, 16, "%s-%d", name, cpu);

if (wf_register_sensor(&sens->sens))
kfree(sens);
Expand All @@ -314,7 +314,7 @@ static int wf_sat_probe(struct i2c_client *client,
sens->sat = sat;
sens->sens.ops = &wf_sat_ops;
sens->sens.name = (char *) (sens + 1);
snprintf(sens->sens.name, 16, "cpu-power-%d", cpu);
snprintf((char *)sens->sens.name, 16, "cpu-power-%d", cpu);

if (wf_register_sensor(&sens->sens))
kfree(sens);
Expand Down

0 comments on commit 43671cc

Please sign in to comment.