]> git.hungrycats.org Git - linux/commitdiff
[PATCH] ppc64: Fix compiler warnings, from Olof Johansson
authorAndrew Morton <akpm@osdl.org>
Thu, 5 Feb 2004 05:19:11 +0000 (21:19 -0800)
committerLinus Torvalds <torvalds@home.osdl.org>
Thu, 5 Feb 2004 05:19:11 +0000 (21:19 -0800)
From: anton@samba.org

Fix compiler warnings, from Olof Johansson

arch/ppc64/kernel/lparcfg.c
arch/ppc64/kernel/rtas-proc.c

index 7ff67beec3665a9c0ec55857257ab6ee4451eb29..c773ae5a6adda72596b4ec8fd4f501996a5f4a0b 100644 (file)
@@ -331,7 +331,7 @@ static int lparcfg_data(unsigned char *buf, unsigned long size)
        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 *buf, unsigned long size)
 
        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);
index a31e226d04f2698c2bc488a485b89ff74bfd4c7c..074596c6a9f5459088e8b1ac160f80e94e4879a7 100644 (file)
@@ -285,13 +285,13 @@ static ssize_t ppc_rtas_poweron_read(struct file * file, char * buf,
                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(struct file * file, const char * buf,
 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(struct file * file, char * buf,
 {
        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(struct file * file, char * buf,
        }
        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(struct file * file, const char * buf,
 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_write(struct file * file, const char * buf,
 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)