: Cleanup: Remove gcc format string warnings when compiling with -Wformat-security (part 4: remaining cases)
Subsystems (41)
PATCH 1/1 : Cleanup: Remove gcc format string warnings when compiling with -Wformat-security (part 4: remaining cases)
Quoted 5 lines · Floris Kraak
Quoted 4 lines · Floris Kraak
Here's the patch that I get when I blindly patch every single location that emits this warning.
Quoted 8 lines
Quoted 4 lines
If needed I can attempt to split this monster into 135 patches but given my limited experience with the tools involved a little help on how to go about creating such a series would be appreciated ;-)
Here's the first part of a split series of patches dealing with this. I will reply to this message with further patches in the series.
This patch contains everything not covered by the other patches in the series. Most of it should be safe without the modifications but in many cases I'm not intimately familiar enough with the code or simply need to review things further.
I can probably split this thing further; There are a few debug_printk() variants in there and a lot of code that seems to be dealing with driver or module initialization.
(P.S. Apologies for Roland Dreier, I'm sure one day I will figure out how to send a patchbomb series like this without making mistakes in
to: or subject: lines ;-) )
---
[PATCH]: Cleanup: Remove gcc format string warnings when compiling with -Wformat-security (part 4: remaining cases)
When compiling the kernel with an allyesconfig and the gcc flags -Wformat and -Wformat-security the build process emits ~150 warnings along these lines:
init/main.c:557: warning: format not a string literal and no format arguments init/initramfs.c:582: warning: format not a string literal and no format argumentsarch/x86/kernel/dumpstack.c:115: warning: format not a string literal and no format arguments
...
Many of these warnings are harmless - the format string is statically set within the kernel itself and is known to not contain any format qualifiers.
This patch deals with cases where the code is too complex to dismiss concerns out of hand with a cursory review of the code. There may or may not be bugs being fixed here. Well, most likely not.
---
Documentation/vm/slabinfo.c +3 -3
@@ -379,14 +379,14 @@ void show_tracking(struct slabinfo *s)printf ("\n%s: Kernel object allocation\n" , s->name);printf ("-----------------------------------------------------------------------\n" );if (read_slab_obj (s,"alloc_calls" )) -printf (buffer); +printf ("%s" , buffer);else printf ("No Data\n" );printf ("\n%s: Kernel object freeing\n" , s->name);printf ("------------------------------------------------------------------------\n" );if (read_slab_obj (s,"free_calls" )) -printf (buffer); +printf ("%s" , buffer);else printf ("No Data\n" );
@@ -400,7 +400,7 @@ void ops(struct slabinfo *s)if (read_slab_obj (s,"ops" )) {printf ("\n%s: kmem_cache operations\n" , s->name);printf ("--------------------------------------------\n" ); -printf (buffer); +printf ("%s" , buffer); }else printf ("\n%s has no kmem_cache operations\n" , s->name); }
arch/x86/kernel/dumpstack.c +2 -2
@@ -112,7 +112,7 @@ print_context_stack(struct thread_info *tinfo,static void print_trace_warning_symbol (void *data,char *msg,unsigned long symbol) { -printk (data); +printk ("%s" , (char *)data);print_symbol (msg, symbol);printk ("\n" ); }
@@ -134,7 +134,7 @@ static int print_trace_stack(void *data, char *name)static void print_trace_address (void *data,unsigned long addr,int reliable) {touch_nmi_watchdog (); -printk (data); +printk ("%s" , (char *)data);printk_address (addr, reliable); }
crypto/algapi.c +0 -0
@@ -428,7 +428,8 @@ static struct crypto_template
*__crypto_lookup_template(const char *name)
struct crypto_template *crypto_lookup_template(const char *name) {
- return try_then_request_module(__crypto_lookup_template(name), name);
+ return try_then_request_module(__crypto_lookup_template(name),
+ "%s", name);
}
EXPORT_SYMBOL_GPL(crypto_lookup_template);
crypto/api.c +0 -0
@@ -216,7 +216,7 @@ struct crypto_alg *crypto_larval_lookup(const char
*name, u32 type, u32 mask)
type &= mask;
alg = try_then_request_module(crypto_alg_lookup(name, type, mask),
- name);
+ "%s", name);
if (alg)
return crypto_is_larval(alg) ? crypto_larval_wait(alg) : alg;
crypto/cryptd.c +0 -0
@@ -544,7 +544,7 @@ static inline int cryptd_create_thread(struct
cryptd_state *state,
mutex_init(&state->mutex); crypto_init_queue(&state->queue, CRYPTD_MAX_QLEN);
- state->task = kthread_run(fn, state, name);
+ state->task = kthread_run(fn, state, "%s", name);
if (IS_ERR(state->task))
return PTR_ERR(state->task);
drivers/atm/iphase.c +1 -1
@@ -979,7 +979,7 @@ static void xdump( u_char* cp, int length, char* prefix ) }sprintf ( pBuf,"\n" );// SPrint(prntBuf); -printk (prntBuf); +printk ("%s" , prntBuf); count += col; pBuf = prntBuf; }
(quoted diff) +0 -0
b/drivers/base/attribute_container.c
index b9cda05..e0f7859 100644
drivers/base/attribute_container.c +1 -1
@@ -167,7 +167,7 @@ attribute_container_add_device(struct device *dev, ic->classdev.parent =get_device (dev); ic->classdev.class = cont->class; cont->class->dev_release = attribute_container_release; -dev_set_name (&ic->classdev,dev_name (dev)); +dev_set_name (&ic->classdev,"%s" ,dev_name (dev));if (fn)fn (cont, dev, &ic->classdev);else
drivers/base/core.c +0 -0
@@ -1247,7 +1247,7 @@ struct device *__root_device_register(const char
*name, struct module *owner)
if (!root)
return ERR_PTR(err);
- err = dev_set_name(&root->dev, name);
+ err = dev_set_name(&root->dev, "%s", name);
if (err) {
kfree(root);
return ERR_PTR(err);
drivers/base/firmware_class.c +0 -0
@@ -315,7 +315,7 @@ static int fw_register_device(struct device
**dev_p, const char *fw_name,
fw_priv->timeout.data = (u_long) fw_priv;
init_timer(&fw_priv->timeout);
- dev_set_name(f_dev, dev_name(device));
+ dev_set_name(f_dev, "%s", dev_name(device));
f_dev->parent = device;
f_dev->class = &firmware_class;
dev_set_drvdata(f_dev, fw_priv);
drivers/base/platform.c +1 -1
@@ -244,7 +244,7 @@ int platform_device_add(struct platform_device *pdev)if (pdev->id !=-1 )dev_set_name (&pdev->dev,"%s.%d" , pdev->name, pdev->id);else -dev_set_name (&pdev->dev, pdev->name); +dev_set_name (&pdev->dev,"%s" , pdev->name);for (i =0 ; i < pdev->num_resources; i++) {struct resource *p, *r = &pdev->resource[i];
drivers/base/sys.c +1 -1
@@ -137,7 +137,7 @@ int sysdev_class_register(struct sysdev_class * cls) cls->kset.kobj.parent = &system_kset->kobj; cls->kset.kobj.ktype = &ktype_sysdev_class; cls->kset.kobj.kset = system_kset; -kobject_set_name (&cls->kset.kobj, cls->name); +kobject_set_name (&cls->kset.kobj,"%s" , cls->name);return kset_register (&cls->kset); }
drivers/block/aoe/aoechr.c +1 -1
@@ -286,7 +286,7 @@ aoechr_init(void)for (i =0 ; i <ARRAY_SIZE (chardevs); ++i)device_create (aoe_class,NULL ,MKDEV (AOE_MAJOR , chardevs[i].minor),NULL , - chardevs[i].name); +"%s" , chardevs[i].name);return 0 ; }
drivers/block/nbd.c +0 -0
@@ -654,7 +654,8 @@ static int nbd_ioctl(struct block_device *bdev,
fmode_t mode,
return -EBUSY;
if (!lo->file)
return -EINVAL;
- thread = kthread_create(nbd_thread, lo, lo->disk->disk_name);
+ thread = kthread_create(nbd_thread, lo,
+ "%s", lo->disk->disk_name);
if (IS_ERR(thread))
return PTR_ERR(thread);
wake_up_process(thread);
drivers/char/mem.c +1 -1
@@ -991,7 +991,7 @@ static int __init chr_dev_init(void)for (i =0 ; i <ARRAY_SIZE (devlist); i++)device_create (mem_class,NULL ,MKDEV (MEM_MAJOR , devlist[i].minor),NULL , - devlist[i].name); +"%s" , devlist[i].name);return 0 ; }
drivers/char/tty_io.c +0 -0
@@ -2847,7 +2847,7 @@ struct device *tty_register_device(struct
tty_driver *driver, unsigned index,
else
tty_line_name(driver, index, name);
- return device_create(tty_class, device, dev, NULL, name);
+ return device_create(tty_class, device, dev, NULL, "%s", name);
}
EXPORT_SYMBOL(tty_register_device);
drivers/cpufreq/cpufreq.c +0 -0
@@ -241,7 +241,7 @@ void cpufreq_debug_printk(unsigned int type, const
char *prefix,
len += vsnprintf(&s[len], (256 - len), fmt, args); va_end(args);
- printk(s);
+ printk("%s", s);
WARN_ON(len < 5);
}
drivers/hwmon/adt7470.c +1 -1
@@ -1292,7 +1292,7 @@ static int adt7470_probe(struct i2c_client *client,init_completion (&data->auto_update_stop); data->auto_update =kthread_run (adt7470_update_thread, client, -dev_name (data->hwmon_dev)); +"%s" ,dev_name (data->hwmon_dev));if (IS_ERR (data->auto_update)) goto exit_unregister;
drivers/ide/ide-probe.c +2 -2
@@ -647,7 +647,7 @@ static int ide_register_port(ide_hwif_t *hwif)int ret;/* register with global device tree */ -dev_set_name (&hwif->gendev, hwif->name); +dev_set_name (&hwif->gendev,"%s" , hwif->name); hwif->gendev.driver_data = hwif;if (hwif->gendev.parent ==NULL ) hwif->gendev.parent = hwif->dev;
@@ -661,7 +661,7 @@ static int ide_register_port(ide_hwif_t *hwif) } hwif->portdev =device_create (ide_port_class, &hwif->gendev, -MKDEV (0 ,0 ), hwif, hwif->name); +MKDEV (0 ,0 ), hwif,"%s" , hwif->name);if (IS_ERR (hwif->portdev)) { ret =PTR_ERR (hwif->portdev);device_unregister (&hwif->gendev);
drivers/infiniband/core/sysfs.c +1 -1
@@ -778,7 +778,7 @@ int ib_device_register_sysfs(struct ib_device *device) class_dev->class = &ib_class; class_dev->driver_data = device; class_dev->parent = device->dma_device; -dev_set_name (class_dev, device->name); +dev_set_name (class_dev,"%s" , device->name);INIT_LIST_HEAD (&device->port_list);
(quoted diff) +0 -0
b/drivers/infiniband/hw/ipath/ipath_file_ops.c
index 2317398..1e35f00 100644
drivers/infiniband/hw/ipath/ipath_file_ops.c +0 -0
@@ -2449,7 +2449,7 @@ static int init_cdev(int minor, char *name,
const struct file_operations *fops,
cdev->owner = THIS_MODULE;
cdev->ops = fops;
- kobject_set_name(&cdev->kobj, name);
+ kobject_set_name(&cdev->kobj, "%s", name);
ret = cdev_add(cdev, dev, 1);
if (ret < 0) {
@@ -2459,7 +2459,7 @@ static int init_cdev(int minor, char *name, const struct file_operations *fops,
goto err_cdev;
}
- device = device_create(ipath_class, NULL, dev, NULL, name);
+ device = device_create(ipath_class, NULL, dev, NULL, "%s", name);
if (IS_ERR(device)) {
ret = PTR_ERR(device);
drivers/input/evdev.c +0 -0
@@ -819,7 +819,7 @@ static int evdev_connect(struct input_handler
*handler, struct input_dev *dev,
evdev->handle.handler = handler;
evdev->handle.private = evdev;
- dev_set_name(&evdev->dev, evdev->name);
+ dev_set_name(&evdev->dev, "%s", evdev->name);
evdev->dev.devt = MKDEV(INPUT_MAJOR, EVDEV_MINOR_BASE + minor); evdev->dev.class = &input_class;
evdev->dev.parent = &dev->dev;
drivers/input/joydev.c +0 -0
@@ -800,7 +800,7 @@ static int joydev_connect(struct input_handler
*handler, struct input_dev *dev,
}
}
- dev_set_name(&joydev->dev, joydev->name);
+ dev_set_name(&joydev->dev, "%s", joydev->name);
joydev->dev.devt = MKDEV(INPUT_MAJOR, JOYDEV_MINOR_BASE + minor); joydev->dev.class = &input_class;
joydev->dev.parent = &dev->dev;
drivers/input/mousedev.c +0 -0
@@ -878,7 +878,7 @@ static struct mousedev *mousedev_create(struct
input_dev *dev,
mousedev->handle.handler = handler;
mousedev->handle.private = mousedev;
- dev_set_name(&mousedev->dev, mousedev->name);
+ dev_set_name(&mousedev->dev, "%s", mousedev->name);
mousedev->dev.class = &input_class;
if (dev)
mousedev->dev.parent = &dev->dev;
(quoted diff) +0 -0
b/drivers/isdn/mISDN/dsp_pipeline.c
index 18cf87c..0b51eb0 100644
drivers/isdn/mISDN/dsp_pipeline.c +0 -0
@@ -101,7 +101,7 @@ int mISDN_dsp_element_register(struct
mISDN_dsp_element *elem)
entry->dev.class = elements_class; entry->dev.release = mISDN_dsp_dev_release; dev_set_drvdata(&entry->dev, elem);
- dev_set_name(&entry->dev, elem->name);
+ dev_set_name(&entry->dev, "%s", elem->name);
ret = device_register(&entry->dev);
if (ret) {
printk(KERN_ERR "%s: failed to register %s\n",
drivers/media/video/tvaudio.c +0 -0
@@ -1913,7 +1913,8 @@ static int tvaudio_probe(struct i2c_client
*client, const struct i2c_device_id *
init_timer(&chip->wt);
chip->wt.function = chip_thread_wake;
chip->wt.data = (unsigned long)chip;
- chip->thread = kthread_run(chip_thread, chip, client->name);
+ chip->thread = kthread_run(chip_thread, chip,
+ "%s", client->name);
if (IS_ERR(chip->thread)) {
v4l2_warn(sd, "failed to create kthread\n"); chip->thread = NULL;
(quoted diff) +0 -0
b/drivers/media/video/v4l2-common.c
index b8f2be8..f816485 100644
drivers/media/video/v4l2-common.c +0 -0
@@ -555,7 +555,7 @@ int v4l2_ctrl_query_fill(struct v4l2_queryctrl
*qctrl, s32 min, s32 max, s32 ste
qctrl->step = step;
qctrl->default_value = def;
qctrl->reserved[0] = qctrl->reserved[1] = 0;
- snprintf(qctrl->name, sizeof(qctrl->name), name);
+ snprintf(qctrl->name, sizeof(qctrl->name), "%s", name);
return 0;
}
EXPORT_SYMBOL(v4l2_ctrl_query_fill);
@@ -720,7 +720,8 @@ int v4l2_ctrl_query_menu(struct v4l2_querymenu *qmenu, struct v4l2_queryctrl *qc
for (i = 0; i < qmenu->index && menu_items[i]; i++) ; if (menu_items[i] == NULL || menu_items[i][0] == '\0')
return -EINVAL;
- snprintf(qmenu->name, sizeof(qmenu->name), menu_items[qmenu->index]);
+ snprintf(qmenu->name, sizeof(qmenu->name),
+ "%s", menu_items[qmenu->index]);
return 0;
}
EXPORT_SYMBOL(v4l2_ctrl_query_menu);
@@ -738,7 +739,7 @@ int v4l2_ctrl_query_menu_valid_items(struct v4l2_querymenu *qmenu, const u32 *id
while (*ids != V4L2_CTRL_MENU_IDS_END) {
if (*ids++ == qmenu->index) {
snprintf(qmenu->name, sizeof(qmenu->name),
- menu_items[qmenu->index]);
+ "%s", menu_items[qmenu->index]);
return 0;
}
}
(quoted diff) +0 -0
b/drivers/media/video/zoran/zoran_card.c
index 5d2f090..ab8c700 100644
drivers/media/video/zoran/zoran_card.c +4 -4
@@ -1418,7 +1418,7 @@ static int __devinit zoran_probe(struct pci_dev *pdev, }if (i2c_dec_name) { - result =request_module (i2c_dec_name); + result =request_module ("%s" , i2c_dec_name);if (result <0 ) {dprintk (1 , KERN_ERR
@@ -1438,7 +1438,7 @@ static int __devinit zoran_probe(struct pci_dev *pdev, }if (i2c_enc_name) { - result =request_module (i2c_enc_name); + result =request_module ("%s" , i2c_enc_name);if (result <0 ) {dprintk (1 , KERN_ERR
@@ -1462,7 +1462,7 @@ static int __devinit zoran_probe(struct pci_dev *pdev,if (zr->card.video_codec) { codec_name =codecid_to_modulename (zr->card.video_codec);if (codec_name) { - result =request_module (codec_name); + result =request_module ("%s" , codec_name);if (result) {dprintk (1 , KERN_ERR
@@ -1474,7 +1474,7 @@ static int __devinit zoran_probe(struct pci_dev *pdev,if (zr->card.video_vfe) { vfe_name =codecid_to_modulename (zr->card.video_vfe);if (vfe_name) { - result =request_module (vfe_name); + result =request_module ("%s" , vfe_name);if (result <0 ) {dprintk (1 , KERN_ERR
drivers/misc/enclosure.c +0 -0
@@ -119,7 +119,7 @@ enclosure_register(struct device *dev, const char
*name, int components,
edev->edev.class = &enclosure_class;
edev->edev.parent = get_device(dev);
edev->cb = cb;
- dev_set_name(&edev->edev, name);
+ dev_set_name(&edev->edev, "%s", name);
err = device_register(&edev->edev);
if (err)
goto err;
@@ -256,7 +256,7 @@ enclosure_component_register(struct enclosure_device *edev,
cdev = &ecomp->cdev;
cdev->parent = get_device(&edev->edev);
if (name)
- dev_set_name(cdev, name);
+ dev_set_name(cdev, "%s", name);
else
dev_set_name(cdev, "%u", number);
drivers/mtd/chips/gen_probe.c +0 -0
@@ -212,7 +212,8 @@ static inline struct mtd_info
*cfi_cmdset_unknown(struct map_info *map,
probe_function = __symbol_get(probename); if (!probe_function) {
- request_module(probename + sizeof(MODULE_SYMBOL_PREFIX) - 1);
+ request_module("%s",
+ probename + sizeof(MODULE_SYMBOL_PREFIX) - 1);
probe_function = __symbol_get(probename);
}
drivers/mtd/ubi/build.c +0 -0
@@ -848,7 +848,7 @@ int ubi_attach_mtd_dev(struct mtd_info *mtd, int
ubi_num, int vid_hdr_offset)
if (err)
goto out_nofree;
- ubi->bgt_thread = kthread_create(ubi_thread, ubi, ubi->bgt_name);
+ ubi->bgt_thread = kthread_create(ubi_thread, ubi, "%s", ubi->bgt_name);
if (IS_ERR(ubi->bgt_thread)) {
err = PTR_ERR(ubi->bgt_thread); ubi_err("cannot spawn \"%s\", error %d", ubi->bgt_name,
drivers/net/3c59x.c +1 -1
@@ -2883,7 +2883,7 @@ static void vortex_get_drvinfo(struct net_device *dev,strcpy (info->bus_info,pci_name (VORTEX_PCI (vp))); }else {if (VORTEX_EISA (vp)) -sprintf (info->bus_info,dev_name (vp->gendev)); +sprintf (info->bus_info,"%s" ,dev_name (vp->gendev));else sprintf (info->bus_info,"EISA 0x%lx %d" , dev->base_addr, dev->irq);
drivers/net/phy/mdio_bus.c +1 -1
@@ -98,7 +98,7 @@ int mdiobus_register(struct mii_bus *bus) bus->dev.parent = bus->parent; bus->dev.class = &mdio_bus_class; bus->dev.groups =NULL ; -dev_set_name (&bus->dev, bus->id); +dev_set_name (&bus->dev,"%s" , bus->id); err =device_register (&bus->dev);if (err) {
drivers/net/wireless/airo.c +2 -1
@@ -1884,7 +1884,8 @@ static int airo_open(struct net_device *dev) {if (ai->wifidev != dev) {clear_bit (JOB_DIE , &ai->jobs); - ai->airo_thread_task =kthread_run (airo_thread, dev, dev->name); + ai->airo_thread_task =kthread_run (airo_thread, dev, +"%s" , dev->name);if (IS_ERR (ai->airo_thread_task))return (int )PTR_ERR (ai->airo_thread_task);
drivers/scsi/aacraid/commctrl.c +2 -1
@@ -317,7 +317,8 @@ return_fib:kthread_stop (dev->thread);ssleep (1 ); dev->aif_thread =0 ; - dev->thread =kthread_run (aac_command_thread, dev, dev->name); + dev->thread =kthread_run (aac_command_thread, dev, +"%s" , dev->name);ssleep (1 ); }if (f.wait) {
drivers/scsi/aacraid/commsup.c +0 -0
@@ -1220,7 +1220,8 @@ static int _aac_reset_adapter(struct aac_dev
*aac, int forced)
if ((retval = pci_set_dma_mask(aac->pdev, DMA_32BIT_MASK)))
goto out;
if (jafo) {
- aac->thread = kthread_run(aac_command_thread, aac, aac->name);
+ aac->thread = kthread_run(aac_command_thread, aac,
+ "%s", aac->name);
if (IS_ERR(aac->thread)) {
retval = PTR_ERR(aac->thread);
goto out;
drivers/scsi/advansys.c +0 -0
@@ -2896,7 +2896,7 @@ static int asc_prt_line(char *buf, int buflen,
char *fmt, ...)
ret = vsprintf(s, fmt, args);
BUG_ON(ret >= ASC_PRTLINE_SIZE);
if (buf == NULL) {
- (void)printk(s);
+ (void)printk("%s", s);
ret = 0;
} else {
ret = min(buflen, ret);
drivers/scsi/sd.c +0 -0
@@ -1830,7 +1830,7 @@ static void sd_probe_async(void *data,
async_cookie_t cookie)
device_initialize(&sdkp->dev);
sdkp->dev.parent = &sdp->sdev_gendev;
sdkp->dev.class = &sd_disk_class;
- dev_set_name(&sdkp->dev, dev_name(&sdp->sdev_gendev));
+ dev_set_name(&sdkp->dev, "%s", dev_name(&sdp->sdev_gendev));
if (device_add(&sdkp->dev))
goto out_free_index;
drivers/scsi/sg.c +0 -0
@@ -2537,7 +2537,7 @@ static void sg_proc_debug_helper(struct seq_file
*s, Sg_device * sdp)
else
cp = " ";
}
- seq_printf(s, cp);
+ seq_printf(s, "%s", cp);
blen = srp->data.bufflen;
usg = srp->data.k_use_sg;
seq_printf(s, srp->done ?
drivers/serial/serial_core.c +0 -0
@@ -1755,7 +1755,7 @@ static int uart_line_info(char *buf, struct
uart_driver *drv, int i)
stat_buf[0] = ' ';
strcat(stat_buf, "\n");
- ret += sprintf(buf + ret, stat_buf);
+ ret += sprintf(buf + ret, "%s", stat_buf);
} else {
strcat(buf, "\n");
ret++;
drivers/usb/atm/usbatm.c +1 -1
@@ -1031,7 +1031,7 @@ static int usbatm_heavy_init(struct usbatm_data *instance)struct task_struct *t; t =kthread_create (usbatm_do_heavy_init, instance, - instance->driver->driver_name); +"%s" , instance->driver->driver_name);if (IS_ERR (t)) {usb_err (instance,"%s: failed to create kernel_thread (%ld)!\n" , __func__,PTR_ERR (t));
@@ -1086,7 +1086,8 @@ int usbatm_usb_probe(struct usb_interface *intf,
const struct usb_device_id *id,
/* public fields */
instance->driver = driver;
- snprintf(instance->driver_name, sizeof(instance->driver_name),driver->driver_name);
+ snprintf(instance->driver_name, sizeof(instance->driver_name),
+ "%s", driver->driver_name);
instance->usb_dev = usb_dev;
instance->usb_intf = intf;
drivers/usb/storage/libusual.c +1 -1
@@ -187,7 +187,7 @@ static int usu_probe_thread(void *arg)unsigned long flags;mutex_lock (&usu_probe_mutex); - rc =request_module (bias_names[type]); + rc =request_module ("%s" , bias_names[type]);spin_lock_irqsave (&usu_lock, flags);if (rc ==0 && (st->fls &USU_MOD_FL_PRESENT ) ==0 ) {/*
drivers/uwb/lc-dev.c +0 -0
@@ -437,7 +437,7 @@ void uwbd_dev_onair(struct uwb_rc *rc, struct
uwb_beca_e *bce)
uwb_dev_init(uwb_dev); /* This sets refcnt to one, we own it */
uwb_dev->mac_addr = *bce->mac_addr;
uwb_dev->dev_addr = bce->dev_addr;
- dev_set_name(&uwb_dev->dev, macbuf);
+ dev_set_name(&uwb_dev->dev, "%s", macbuf);
result = uwb_dev_add(uwb_dev, &rc->uwb_dev.dev, rc); if (result < 0) {
dev_err(dev, "new device %s: cannot instantiate device\n",
(quoted diff) +0 -0
b/drivers/video/backlight/backlight.c
index 157057c..71d65fb 100644
drivers/video/backlight/backlight.c +0 -0
@@ -244,7 +244,7 @@ struct backlight_device
*backlight_device_register(const char *name,
new_bd->dev.class = backlight_class;
new_bd->dev.parent = parent;
new_bd->dev.release = bl_device_release;
- dev_set_name(&new_bd->dev, name);
+ dev_set_name(&new_bd->dev, "%s", name);
dev_set_drvdata(&new_bd->dev, devdata);
rc = device_register(&new_bd->dev);
drivers/video/backlight/lcd.c +0 -0
@@ -208,7 +208,7 @@ struct lcd_device *lcd_device_register(const char
*name, struct device *parent,
new_ld->dev.class = lcd_class;
new_ld->dev.parent = parent;
new_ld->dev.release = lcd_device_release;
- dev_set_name(&new_ld->dev, name);
+ dev_set_name(&new_ld->dev, "%s", name);
dev_set_drvdata(&new_ld->dev, devdata);
rc = device_register(&new_ld->dev);
drivers/video/output.c +1 -1
@@ -96,7 +96,7 @@ struct output_device *video_output_register(const char *name, new_dev->props = op; new_dev->dev.class = &video_output_class; new_dev->dev.parent = dev; -dev_set_name (&new_dev->dev, name); +dev_set_name (&new_dev->dev,"%s" , name);dev_set_drvdata (&new_dev->dev, devdata); ret_code =device_register (&new_dev->dev);if (ret_code) {
(quoted diff) +0 -0
b/drivers/xen/xenbus/xenbus_probe.c
index 773d1cf..7e481a4 100644
drivers/xen/xenbus/xenbus_probe.c +1 -1
@@ -507,7 +507,7 @@ int xenbus_probe_node(struct xen_bus_type *bus,if (err) goto fail; -dev_set_name (&xendev->dev, devname); +dev_set_name (&xendev->dev,"%s" , devname);/* Register with generic device framework. */ err =device_register (&xendev->dev);
fs/dquot.c +0 -0
@@ -172,7 +172,7 @@ static struct quota_format_type *find_quota_format(int id)spin_unlock (&dq_list_lock); for (qm = 0; module_names[qm].qm_fmt_id &&
module_names[qm].qm_fmt_id != id; qm++);
- if (!module_names[qm].qm_fmt_id ||request_module(module_names[qm].qm_mod_name))
+ if (!module_names[qm].qm_fmt_id || request_module("%s",
module_names[qm].qm_mod_name))
return NULL;
spin_lock(&dq_list_lock);
fs/gfs2/glock.c +0 -0
@@ -898,7 +898,7 @@ void gfs2_print_dbg(struct seq_file *seq, const
char *fmt, ...)
if (seq) {
struct gfs2_glock_iter *gi = seq->private; vsprintf(gi->string, fmt, args);
- seq_printf(seq, gi->string);
+ seq_printf(seq, "%s", gi->string);
} else {
printk(KERN_ERR " "); vprintk(fmt, args);
fs/gfs2/locking.c +1 -1
@@ -177,7 +177,7 @@ retry:if (!try &&capable (CAP_SYS_MODULE )) { try =1 ;mutex_unlock (&lmh_lock); -request_module (proto_name); +request_module ("%s" , proto_name); goto retry; }printk (KERN_INFO "GFS2: can't find protocol %s\n" , proto_name);
fs/lockd/svc.c +1 -1
@@ -300,7 +300,7 @@ int lockd_up(void)svc_sock_update_bufs (serv); serv->sv_maxconn = nlm_max_connections; - nlmsvc_task =kthread_run (lockd, nlmsvc_rqst, serv->sv_name); + nlmsvc_task =kthread_run (lockd, nlmsvc_rqst,"%s" , serv->sv_name);if (IS_ERR (nlmsvc_task)) { error =PTR_ERR (nlmsvc_task);svc_exit_thread (nlmsvc_rqst);
fs/nfs/nfs4proc.c +0 -0
@@ -2925,8 +2925,8 @@ int nfs4_proc_setclientid(struct nfs_client
*clp, u32 program, unsigned short po
clp->cl_id_uniquifier);
setclientid.sc_netid_len = scnprintf(setclientid.sc_netid,
sizeof(setclientid.sc_netid),
- rpc_peeraddr2str(clp->cl_rpcclient,
- RPC_DISPLAY_NETID));
+ "%s", rpc_peeraddr2str(clp->cl_rpcclient,
+ RPC_DISPLAY_NETID));
setclientid.sc_uaddr_len = scnprintf(setclientid.sc_uaddr,
sizeof(setclientid.sc_uaddr), "%s.%u.%u", clp->cl_ipaddr, port >> 8, port & 255);
fs/partitions/check.c +1 -1
@@ -452,7 +452,7 @@ void register_disk(struct gendisk *disk) ddev->parent = disk->driverfs_dev; -dev_set_name (ddev, disk->disk_name); +dev_set_name (ddev,"%s" , disk->disk_name);/* delay uevents, until we scanned partition table */ ddev->uevent_suppress =1 ;
fs/reiserfs/prints.c +0 -0
@@ -289,7 +289,7 @@ void reiserfs_info(struct super_block *sb, const
char *fmt, ...)
static void reiserfs_printk(const char *fmt, ...) {
do_reiserfs_warning(fmt);
- printk(error_buf);
+ printk("%s", error_buf);
}
void reiserfs_debug(struct super_block *s, int level, const char *fmt, ...)
fs/ubifs/super.c +0 -0
@@ -422,7 +422,7 @@ static int ubifs_show_options(struct seq_file *s,
struct vfsmount *mnt)
if (c->mount_opts.override_compr) {
seq_printf(s, ",compr=");
- seq_printf(s, ubifs_compr_name(c->mount_opts.compr_type));
+ seq_printf(s, "%s", ubifs_compr_name(c->mount_opts.compr_type));
}
return 0;
@@ -1201,7 +1201,7 @@ static int mount_ubifs(struct ubifs_info *c)
goto out_cbuf;
/* Create background thread */
- c->bgt = kthread_create(ubifs_bg_thread, c, c->bgt_name);
+ c->bgt = kthread_create(ubifs_bg_thread, c, "%s", c->bgt_name);
if (IS_ERR(c->bgt)) {
err = PTR_ERR(c->bgt);
c->bgt = NULL;
@@ -1554,7 +1554,7 @@ static int ubifs_remount_rw(struct ubifs_info *c)
ubifs_create_buds_lists(c);
/* Create background thread */
- c->bgt = kthread_create(ubifs_bg_thread, c, c->bgt_name);
+ c->bgt = kthread_create(ubifs_bg_thread, c, "%s", c->bgt_name);
if (IS_ERR(c->bgt)) {
err = PTR_ERR(c->bgt);
c->bgt = NULL;
kernel/cpuset.c +0 -0
@@ -2443,7 +2443,7 @@ void cpuset_print_task_mems_allowed(struct
task_struct *tsk)
dentry = task_cs(tsk)->css.cgroup->dentry; spin_lock(&cpuset_buffer_lock);
- snprintf(cpuset_name, CPUSET_NAME_LEN,
+ snprintf(cpuset_name, CPUSET_NAME_LEN, "%s",
dentry ? (const char *)dentry->d_name.name : "/");
nodelist_scnprintf(cpuset_nodelist, CPUSET_NODELIST_LEN,
tsk->mems_allowed);
lib/kobject.c +1 -1
@@ -794,7 +794,7 @@ static struct kset *kset_create(const char *name, kset =kzalloc (sizeof (*kset),GFP_KERNEL );if (!kset)return NULL ; -kobject_set_name (&kset->kobj, name); +kobject_set_name (&kset->kobj,"%s" , name); kset->uevent_ops = uevent_ops; kset->kobj.parent = parent_kobj;
net/core/net-sysfs.c +1 -1
@@ -496,7 +496,7 @@ int netdev_register_kobject(struct net_device *net) dev->groups = groups;BUILD_BUG_ON (BUS_ID_SIZE <IFNAMSIZ ); -dev_set_name (dev, net->name); +dev_set_name (dev,"%s" , net->name);#ifdef CONFIG_SYSFS *groups++ = &netstat_group;
net/netfilter/ipvs/ip_vs_sync.c +0 -0
@@ -873,7 +873,7 @@ int start_sync_thread(int state, char *mcast_ifn,
__u8 syncid)
tinfo->sock = sock;
tinfo->buf = buf;
- task = kthread_run(threadfn, tinfo, name);
+ task = kthread_run(threadfn, tinfo, "%s", name);
if (IS_ERR(task)) {
result = PTR_ERR(task);
goto outtinfo;
net/sunrpc/svc.c +0 -0
@@ -665,7 +665,8 @@ svc_set_num_threads(struct svc_serv *serv, struct
svc_pool *pool, int nrservs)
}
__module_get(serv->sv_module);
- task = kthread_create(serv->sv_function, rqstp, serv->sv_name);
+ task = kthread_create(serv->sv_function, rqstp,
+ "%s", serv->sv_name);
if (IS_ERR(task)) {
error = PTR_ERR(task); module_put(serv->sv_module);
net/tipc/dbg.c +2 -2
@@ -258,7 +258,7 @@ void tipc_printf(struct print_buf *pb, const char *fmt, ...) }if (pb->echo) -printk (print_string); +printk ("%s" , print_string);spin_unlock_bh (&print_lock); }
@@ -278,7 +278,7 @@ static void print_to_console(char *crs, int len)char c = crs[sz]; crs[sz] =0 ; -printk ((const char *)crs); +printk ("%s" , (const char *)crs); crs[sz] = c; rest -= sz; crs += sz;
@@ -325,7 +325,7 @@ void tipc_dump_dbg(struct print_buf *pb, const
char *fmt, ...)
spin_lock_bh(&print_lock);
FORMAT(print_string, len, fmt);
- printk(print_string);
+ printk("%s", print_string);
printk("\n---- Start of %s log dump ----\n\n",
(pb == TIPC_LOG) ? "global" : "local");
sound/pci/korg1212/korg1212.c +0 -0
@@ -2059,7 +2059,7 @@ static void snd_korg1212_proc_read(struct
snd_info_entry *entry,
int n;
struct snd_korg1212 *korg1212 = entry->private_data;
- snd_iprintf(buffer, korg1212->card->longname);
+ snd_iprintf(buffer, "%s", korg1212->card->longname);
snd_iprintf(buffer, " (index #%d)\n", korg1212->card->number + 1); snd_iprintf(buffer, "\nGeneral settings\n");
snd_iprintf(buffer, " period size: %Zd bytes\n", K1212_PERIOD_BYTES);
sound/pci/rme32.c +0 -0
@@ -1470,7 +1470,7 @@ snd_rme32_proc_read(struct snd_info_entry *
entry, struct snd_info_buffer *buffe
rme32->rcreg = readl(rme32->iobase + RME32_IO_CONTROL_REGISTER);
- snd_iprintf(buffer, rme32->card->longname);
+ snd_iprintf(buffer, "%s", rme32->card->longname);
snd_iprintf(buffer, " (index #%d)\n", rme32->card->number + 1);
snd_iprintf(buffer, "\nGeneral settings\n");
sound/pci/rme96.c +0 -0
@@ -1670,7 +1670,7 @@ snd_rme96_proc_read(struct snd_info_entry
*entry, struct snd_info_buffer *buffer
rme96->rcreg = readl(rme96->iobase + RME96_IO_CONTROL_REGISTER);
- snd_iprintf(buffer, rme96->card->longname);
+ snd_iprintf(buffer, "%s", rme96->card->longname);
snd_iprintf(buffer, " (index #%d)\n", rme96->card->number + 1);
snd_iprintf(buffer, "\nGeneral settings\n");
sound/sound_core.c +0 -0
@@ -222,7 +222,7 @@ static int sound_insert_unit(struct sound_unit
**list, const struct file_operati
sprintf(s->name, "sound/%s%d", name, r / SOUND_STEP);
device_create(sound_class, dev, MKDEV(SOUND_MAJOR, s->unit_minor),
- NULL, s->name+6);
+ NULL, "%s", s->name+6);
return r;
fail:
---
Regards,
Floris
---
"They that give up essential liberty to obtain temporary safety, deserve neither liberty nor safety."
-- Ben Franklin
"The course of history shows that as a government grows, liberty decreases."
-- Thomas Jefferson