From: anton@samba.org Fix compiler warnings, from Olof Johansson --- --- arch/ppc64/kernel/lparcfg.c | 10 +++++----- arch/ppc64/kernel/rtas-proc.c | 28 +++++++++++++++------------- 2 files changed, 20 insertions(+), 18 deletions(-) diff -puN arch/ppc64/kernel/lparcfg.c~ppc64-compile-warnings arch/ppc64/kernel/lparcfg.c --- 25/arch/ppc64/kernel/lparcfg.c~ppc64-compile-warnings 2004-02-04 00:11:55.000000000 -0800 +++ 25-akpm/arch/ppc64/kernel/lparcfg.c 2004-02-04 00:11:55.000000000 -0800 @@ -331,7 +331,7 @@ static int lparcfg_data(unsigned char *b if (cur_cpu_spec->firmware_features & FW_FEATURE_SPLPAR) { system_potential_processors = get_splpar_potential_characteristics(); n += snprintf(buf+n, LPARCFG_BUFF_SIZE - n, - "system_active_processors=%d\n", + "system_active_processors=%ld\n", (h_resource >> 2*8) & 0xffff); n += snprintf(buf+n, LPARCFG_BUFF_SIZE - n, "system_potential_processors=%d\n", @@ -373,16 +373,16 @@ static int lparcfg_data(unsigned char *b if (cur_cpu_spec->firmware_features & FW_FEATURE_SPLPAR) { n += snprintf(buf+n, LPARCFG_BUFF_SIZE - n, - "pool=%d\n", (h_aggregation >> 0*8)&0xffff); + "pool=%ld\n", (h_aggregation >> 0*8)&0xffff); n += snprintf(buf+n, LPARCFG_BUFF_SIZE - n, - "pool_capacity=%d\n", (h_resource >> 3*8) &0xffff); + "pool_capacity=%ld\n", (h_resource >> 3*8) &0xffff); n += snprintf(buf+n, LPARCFG_BUFF_SIZE - n, - "group=%d\n", (h_aggregation >> 2*8)&0xffff); + "group=%ld\n", (h_aggregation >> 2*8)&0xffff); n += snprintf(buf+n, LPARCFG_BUFF_SIZE - n, - "capped=%d\n", (h_resource >> 6*8)&0x40); + "capped=%ld\n", (h_resource >> 6*8)&0x40); n += snprintf(buf+n, LPARCFG_BUFF_SIZE - n, "capacity_weight=%d\n", (int)(h_resource>>5*8)&0xFF); diff -puN arch/ppc64/kernel/rtas-proc.c~ppc64-compile-warnings arch/ppc64/kernel/rtas-proc.c --- 25/arch/ppc64/kernel/rtas-proc.c~ppc64-compile-warnings 2004-02-04 00:11:55.000000000 -0800 +++ 25-akpm/arch/ppc64/kernel/rtas-proc.c 2004-02-04 00:11:55.000000000 -0800 @@ -285,13 +285,13 @@ static ssize_t ppc_rtas_poweron_read(str size_t count, loff_t *ppos) { char stkbuf[40]; /* its small, its on stack */ - int n; + int n, sn; if (power_on_time == 0) n = snprintf(stkbuf, 40, "Power on time not set\n"); else n = snprintf(stkbuf, 40, "%lu\n", power_on_time); - int sn = strlen (stkbuf) +1; + sn = strlen (stkbuf) +1; if (*ppos >= sn) return 0; if (n > sn - *ppos) @@ -331,18 +331,19 @@ static ssize_t ppc_rtas_progress_write(s static ssize_t ppc_rtas_progress_read(struct file * file, char * buf, size_t count, loff_t *ppos) { - int n = 0; + int sn, n = 0; + char *tmpbuf; if (progress_led == NULL) return 0; - char * tmpbuf = kmalloc (MAX_LINELENGTH, GFP_KERNEL); + tmpbuf = kmalloc (MAX_LINELENGTH, GFP_KERNEL); if (!tmpbuf) { printk(KERN_ERR "error: kmalloc failed\n"); return -ENOMEM; } n = sprintf (tmpbuf, "%s\n", progress_led); - int sn = strlen (tmpbuf) +1; + sn = strlen (tmpbuf) +1; if (*ppos >= sn) { kfree (tmpbuf); return 0; @@ -398,15 +399,14 @@ static ssize_t ppc_rtas_clock_read(struc { unsigned int year, mon, day, hour, min, sec; unsigned long *ret = kmalloc(4*8, GFP_KERNEL); - int n, error; + int n, sn, error; + char stkbuf[40]; /* its small, its on stack */ error = rtas_call(rtas_token("get-time-of-day"), 0, 8, ret); year = ret[0]; mon = ret[1]; day = ret[2]; hour = ret[3]; min = ret[4]; sec = ret[5]; - char stkbuf[40]; /* its small, its on stack */ - if (error != 0){ printk(KERN_WARNING "error: reading the clock returned: %s\n", ppc_rtas_process_error(error)); @@ -416,7 +416,7 @@ static ssize_t ppc_rtas_clock_read(struc } kfree(ret); - int sn = strlen (stkbuf) +1; + sn = strlen (stkbuf) +1; if (*ppos >= sn) return 0; if (n > sn - *ppos) @@ -860,11 +860,12 @@ static ssize_t ppc_rtas_tone_freq_write( static ssize_t ppc_rtas_tone_freq_read(struct file * file, char * buf, size_t count, loff_t *ppos) { - int n; + int n, sn; char stkbuf[40]; /* its small, its on stack */ + n = snprintf(stkbuf, 40, "%lu\n", rtas_tone_frequency); - int sn = strlen (stkbuf) +1; + sn = strlen (stkbuf) +1; if (*ppos >= sn) return 0; if (n > sn - *ppos) @@ -913,11 +914,12 @@ static ssize_t ppc_rtas_tone_volume_writ static ssize_t ppc_rtas_tone_volume_read(struct file * file, char * buf, size_t count, loff_t *ppos) { - int n; + int n, sn; char stkbuf[40]; /* its small, its on stack */ + n = snprintf(stkbuf, 40, "%lu\n", rtas_tone_volume); - int sn = strlen (stkbuf) +1; + sn = strlen (stkbuf) +1; if (*ppos >= sn) return 0; if (n > sn - *ppos) _