diff options
author | Jeremy Kerr <jk@ozlabs.org> | 2006-07-12 01:35:54 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2006-07-31 01:55:04 -0400 |
commit | a7f67bdf2c9f24509b8e81e0f35573b611987c80 (patch) | |
tree | 201662dd6504418ef3c84cfe1f280153a4d8cb29 /arch/powerpc/kernel/rtas-proc.c | |
parent | 4288b92b9644fdb4c6168273873fe08f32090d7a (diff) |
[POWERPC] Constify & voidify get_property()
Now that get_property() returns a void *, there's no need to cast its
return value. Also, treat the return value as const, so we can
constify get_property later.
powerpc core changes.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/kernel/rtas-proc.c')
-rw-r--r-- | arch/powerpc/kernel/rtas-proc.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/arch/powerpc/kernel/rtas-proc.c b/arch/powerpc/kernel/rtas-proc.c index 9c9ad1fa9cce..2fe82abf1c52 100644 --- a/arch/powerpc/kernel/rtas-proc.c +++ b/arch/powerpc/kernel/rtas-proc.c | |||
@@ -246,12 +246,12 @@ struct file_operations ppc_rtas_rmo_buf_ops = { | |||
246 | 246 | ||
247 | static int ppc_rtas_find_all_sensors(void); | 247 | static int ppc_rtas_find_all_sensors(void); |
248 | static void ppc_rtas_process_sensor(struct seq_file *m, | 248 | static void ppc_rtas_process_sensor(struct seq_file *m, |
249 | struct individual_sensor *s, int state, int error, char *loc); | 249 | struct individual_sensor *s, int state, int error, const char *loc); |
250 | static char *ppc_rtas_process_error(int error); | 250 | static char *ppc_rtas_process_error(int error); |
251 | static void get_location_code(struct seq_file *m, | 251 | static void get_location_code(struct seq_file *m, |
252 | struct individual_sensor *s, char *loc); | 252 | struct individual_sensor *s, const char *loc); |
253 | static void check_location_string(struct seq_file *m, char *c); | 253 | static void check_location_string(struct seq_file *m, const char *c); |
254 | static void check_location(struct seq_file *m, char *c); | 254 | static void check_location(struct seq_file *m, const char *c); |
255 | 255 | ||
256 | static int __init proc_rtas_init(void) | 256 | static int __init proc_rtas_init(void) |
257 | { | 257 | { |
@@ -446,11 +446,11 @@ static int ppc_rtas_sensors_show(struct seq_file *m, void *v) | |||
446 | for (i=0; i<sensors.quant; i++) { | 446 | for (i=0; i<sensors.quant; i++) { |
447 | struct individual_sensor *p = &sensors.sensor[i]; | 447 | struct individual_sensor *p = &sensors.sensor[i]; |
448 | char rstr[64]; | 448 | char rstr[64]; |
449 | char *loc; | 449 | const char *loc; |
450 | int llen, offs; | 450 | int llen, offs; |
451 | 451 | ||
452 | sprintf (rstr, SENSOR_PREFIX"%04d", p->token); | 452 | sprintf (rstr, SENSOR_PREFIX"%04d", p->token); |
453 | loc = (char *) get_property(rtas_node, rstr, &llen); | 453 | loc = get_property(rtas_node, rstr, &llen); |
454 | 454 | ||
455 | /* A sensor may have multiple instances */ | 455 | /* A sensor may have multiple instances */ |
456 | for (j = 0, offs = 0; j <= p->quant; j++) { | 456 | for (j = 0, offs = 0; j <= p->quant; j++) { |
@@ -474,10 +474,10 @@ static int ppc_rtas_sensors_show(struct seq_file *m, void *v) | |||
474 | 474 | ||
475 | static int ppc_rtas_find_all_sensors(void) | 475 | static int ppc_rtas_find_all_sensors(void) |
476 | { | 476 | { |
477 | unsigned int *utmp; | 477 | const unsigned int *utmp; |
478 | int len, i; | 478 | int len, i; |
479 | 479 | ||
480 | utmp = (unsigned int *) get_property(rtas_node, "rtas-sensors", &len); | 480 | utmp = get_property(rtas_node, "rtas-sensors", &len); |
481 | if (utmp == NULL) { | 481 | if (utmp == NULL) { |
482 | printk (KERN_ERR "error: could not get rtas-sensors\n"); | 482 | printk (KERN_ERR "error: could not get rtas-sensors\n"); |
483 | return 1; | 483 | return 1; |
@@ -530,7 +530,7 @@ static char *ppc_rtas_process_error(int error) | |||
530 | */ | 530 | */ |
531 | 531 | ||
532 | static void ppc_rtas_process_sensor(struct seq_file *m, | 532 | static void ppc_rtas_process_sensor(struct seq_file *m, |
533 | struct individual_sensor *s, int state, int error, char *loc) | 533 | struct individual_sensor *s, int state, int error, const char *loc) |
534 | { | 534 | { |
535 | /* Defined return vales */ | 535 | /* Defined return vales */ |
536 | const char * key_switch[] = { "Off\t", "Normal\t", "Secure\t", | 536 | const char * key_switch[] = { "Off\t", "Normal\t", "Secure\t", |
@@ -682,7 +682,7 @@ static void ppc_rtas_process_sensor(struct seq_file *m, | |||
682 | 682 | ||
683 | /* ****************************************************************** */ | 683 | /* ****************************************************************** */ |
684 | 684 | ||
685 | static void check_location(struct seq_file *m, char *c) | 685 | static void check_location(struct seq_file *m, const char *c) |
686 | { | 686 | { |
687 | switch (c[0]) { | 687 | switch (c[0]) { |
688 | case LOC_PLANAR: | 688 | case LOC_PLANAR: |
@@ -719,7 +719,7 @@ static void check_location(struct seq_file *m, char *c) | |||
719 | * ${LETTER}${NUMBER}[[-/]${LETTER}${NUMBER} [ ... ] ] | 719 | * ${LETTER}${NUMBER}[[-/]${LETTER}${NUMBER} [ ... ] ] |
720 | * the '.' may be an abbrevation | 720 | * the '.' may be an abbrevation |
721 | */ | 721 | */ |
722 | static void check_location_string(struct seq_file *m, char *c) | 722 | static void check_location_string(struct seq_file *m, const char *c) |
723 | { | 723 | { |
724 | while (*c) { | 724 | while (*c) { |
725 | if (isalpha(*c) || *c == '.') | 725 | if (isalpha(*c) || *c == '.') |
@@ -733,7 +733,8 @@ static void check_location_string(struct seq_file *m, char *c) | |||
733 | 733 | ||
734 | /* ****************************************************************** */ | 734 | /* ****************************************************************** */ |
735 | 735 | ||
736 | static void get_location_code(struct seq_file *m, struct individual_sensor *s, char *loc) | 736 | static void get_location_code(struct seq_file *m, struct individual_sensor *s, |
737 | const char *loc) | ||
737 | { | 738 | { |
738 | if (!loc || !*loc) { | 739 | if (!loc || !*loc) { |
739 | seq_printf(m, "---");/* does not have a location */ | 740 | seq_printf(m, "---");/* does not have a location */ |