Merge tag 'staging-3.12-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging

Pull staging fixes from Greg KH:
"Here are a number of small staging tree and iio driver fixes. Nothing
major, just lots of little things"

* tag 'staging-3.12-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (34 commits)
iio:buffer_cb: Add missing iio_buffer_init()
iio: Prevent race between IIO chardev opening and IIO device free
iio: fix: Keep a reference to the IIO device for open file descriptors
iio: Stop sampling when the device is removed
iio: Fix crash when scan_bytes is computed with active_scan_mask == NULL
iio: Fix mcp4725 dev-to-indio_dev conversion in suspend/resume
iio: Fix bma180 dev-to-indio_dev conversion in suspend/resume
iio: Fix tmp006 dev-to-indio_dev conversion in suspend/resume
iio: iio_device_add_event_sysfs() bugfix
staging: iio: ade7854-spi: Fix return value
staging:iio:hmc5843: Fix measurement conversion
iio: isl29018: Fix uninitialized value
staging:iio:dummy fix kfifo_buf kconfig dependency issue if kfifo modular and buffer enabled for built in dummy driver.
iio: at91: fix adc_clk overflow
staging: line6: add bounds check in snd_toneport_source_put()
Staging: comedi: Fix dependencies for drivers misclassified as PCI
staging: r8188eu: Adjust RX gain
staging: r8188eu: Fix smatch warning in core/rtw_ieee80211.
staging: r8188eu: Fix smatch error in core/rtw_mlme_ext.c
staging: r8188eu: Fix Smatch off-by-one warning in hal/rtl8188e_hal_init.c
...

+2 -2
drivers/iio/accel/bma180.c
··· 620 620 #ifdef CONFIG_PM_SLEEP 621 621 static int bma180_suspend(struct device *dev) 622 622 { 623 - struct iio_dev *indio_dev = dev_to_iio_dev(dev); 623 + struct iio_dev *indio_dev = i2c_get_clientdata(to_i2c_client(dev)); 624 624 struct bma180_data *data = iio_priv(indio_dev); 625 625 int ret; 626 626 ··· 633 633 634 634 static int bma180_resume(struct device *dev) 635 635 { 636 - struct iio_dev *indio_dev = dev_to_iio_dev(dev); 636 + struct iio_dev *indio_dev = i2c_get_clientdata(to_i2c_client(dev)); 637 637 struct bma180_data *data = iio_priv(indio_dev); 638 638 int ret; 639 639
+6 -5
drivers/iio/adc/at91_adc.c
··· 556 556 557 557 static int at91_adc_probe(struct platform_device *pdev) 558 558 { 559 - unsigned int prsc, mstrclk, ticks, adc_clk, shtim; 559 + unsigned int prsc, mstrclk, ticks, adc_clk, adc_clk_khz, shtim; 560 560 int ret; 561 561 struct iio_dev *idev; 562 562 struct at91_adc_state *st; ··· 649 649 */ 650 650 mstrclk = clk_get_rate(st->clk); 651 651 adc_clk = clk_get_rate(st->adc_clk); 652 + adc_clk_khz = adc_clk / 1000; 652 653 prsc = (mstrclk / (2 * adc_clk)) - 1; 653 654 654 655 if (!st->startup_time) { ··· 663 662 * defined in the electrical characteristics of the board, divided by 8. 664 663 * The formula thus is : Startup Time = (ticks + 1) * 8 / ADC Clock 665 664 */ 666 - ticks = round_up((st->startup_time * adc_clk / 667 - 1000000) - 1, 8) / 8; 665 + ticks = round_up((st->startup_time * adc_clk_khz / 666 + 1000) - 1, 8) / 8; 668 667 /* 669 668 * a minimal Sample and Hold Time is necessary for the ADC to guarantee 670 669 * the best converted final value between two channels selection 671 670 * The formula thus is : Sample and Hold Time = (shtim + 1) / ADCClock 672 671 */ 673 - shtim = round_up((st->sample_hold_time * adc_clk / 674 - 1000000) - 1, 1); 672 + shtim = round_up((st->sample_hold_time * adc_clk_khz / 673 + 1000) - 1, 1); 675 674 676 675 reg = AT91_ADC_PRESCAL_(prsc) & st->registers->mr_prescal_mask; 677 676 reg |= AT91_ADC_STARTUP_(ticks) & st->registers->mr_startup_mask;
+2
drivers/iio/buffer_cb.c
··· 41 41 goto error_ret; 42 42 } 43 43 44 + iio_buffer_init(&cb_buff->buffer); 45 + 44 46 cb_buff->private = private; 45 47 cb_buff->cb = cb; 46 48 cb_buff->buffer.access = &iio_cb_access;
+6 -6
drivers/iio/dac/mcp4725.c
··· 37 37 38 38 static int mcp4725_suspend(struct device *dev) 39 39 { 40 - struct iio_dev *indio_dev = dev_to_iio_dev(dev); 41 - struct mcp4725_data *data = iio_priv(indio_dev); 40 + struct mcp4725_data *data = iio_priv(i2c_get_clientdata( 41 + to_i2c_client(dev))); 42 42 u8 outbuf[2]; 43 43 44 44 outbuf[0] = (data->powerdown_mode + 1) << 4; 45 45 outbuf[1] = 0; 46 46 data->powerdown = true; 47 47 48 - return i2c_master_send(to_i2c_client(dev), outbuf, 2); 48 + return i2c_master_send(data->client, outbuf, 2); 49 49 } 50 50 51 51 static int mcp4725_resume(struct device *dev) 52 52 { 53 - struct iio_dev *indio_dev = dev_to_iio_dev(dev); 54 - struct mcp4725_data *data = iio_priv(indio_dev); 53 + struct mcp4725_data *data = iio_priv(i2c_get_clientdata( 54 + to_i2c_client(dev))); 55 55 u8 outbuf[2]; 56 56 57 57 /* restore previous DAC value */ ··· 59 59 outbuf[1] = data->dac_value & 0xff; 60 60 data->powerdown = false; 61 61 62 - return i2c_master_send(to_i2c_client(dev), outbuf, 2); 62 + return i2c_master_send(data->client, outbuf, 2); 63 63 } 64 64 65 65 #ifdef CONFIG_PM_SLEEP
+4
drivers/iio/iio_core.h
··· 49 49 #define iio_buffer_poll_addr (&iio_buffer_poll) 50 50 #define iio_buffer_read_first_n_outer_addr (&iio_buffer_read_first_n_outer) 51 51 52 + void iio_disable_all_buffers(struct iio_dev *indio_dev); 53 + 52 54 #else 53 55 54 56 #define iio_buffer_poll_addr NULL 55 57 #define iio_buffer_read_first_n_outer_addr NULL 58 + 59 + static inline void iio_disable_all_buffers(struct iio_dev *indio_dev) {} 56 60 57 61 #endif 58 62
+28 -2
drivers/iio/industrialio-buffer.c
··· 460 460 return bytes; 461 461 } 462 462 463 + void iio_disable_all_buffers(struct iio_dev *indio_dev) 464 + { 465 + struct iio_buffer *buffer, *_buffer; 466 + 467 + if (list_empty(&indio_dev->buffer_list)) 468 + return; 469 + 470 + if (indio_dev->setup_ops->predisable) 471 + indio_dev->setup_ops->predisable(indio_dev); 472 + 473 + list_for_each_entry_safe(buffer, _buffer, 474 + &indio_dev->buffer_list, buffer_list) 475 + list_del_init(&buffer->buffer_list); 476 + 477 + indio_dev->currentmode = INDIO_DIRECT_MODE; 478 + if (indio_dev->setup_ops->postdisable) 479 + indio_dev->setup_ops->postdisable(indio_dev); 480 + } 481 + 463 482 int iio_update_buffers(struct iio_dev *indio_dev, 464 483 struct iio_buffer *insert_buffer, 465 484 struct iio_buffer *remove_buffer) ··· 547 528 * Note can only occur when adding a buffer. 548 529 */ 549 530 list_del(&insert_buffer->buffer_list); 550 - indio_dev->active_scan_mask = old_mask; 551 - success = -EINVAL; 531 + if (old_mask) { 532 + indio_dev->active_scan_mask = old_mask; 533 + success = -EINVAL; 534 + } 535 + else { 536 + kfree(compound_mask); 537 + ret = -EINVAL; 538 + goto error_ret; 539 + } 552 540 } 553 541 } else { 554 542 indio_dev->active_scan_mask = compound_mask;
+21 -10
drivers/iio/industrialio-core.c
··· 848 848 static void iio_dev_release(struct device *device) 849 849 { 850 850 struct iio_dev *indio_dev = dev_to_iio_dev(device); 851 - if (indio_dev->chrdev.dev) 852 - cdev_del(&indio_dev->chrdev); 853 851 if (indio_dev->modes & INDIO_BUFFER_TRIGGERED) 854 852 iio_device_unregister_trigger_consumer(indio_dev); 855 853 iio_device_unregister_eventset(indio_dev); ··· 968 970 if (test_and_set_bit(IIO_BUSY_BIT_POS, &indio_dev->flags)) 969 971 return -EBUSY; 970 972 973 + iio_device_get(indio_dev); 974 + 971 975 filp->private_data = indio_dev; 972 976 973 977 return 0; ··· 983 983 struct iio_dev *indio_dev = container_of(inode->i_cdev, 984 984 struct iio_dev, chrdev); 985 985 clear_bit(IIO_BUSY_BIT_POS, &indio_dev->flags); 986 + iio_device_put(indio_dev); 987 + 986 988 return 0; 987 989 } 988 990 ··· 1054 1052 indio_dev->setup_ops == NULL) 1055 1053 indio_dev->setup_ops = &noop_ring_setup_ops; 1056 1054 1057 - ret = device_add(&indio_dev->dev); 1058 - if (ret < 0) 1059 - goto error_unreg_eventset; 1060 1055 cdev_init(&indio_dev->chrdev, &iio_buffer_fileops); 1061 1056 indio_dev->chrdev.owner = indio_dev->info->driver_module; 1057 + indio_dev->chrdev.kobj.parent = &indio_dev->dev.kobj; 1062 1058 ret = cdev_add(&indio_dev->chrdev, indio_dev->dev.devt, 1); 1063 1059 if (ret < 0) 1064 - goto error_del_device; 1065 - return 0; 1060 + goto error_unreg_eventset; 1066 1061 1067 - error_del_device: 1068 - device_del(&indio_dev->dev); 1062 + ret = device_add(&indio_dev->dev); 1063 + if (ret < 0) 1064 + goto error_cdev_del; 1065 + 1066 + return 0; 1067 + error_cdev_del: 1068 + cdev_del(&indio_dev->chrdev); 1069 1069 error_unreg_eventset: 1070 1070 iio_device_unregister_eventset(indio_dev); 1071 1071 error_free_sysfs: ··· 1082 1078 void iio_device_unregister(struct iio_dev *indio_dev) 1083 1079 { 1084 1080 mutex_lock(&indio_dev->info_exist_lock); 1081 + 1082 + device_del(&indio_dev->dev); 1083 + 1084 + if (indio_dev->chrdev.dev) 1085 + cdev_del(&indio_dev->chrdev); 1086 + 1087 + iio_disable_all_buffers(indio_dev); 1088 + 1085 1089 indio_dev->info = NULL; 1086 1090 mutex_unlock(&indio_dev->info_exist_lock); 1087 - device_del(&indio_dev->dev); 1088 1091 } 1089 1092 EXPORT_SYMBOL(iio_device_unregister); 1090 1093 subsys_initcall(iio_init);
+14 -6
drivers/iio/industrialio-event.c
··· 72 72 static unsigned int iio_event_poll(struct file *filep, 73 73 struct poll_table_struct *wait) 74 74 { 75 - struct iio_event_interface *ev_int = filep->private_data; 75 + struct iio_dev *indio_dev = filep->private_data; 76 + struct iio_event_interface *ev_int = indio_dev->event_interface; 76 77 unsigned int events = 0; 77 78 78 79 poll_wait(filep, &ev_int->wait, wait); ··· 91 90 size_t count, 92 91 loff_t *f_ps) 93 92 { 94 - struct iio_event_interface *ev_int = filep->private_data; 93 + struct iio_dev *indio_dev = filep->private_data; 94 + struct iio_event_interface *ev_int = indio_dev->event_interface; 95 95 unsigned int copied; 96 96 int ret; 97 97 ··· 123 121 124 122 static int iio_event_chrdev_release(struct inode *inode, struct file *filep) 125 123 { 126 - struct iio_event_interface *ev_int = filep->private_data; 124 + struct iio_dev *indio_dev = filep->private_data; 125 + struct iio_event_interface *ev_int = indio_dev->event_interface; 127 126 128 127 spin_lock_irq(&ev_int->wait.lock); 129 128 __clear_bit(IIO_BUSY_BIT_POS, &ev_int->flags); ··· 135 132 */ 136 133 kfifo_reset_out(&ev_int->det_events); 137 134 spin_unlock_irq(&ev_int->wait.lock); 135 + 136 + iio_device_put(indio_dev); 138 137 139 138 return 0; 140 139 } ··· 163 158 return -EBUSY; 164 159 } 165 160 spin_unlock_irq(&ev_int->wait.lock); 166 - fd = anon_inode_getfd("iio:event", 167 - &iio_event_chrdev_fileops, ev_int, O_RDONLY); 161 + iio_device_get(indio_dev); 162 + 163 + fd = anon_inode_getfd("iio:event", &iio_event_chrdev_fileops, 164 + indio_dev, O_RDONLY); 168 165 if (fd < 0) { 169 166 spin_lock_irq(&ev_int->wait.lock); 170 167 __clear_bit(IIO_BUSY_BIT_POS, &ev_int->flags); 171 168 spin_unlock_irq(&ev_int->wait.lock); 169 + iio_device_put(indio_dev); 172 170 } 173 171 return fd; 174 172 } ··· 284 276 goto error_ret; 285 277 } 286 278 if (chan->modified) 287 - mask = IIO_MOD_EVENT_CODE(chan->type, 0, chan->channel, 279 + mask = IIO_MOD_EVENT_CODE(chan->type, 0, chan->channel2, 288 280 i/IIO_EV_DIR_MAX, 289 281 i%IIO_EV_DIR_MAX); 290 282 else if (chan->differential)
+4 -2
drivers/iio/temperature/tmp006.c
··· 255 255 #ifdef CONFIG_PM_SLEEP 256 256 static int tmp006_suspend(struct device *dev) 257 257 { 258 - return tmp006_powerdown(iio_priv(dev_to_iio_dev(dev))); 258 + struct iio_dev *indio_dev = i2c_get_clientdata(to_i2c_client(dev)); 259 + return tmp006_powerdown(iio_priv(indio_dev)); 259 260 } 260 261 261 262 static int tmp006_resume(struct device *dev) 262 263 { 263 - struct tmp006_data *data = iio_priv(dev_to_iio_dev(dev)); 264 + struct tmp006_data *data = iio_priv(i2c_get_clientdata( 265 + to_i2c_client(dev))); 264 266 return i2c_smbus_write_word_swapped(data->client, TMP006_CONFIG, 265 267 data->config | TMP006_CONFIG_MOD_MASK); 266 268 }
+17 -16
drivers/staging/comedi/Kconfig
··· 96 96 To compile this driver as a module, choose M here: the module will be 97 97 called skel. 98 98 99 + config COMEDI_SSV_DNP 100 + tristate "SSV Embedded Systems DIL/Net-PC support" 101 + depends on X86_32 || COMPILE_TEST 102 + ---help--- 103 + Enable support for SSV Embedded Systems DIL/Net-PC 104 + 105 + To compile this driver as a module, choose M here: the module will be 106 + called ssv_dnp. 107 + 99 108 endif # COMEDI_MISC_DRIVERS 100 109 101 110 menuconfig COMEDI_ISA_DRIVERS ··· 394 385 395 386 To compile this driver as a module, choose M here: the module will be 396 387 called dmm32at. 388 + 389 + config COMEDI_UNIOXX5 390 + tristate "Fastwel UNIOxx-5 analog and digital io board support" 391 + ---help--- 392 + Enable support for Fastwel UNIOxx-5 (analog and digital i/o) boards 393 + 394 + To compile this driver as a module, choose M here: the module will be 395 + called unioxx5. 397 396 398 397 config COMEDI_FL512 399 398 tristate "FL512 ISA card support" ··· 872 855 To compile this driver as a module, choose M here: the module will be 873 856 called dyna_pci10xx. 874 857 875 - config COMEDI_UNIOXX5 876 - tristate "Fastwel UNIOxx-5 analog and digital io board support" 877 - ---help--- 878 - Enable support for Fastwel UNIOxx-5 (analog and digital i/o) boards 879 - 880 - To compile this driver as a module, choose M here: the module will be 881 - called unioxx5. 882 - 883 858 config COMEDI_GSC_HPDI 884 859 tristate "General Standards PCI-HPDI32 / PMC-HPDI32 support" 885 860 select COMEDI_FC ··· 1093 1084 1094 1085 To compile this driver as a module, choose M here: the module will be 1095 1086 called s626. 1096 - 1097 - config COMEDI_SSV_DNP 1098 - tristate "SSV Embedded Systems DIL/Net-PC support" 1099 - ---help--- 1100 - Enable support for SSV Embedded Systems DIL/Net-PC 1101 - 1102 - To compile this driver as a module, choose M here: the module will be 1103 - called ssv_dnp. 1104 1087 1105 1088 config COMEDI_MITE 1106 1089 depends on HAS_DMA
+10 -7
drivers/staging/dgap/dgap_driver.c
··· 474 474 475 475 DGAP_LOCK(dgap_global_lock, flags); 476 476 brd->msgbuf = NULL; 477 - printk(brd->msgbuf_head); 477 + printk("%s", brd->msgbuf_head); 478 478 kfree(brd->msgbuf_head); 479 479 brd->msgbuf_head = NULL; 480 480 DGAP_UNLOCK(dgap_global_lock, flags); ··· 628 628 DPR_INIT(("dgap_scan(%d) - printing out the msgbuf\n", i)); 629 629 DGAP_LOCK(dgap_global_lock, flags); 630 630 brd->msgbuf = NULL; 631 - printk(brd->msgbuf_head); 631 + printk("%s", brd->msgbuf_head); 632 632 kfree(brd->msgbuf_head); 633 633 brd->msgbuf_head = NULL; 634 634 DGAP_UNLOCK(dgap_global_lock, flags); ··· 955 955 char buf[1024]; 956 956 int i; 957 957 unsigned long flags; 958 + size_t length; 958 959 959 960 DGAP_LOCK(dgap_global_lock, flags); 960 961 961 962 /* Format buf using fmt and arguments contained in ap. */ 962 963 va_start(ap, fmt); 963 - i = vsprintf(buf, fmt, ap); 964 + i = vsnprintf(buf, sizeof(buf), fmt, ap); 964 965 va_end(ap); 965 966 966 967 DPR((buf)); 967 968 968 969 if (!brd || !brd->msgbuf) { 969 - printk(buf); 970 + printk("%s", buf); 970 971 DGAP_UNLOCK(dgap_global_lock, flags); 971 972 return; 972 973 } 973 974 974 - memcpy(brd->msgbuf, buf, strlen(buf)); 975 - brd->msgbuf += strlen(buf); 976 - *brd->msgbuf = 0; 975 + length = strlen(buf) + 1; 976 + if (brd->msgbuf - brd->msgbuf_head < length) 977 + length = brd->msgbuf - brd->msgbuf_head; 978 + memcpy(brd->msgbuf, buf, length); 979 + brd->msgbuf += length; 977 980 978 981 DGAP_UNLOCK(dgap_global_lock, flags); 979 982 }
+2 -2
drivers/staging/dgnc/dgnc_driver.c
··· 454 454 455 455 DGNC_LOCK(dgnc_global_lock, flags); 456 456 brd->msgbuf = NULL; 457 - printk(brd->msgbuf_head); 457 + printk("%s", brd->msgbuf_head); 458 458 kfree(brd->msgbuf_head); 459 459 brd->msgbuf_head = NULL; 460 460 DGNC_UNLOCK(dgnc_global_lock, flags); ··· 710 710 DPR_INIT(("dgnc_scan(%d) - printing out the msgbuf\n", i)); 711 711 DGNC_LOCK(dgnc_global_lock, flags); 712 712 brd->msgbuf = NULL; 713 - printk(brd->msgbuf_head); 713 + printk("%s", brd->msgbuf_head); 714 714 kfree(brd->msgbuf_head); 715 715 brd->msgbuf_head = NULL; 716 716 DGNC_UNLOCK(dgnc_global_lock, flags);
+1 -1
drivers/staging/iio/Kconfig
··· 37 37 38 38 config IIO_SIMPLE_DUMMY_BUFFER 39 39 boolean "Buffered capture support" 40 - depends on IIO_KFIFO_BUF 40 + select IIO_KFIFO_BUF 41 41 help 42 42 Add buffered data capture to the simple dummy driver. 43 43
+1
drivers/staging/iio/light/isl29018.c
··· 563 563 mutex_init(&chip->lock); 564 564 565 565 chip->lux_scale = 1; 566 + chip->lux_uscale = 0; 566 567 chip->range = 1000; 567 568 chip->adc_bit = 16; 568 569 chip->suspended = false;
+1 -1
drivers/staging/iio/magnetometer/hmc5843.c
··· 229 229 if (result < 0) 230 230 return -EINVAL; 231 231 232 - *val = result; 232 + *val = sign_extend32(result, 15); 233 233 return IIO_VAL_INT; 234 234 } 235 235
+1 -1
drivers/staging/iio/meter/ade7854-spi.c
··· 299 299 if (ret) 300 300 iio_device_free(indio_dev); 301 301 302 - return 0; 302 + return ret; 303 303 } 304 304 305 305 static int ade7854_spi_remove(struct spi_device *spi)
+7 -3
drivers/staging/line6/toneport.c
··· 244 244 struct snd_line6_pcm *line6pcm = snd_kcontrol_chip(kcontrol); 245 245 struct usb_line6_toneport *toneport = 246 246 (struct usb_line6_toneport *)line6pcm->line6; 247 + unsigned int source; 247 248 248 - if (ucontrol->value.enumerated.item[0] == toneport->source) 249 + source = ucontrol->value.enumerated.item[0]; 250 + if (source >= ARRAY_SIZE(toneport_source_info)) 251 + return -EINVAL; 252 + if (source == toneport->source) 249 253 return 0; 250 254 251 - toneport->source = ucontrol->value.enumerated.item[0]; 255 + toneport->source = source; 252 256 toneport_send_cmd(toneport->line6.usbdev, 253 - toneport_source_info[toneport->source].code, 0x0000); 257 + toneport_source_info[source].code, 0x0000); 254 258 return 1; 255 259 } 256 260
+1 -1
drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c
··· 1802 1802 int 1803 1803 kiblnd_thread_start(int (*fn)(void *arg), void *arg, char *name) 1804 1804 { 1805 - struct task_struct *task = kthread_run(fn, arg, name); 1805 + struct task_struct *task = kthread_run(fn, arg, "%s", name); 1806 1806 1807 1807 if (IS_ERR(task)) 1808 1808 return PTR_ERR(task);
+1 -1
drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c
··· 1005 1005 int 1006 1006 ksocknal_thread_start(int (*fn)(void *arg), void *arg, char *name) 1007 1007 { 1008 - struct task_struct *task = kthread_run(fn, arg, name); 1008 + struct task_struct *task = kthread_run(fn, arg, "%s", name); 1009 1009 1010 1010 if (IS_ERR(task)) 1011 1011 return PTR_ERR(task);
+2 -2
drivers/staging/lustre/lustre/Kconfig
··· 1 1 config LUSTRE_FS 2 2 tristate "Lustre file system client support" 3 - depends on INET && m 3 + depends on INET && m && !MIPS && !XTENSA && !SUPERH 4 4 select LNET 5 5 select CRYPTO 6 6 select CRYPTO_CRC32 ··· 52 52 config LUSTRE_TRANSLATE_ERRNOS 53 53 bool 54 54 depends on LUSTRE_FS && !X86 55 - default true 55 + default y 56 56 57 57 config LUSTRE_LLITE_LLOOP 58 58 bool "Lustre virtual block device"
+2 -2
drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c
··· 800 800 801 801 init_completion(&bltd.bltd_comp); 802 802 bltd.bltd_num = atomic_read(&blp->blp_num_threads); 803 - snprintf(bltd.bltd_name, sizeof(bltd.bltd_name) - 1, 803 + snprintf(bltd.bltd_name, sizeof(bltd.bltd_name), 804 804 "ldlm_bl_%02d", bltd.bltd_num); 805 - task = kthread_run(ldlm_bl_thread_main, &bltd, bltd.bltd_name); 805 + task = kthread_run(ldlm_bl_thread_main, &bltd, "%s", bltd.bltd_name); 806 806 if (IS_ERR(task)) { 807 807 CERROR("cannot start LDLM thread ldlm_bl_%02d: rc %ld\n", 808 808 atomic_read(&blp->blp_num_threads), PTR_ERR(task));
+1 -1
drivers/staging/lustre/lustre/libcfs/workitem.c
··· 397 397 sched->ws_name, sched->ws_nthreads); 398 398 } 399 399 400 - task = kthread_run(cfs_wi_scheduler, sched, name); 400 + task = kthread_run(cfs_wi_scheduler, sched, "%s", name); 401 401 if (!IS_ERR(task)) { 402 402 nthrs--; 403 403 continue;
+2 -2
drivers/staging/lustre/lustre/ptlrpc/pinger.c
··· 383 383 384 384 /* CLONE_VM and CLONE_FILES just avoid a needless copy, because we 385 385 * just drop the VM and FILES in cfs_daemonize_ctxt() right away. */ 386 - rc = PTR_ERR(kthread_run(ptlrpc_pinger_main, 387 - &pinger_thread, pinger_thread.t_name)); 386 + rc = PTR_ERR(kthread_run(ptlrpc_pinger_main, &pinger_thread, 387 + "%s", pinger_thread.t_name)); 388 388 if (IS_ERR_VALUE(rc)) { 389 389 CERROR("cannot start thread: %d\n", rc); 390 390 return rc;
+4 -4
drivers/staging/lustre/lustre/ptlrpc/ptlrpcd.c
··· 615 615 init_completion(&pc->pc_starting); 616 616 init_completion(&pc->pc_finishing); 617 617 spin_lock_init(&pc->pc_lock); 618 - strncpy(pc->pc_name, name, sizeof(pc->pc_name) - 1); 618 + strlcpy(pc->pc_name, name, sizeof(pc->pc_name)); 619 619 pc->pc_set = ptlrpc_prep_set(); 620 620 if (pc->pc_set == NULL) 621 621 GOTO(out, rc = -ENOMEM); ··· 638 638 GOTO(out, rc); 639 639 } 640 640 641 - task = kthread_run(ptlrpcd, pc, pc->pc_name); 641 + task = kthread_run(ptlrpcd, pc, "%s", pc->pc_name); 642 642 if (IS_ERR(task)) 643 643 GOTO(out, rc = PTR_ERR(task)); 644 644 ··· 745 745 if (ptlrpcds == NULL) 746 746 GOTO(out, rc = -ENOMEM); 747 747 748 - snprintf(name, 15, "ptlrpcd_rcv"); 748 + snprintf(name, sizeof(name), "ptlrpcd_rcv"); 749 749 set_bit(LIOD_RECOVERY, &ptlrpcds->pd_thread_rcv.pc_flags); 750 750 rc = ptlrpcd_start(-1, nthreads, name, &ptlrpcds->pd_thread_rcv); 751 751 if (rc < 0) ··· 764 764 * unnecessary dependency. But how to distribute async RPCs load 765 765 * among all the ptlrpc daemons becomes another trouble. */ 766 766 for (i = 0; i < nthreads; i++) { 767 - snprintf(name, 15, "ptlrpcd_%d", i); 767 + snprintf(name, sizeof(name), "ptlrpcd_%d", i); 768 768 rc = ptlrpcd_start(i, nthreads, name, &ptlrpcds->pd_threads[i]); 769 769 if (rc < 0) 770 770 GOTO(out, rc);
+2 -2
drivers/staging/lustre/lustre/ptlrpc/sec_bulk.c
··· 59 59 ****************************************/ 60 60 61 61 62 - #define PTRS_PER_PAGE (PAGE_CACHE_SIZE / sizeof(void *)) 63 - #define PAGES_PER_POOL (PTRS_PER_PAGE) 62 + #define POINTERS_PER_PAGE (PAGE_CACHE_SIZE / sizeof(void *)) 63 + #define PAGES_PER_POOL (POINTERS_PER_PAGE) 64 64 65 65 #define IDLE_IDX_MAX (100) 66 66 #define IDLE_IDX_WEIGHT (3)
+3 -3
drivers/staging/lustre/lustre/ptlrpc/service.c
··· 2718 2718 spin_unlock(&svcpt->scp_lock); 2719 2719 2720 2720 if (svcpt->scp_cpt >= 0) { 2721 - snprintf(thread->t_name, PTLRPC_THR_NAME_LEN, "%s%02d_%03d", 2721 + snprintf(thread->t_name, sizeof(thread->t_name), "%s%02d_%03d", 2722 2722 svc->srv_thread_name, svcpt->scp_cpt, thread->t_id); 2723 2723 } else { 2724 - snprintf(thread->t_name, PTLRPC_THR_NAME_LEN, "%s_%04d", 2724 + snprintf(thread->t_name, sizeof(thread->t_name), "%s_%04d", 2725 2725 svc->srv_thread_name, thread->t_id); 2726 2726 } 2727 2727 2728 2728 CDEBUG(D_RPCTRACE, "starting thread '%s'\n", thread->t_name); 2729 - rc = PTR_ERR(kthread_run(ptlrpc_main, thread, thread->t_name)); 2729 + rc = PTR_ERR(kthread_run(ptlrpc_main, thread, "%s", thread->t_name)); 2730 2730 if (IS_ERR_VALUE(rc)) { 2731 2731 CERROR("cannot start thread '%s': rc %d\n", 2732 2732 thread->t_name, rc);
+1 -1
drivers/staging/rtl8188eu/core/rtw_ieee80211.c
··· 157 157 158 158 *frlen = *frlen + (len + 2); 159 159 160 - return pbuf + len + 2; 161 160 _func_exit_; 161 + return pbuf + len + 2; 162 162 } 163 163 164 164 inline u8 *rtw_set_ie_ch_switch (u8 *buf, u32 *buf_len, u8 ch_switch_mode,
+7 -7
drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
··· 1827 1827 1828 1828 #ifdef CONFIG_88EU_P2P 1829 1829 1830 - static int get_reg_classes_full_count(struct p2p_channels channel_list) 1830 + static int get_reg_classes_full_count(struct p2p_channels *channel_list) 1831 1831 { 1832 1832 int cnt = 0; 1833 1833 int i; 1834 1834 1835 - for (i = 0; i < channel_list.reg_classes; i++) { 1836 - cnt += channel_list.reg_class[i].channels; 1835 + for (i = 0; i < channel_list->reg_classes; i++) { 1836 + cnt += channel_list->reg_class[i].channels; 1837 1837 } 1838 1838 1839 1839 return cnt; ··· 2065 2065 /* + number of channels in all classes */ 2066 2066 len_channellist_attr = 3 2067 2067 + (1 + 1) * (u16)(pmlmeext->channel_list.reg_classes) 2068 - + get_reg_classes_full_count(pmlmeext->channel_list); 2068 + + get_reg_classes_full_count(&pmlmeext->channel_list); 2069 2069 2070 2070 *(__le16 *)(p2pie + p2pielen) = cpu_to_le16(len_channellist_attr); 2071 2071 p2pielen += 2; ··· 2437 2437 /* + number of channels in all classes */ 2438 2438 len_channellist_attr = 3 2439 2439 + (1 + 1) * (u16)pmlmeext->channel_list.reg_classes 2440 - + get_reg_classes_full_count(pmlmeext->channel_list); 2440 + + get_reg_classes_full_count(&pmlmeext->channel_list); 2441 2441 2442 2442 *(__le16 *)(p2pie + p2pielen) = cpu_to_le16(len_channellist_attr); 2443 2443 ··· 2859 2859 /* + number of channels in all classes */ 2860 2860 len_channellist_attr = 3 2861 2861 + (1 + 1) * (u16)pmlmeext->channel_list.reg_classes 2862 - + get_reg_classes_full_count(pmlmeext->channel_list); 2862 + + get_reg_classes_full_count(&pmlmeext->channel_list); 2863 2863 2864 2864 *(__le16 *)(p2pie + p2pielen) = cpu_to_le16(len_channellist_attr); 2865 2865 ··· 3120 3120 /* + number of channels in all classes */ 3121 3121 len_channellist_attr = 3 3122 3122 + (1 + 1) * (u16)pmlmeext->channel_list.reg_classes 3123 - + get_reg_classes_full_count(pmlmeext->channel_list); 3123 + + get_reg_classes_full_count(&pmlmeext->channel_list); 3124 3124 3125 3125 *(__le16 *)(p2pie + p2pielen) = cpu_to_le16(len_channellist_attr); 3126 3126 p2pielen += 2;
+1 -1
drivers/staging/rtl8188eu/core/rtw_wlan_util.c
··· 631 631 inx[0] = 0; inx[1] = 1; inx[2] = 2; inx[3] = 3; 632 632 633 633 if (pregpriv->wifi_spec == 1) { 634 - u32 j, tmp, change_inx; 634 + u32 j, tmp, change_inx = false; 635 635 636 636 /* entry indx: 0->vo, 1->vi, 2->be, 3->bk. */ 637 637 for (i = 0; i < 4; i++) {
+1 -1
drivers/staging/rtl8188eu/include/odm.h
··· 1010 1010 #define DM_false_ALARM_THRESH_LOW 400 1011 1011 #define DM_false_ALARM_THRESH_HIGH 1000 1012 1012 1013 - #define DM_DIG_MAX_NIC 0x3e 1013 + #define DM_DIG_MAX_NIC 0x4e 1014 1014 #define DM_DIG_MIN_NIC 0x1e /* 0x22/0x1c */ 1015 1015 1016 1016 #define DM_DIG_MAX_AP 0x32
+1 -1
drivers/staging/rtl8188eu/include/rtl8188e_hal.h
··· 188 188 189 189 struct txpowerinfo24g { 190 190 u8 IndexCCK_Base[MAX_RF_PATH][MAX_CHNL_GROUP_24G]; 191 - u8 IndexBW40_Base[MAX_RF_PATH][MAX_CHNL_GROUP_24G-1]; 191 + u8 IndexBW40_Base[MAX_RF_PATH][MAX_CHNL_GROUP_24G]; 192 192 /* If only one tx, only BW20 and OFDM are used. */ 193 193 s8 CCK_Diff[MAX_RF_PATH][MAX_TX_COUNT]; 194 194 s8 OFDM_Diff[MAX_RF_PATH][MAX_TX_COUNT];
+1
drivers/staging/rtl8188eu/include/rtw_mlme_ext.h
··· 870 870 {0, NULL}, 871 871 {0, NULL}, 872 872 {0, &rtw_cpwm_event_callback}, 873 + {0, NULL}, 873 874 }; 874 875 875 876 #endif/* _RTL_MLME_EXT_C_ */
+2 -2
drivers/staging/vt6656/card.c
··· 172 172 if (!CARDbIsOFDMinBasicRate(pDevice)) { 173 173 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO 174 174 "swGetOFDMControlRate:(NO OFDM) %d\n", wRateIdx); 175 - if (wRateIdx > RATE_24M) 176 - wRateIdx = RATE_24M; 175 + if (wRateIdx > RATE_24M) 176 + wRateIdx = RATE_24M; 177 177 return wRateIdx; 178 178 } 179 179
+1 -1
drivers/staging/xillybus/xillybus_core.c
··· 2054 2054 NULL, 2055 2055 MKDEV(major, i), 2056 2056 NULL, 2057 - devname); 2057 + "%s", devname); 2058 2058 2059 2059 if (IS_ERR(device)) { 2060 2060 pr_warn("xillybus: Failed to create %s "
-1
drivers/staging/zram/zram_drv.c
··· 981 981 MODULE_LICENSE("Dual BSD/GPL"); 982 982 MODULE_AUTHOR("Nitin Gupta <ngupta@vflare.org>"); 983 983 MODULE_DESCRIPTION("Compressed RAM Block Device"); 984 - MODULE_ALIAS("devname:zram");