various: fixes size_t args in some printks
Subsystems (5)
PATCH 1/1 various: fixes size_t args in some printks
Compiling with gcc-3.3.6, I get some printf format warnings. This patch against linux-2.6.15-rc7-git3, fixes a few %d's that need to be %zu's in various printk's.
Signed-off-by Kees Cook <[email protected]>
---
drivers/media/dvb/frontends/bcm3510.c +2 -2
@@ -623,13 +623,13 @@ static int bcm3510_download_firmware(strerr ("could not load firmware (%s): %d" ,BCM3510_DEFAULT_FIRMWARE ,ret);return ret; } -deb_info ("got firmware: %d\n" ,fw->size); +deb_info ("got firmware: %zu\n" ,fw->size); b = fw->data;for (i =0 ; i < fw->size;) { addr =le16_to_cpu ( *( (u16 *)&b[i] ) ); len =le16_to_cpu ( *( (u16 *)&b[i+2 ] ) ); -deb_info ("firmware chunk, addr: 0x%04x, len: 0x%04x, total length: 0x%04x\n" ,addr,len,fw->size); +deb_info ("firmware chunk, addr: 0x%04x, len: 0x%04x, total length: 0x%04zx\n" ,addr,len,fw->size);if ((ret =bcm3510_write_ram (st,addr,&b[i+4 ],len)) <0 ) {err ("firmware download failed: %d\n" ,ret);return ret;
drivers/media/dvb/frontends/or51211.c +1 -1
@@ -112,7 +112,7 @@ static int or51211_load_firmware (structu8 tudata[585 ];int i; -dprintk ("Firmware is %d bytes\n" ,fw->size); +dprintk ("Firmware is %zu bytes\n" ,fw->size);/* Get eprom data */ tudata[0 ] =17 ;
drivers/parport/parport_serial.c +1 -1
@@ -329,7 +329,7 @@ static int __devinit parport_register (sif (priv->num_par ==ARRAY_SIZE (priv->port)) {printk (KERN_WARNING -"parport_serial: %s: only %u parallel ports " +"parport_serial: %s: only %zu parallel ports " "supported (%d reported)\n" ,pci_name (dev),ARRAY_SIZE (priv->port), card->numports);break ;
fs/jffs2/readinode.c +3 -3
@@ -204,7 +204,7 @@ static inline int read_dnode(struct jffs tn =jffs2_alloc_tmp_dnode_info ();if (!tn) { -JFFS2_ERROR ("failed to allocate tn (%d bytes).\n" ,sizeof (*tn)); +JFFS2_ERROR ("failed to allocate tn (%zu bytes).\n" ,sizeof (*tn));return -ENOMEM ; }
@@ -434,7 +434,7 @@ static int read_more(struct jffs2_sb_inf }if (retlen < len) { -JFFS2_ERROR ("short read at %#08x: %d instead of %d.\n" , +JFFS2_ERROR ("short read at %#08x: %zu instead of %d.\n" , offs, retlen, len);return -EIO ; }
@@ -542,7 +542,7 @@ static int jffs2_get_inode_nodes(struct }if (retlen < len) { -JFFS2_ERROR ("short read at %#08x: %d instead of %d.\n" ,ref_offset (ref), retlen, len); +JFFS2_ERROR ("short read at %#08x: %zu instead of %d.\n" ,ref_offset (ref), retlen, len); err = -EIO ; goto free_out; }
sound/pci/rme9652/hdspm.c +3 -3
@@ -3327,11 +3327,11 @@ static int __devinit snd_hdspm_prealloca snd_dma_pci_data(hdspm->pci), wanted, wanted)) < 0) { -snd_printdd ("Could not preallocate %d Bytes\n" , wanted); +snd_printdd ("Could not preallocate %zu Bytes\n" , wanted);return err; } else - snd_printdd(" Preallocated %d Bytes\n", wanted); + snd_printdd(" Preallocated %zu Bytes\n", wanted);return 0 ; }
@@ -3522,7 +3522,7 @@ static int __devinit snd_hdspm_create(sn hdspm->monitor_outs = enable_monitor; -snd_printdd ("kmalloc Mixer memory of %d Bytes\n" , +snd_printdd ("kmalloc Mixer memory of %zu Bytes\n" ,sizeof (hdspm_mixer_t));if ((hdspm->mixer = (hdspm_mixer_t *) kmalloc(sizeof(hdspm_mixer_t), GFP_KERNEL))
Signature · 1 line
Kees Cook @outflux.net
_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/kernel-janitors