aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-09-23 15:53:07 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-09-23 15:53:07 -0400
commit9d23108df359e572a0dca0b631bfee9f5e0fa9ea (patch)
tree3af88906d9ebb51aedb4fa067cd20cdac2f1ac04
parente04a0a5ab92d4f74d29dd749e9de8d51ee94b3da (diff)
parent617408101362c830779b8b4c7eca9efefe0beab1 (diff)
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 ...
-rw-r--r--drivers/iio/accel/bma180.c4
-rw-r--r--drivers/iio/adc/at91_adc.c11
-rw-r--r--drivers/iio/buffer_cb.c2
-rw-r--r--drivers/iio/dac/mcp4725.c12
-rw-r--r--drivers/iio/iio_core.h4
-rw-r--r--drivers/iio/industrialio-buffer.c30
-rw-r--r--drivers/iio/industrialio-core.c31
-rw-r--r--drivers/iio/industrialio-event.c20
-rw-r--r--drivers/iio/temperature/tmp006.c6
-rw-r--r--drivers/staging/comedi/Kconfig33
-rw-r--r--drivers/staging/dgap/dgap_driver.c17
-rw-r--r--drivers/staging/dgnc/dgnc_driver.c4
-rw-r--r--drivers/staging/iio/Kconfig2
-rw-r--r--drivers/staging/iio/light/isl29018.c1
-rw-r--r--drivers/staging/iio/magnetometer/hmc5843.c2
-rw-r--r--drivers/staging/iio/meter/ade7854-spi.c2
-rw-r--r--drivers/staging/line6/toneport.c10
-rw-r--r--drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c2
-rw-r--r--drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c2
-rw-r--r--drivers/staging/lustre/lustre/Kconfig4
-rw-r--r--drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c4
-rw-r--r--drivers/staging/lustre/lustre/libcfs/workitem.c2
-rw-r--r--drivers/staging/lustre/lustre/ptlrpc/pinger.c4
-rw-r--r--drivers/staging/lustre/lustre/ptlrpc/ptlrpcd.c8
-rw-r--r--drivers/staging/lustre/lustre/ptlrpc/sec_bulk.c4
-rw-r--r--drivers/staging/lustre/lustre/ptlrpc/service.c6
-rw-r--r--drivers/staging/rtl8188eu/core/rtw_ieee80211.c2
-rw-r--r--drivers/staging/rtl8188eu/core/rtw_mlme_ext.c14
-rw-r--r--drivers/staging/rtl8188eu/core/rtw_wlan_util.c2
-rw-r--r--drivers/staging/rtl8188eu/include/odm.h2
-rw-r--r--drivers/staging/rtl8188eu/include/rtl8188e_hal.h2
-rw-r--r--drivers/staging/rtl8188eu/include/rtw_mlme_ext.h1
-rw-r--r--drivers/staging/vt6656/card.c4
-rw-r--r--drivers/staging/xillybus/xillybus_core.c2
-rw-r--r--drivers/staging/zram/zram_drv.c1
35 files changed, 160 insertions, 97 deletions
diff --git a/drivers/iio/accel/bma180.c b/drivers/iio/accel/bma180.c
index 12e32e6b4103..81e3dc260993 100644
--- a/drivers/iio/accel/bma180.c
+++ b/drivers/iio/accel/bma180.c
@@ -620,7 +620,7 @@ static int bma180_remove(struct i2c_client *client)
620#ifdef CONFIG_PM_SLEEP 620#ifdef CONFIG_PM_SLEEP
621static int bma180_suspend(struct device *dev) 621static 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 struct bma180_data *data = iio_priv(indio_dev); 624 struct bma180_data *data = iio_priv(indio_dev);
625 int ret; 625 int ret;
626 626
@@ -633,7 +633,7 @@ static int bma180_suspend(struct device *dev)
633 633
634static int bma180_resume(struct device *dev) 634static 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 struct bma180_data *data = iio_priv(indio_dev); 637 struct bma180_data *data = iio_priv(indio_dev);
638 int ret; 638 int ret;
639 639
diff --git a/drivers/iio/adc/at91_adc.c b/drivers/iio/adc/at91_adc.c
index 84be63bdf038..0f16b553e063 100644
--- a/drivers/iio/adc/at91_adc.c
+++ b/drivers/iio/adc/at91_adc.c
@@ -556,7 +556,7 @@ static const struct iio_info at91_adc_info = {
556 556
557static int at91_adc_probe(struct platform_device *pdev) 557static 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 int ret; 560 int ret;
561 struct iio_dev *idev; 561 struct iio_dev *idev;
562 struct at91_adc_state *st; 562 struct at91_adc_state *st;
@@ -649,6 +649,7 @@ static int at91_adc_probe(struct platform_device *pdev)
649 */ 649 */
650 mstrclk = clk_get_rate(st->clk); 650 mstrclk = clk_get_rate(st->clk);
651 adc_clk = clk_get_rate(st->adc_clk); 651 adc_clk = clk_get_rate(st->adc_clk);
652 adc_clk_khz = adc_clk / 1000;
652 prsc = (mstrclk / (2 * adc_clk)) - 1; 653 prsc = (mstrclk / (2 * adc_clk)) - 1;
653 654
654 if (!st->startup_time) { 655 if (!st->startup_time) {
@@ -662,15 +663,15 @@ static int at91_adc_probe(struct platform_device *pdev)
662 * defined in the electrical characteristics of the board, divided by 8. 663 * defined in the electrical characteristics of the board, divided by 8.
663 * The formula thus is : Startup Time = (ticks + 1) * 8 / ADC Clock 664 * The formula thus is : Startup Time = (ticks + 1) * 8 / ADC Clock
664 */ 665 */
665 ticks = round_up((st->startup_time * adc_clk / 666 ticks = round_up((st->startup_time * adc_clk_khz /
666 1000000) - 1, 8) / 8; 667 1000) - 1, 8) / 8;
667 /* 668 /*
668 * a minimal Sample and Hold Time is necessary for the ADC to guarantee 669 * a minimal Sample and Hold Time is necessary for the ADC to guarantee
669 * the best converted final value between two channels selection 670 * the best converted final value between two channels selection
670 * The formula thus is : Sample and Hold Time = (shtim + 1) / ADCClock 671 * The formula thus is : Sample and Hold Time = (shtim + 1) / ADCClock
671 */ 672 */
672 shtim = round_up((st->sample_hold_time * adc_clk / 673 shtim = round_up((st->sample_hold_time * adc_clk_khz /
673 1000000) - 1, 1); 674 1000) - 1, 1);
674 675
675 reg = AT91_ADC_PRESCAL_(prsc) & st->registers->mr_prescal_mask; 676 reg = AT91_ADC_PRESCAL_(prsc) & st->registers->mr_prescal_mask;
676 reg |= AT91_ADC_STARTUP_(ticks) & st->registers->mr_startup_mask; 677 reg |= AT91_ADC_STARTUP_(ticks) & st->registers->mr_startup_mask;
diff --git a/drivers/iio/buffer_cb.c b/drivers/iio/buffer_cb.c
index 9d19ba74f22b..415f3c6efd72 100644
--- a/drivers/iio/buffer_cb.c
+++ b/drivers/iio/buffer_cb.c
@@ -41,6 +41,8 @@ struct iio_cb_buffer *iio_channel_get_all_cb(struct device *dev,
41 goto error_ret; 41 goto error_ret;
42 } 42 }
43 43
44 iio_buffer_init(&cb_buff->buffer);
45
44 cb_buff->private = private; 46 cb_buff->private = private;
45 cb_buff->cb = cb; 47 cb_buff->cb = cb;
46 cb_buff->buffer.access = &iio_cb_access; 48 cb_buff->buffer.access = &iio_cb_access;
diff --git a/drivers/iio/dac/mcp4725.c b/drivers/iio/dac/mcp4725.c
index 1f4a48e6a82c..1397b6e0e414 100644
--- a/drivers/iio/dac/mcp4725.c
+++ b/drivers/iio/dac/mcp4725.c
@@ -37,21 +37,21 @@ struct mcp4725_data {
37 37
38static int mcp4725_suspend(struct device *dev) 38static int mcp4725_suspend(struct device *dev)
39{ 39{
40 struct iio_dev *indio_dev = dev_to_iio_dev(dev); 40 struct mcp4725_data *data = iio_priv(i2c_get_clientdata(
41 struct mcp4725_data *data = iio_priv(indio_dev); 41 to_i2c_client(dev)));
42 u8 outbuf[2]; 42 u8 outbuf[2];
43 43
44 outbuf[0] = (data->powerdown_mode + 1) << 4; 44 outbuf[0] = (data->powerdown_mode + 1) << 4;
45 outbuf[1] = 0; 45 outbuf[1] = 0;
46 data->powerdown = true; 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
51static int mcp4725_resume(struct device *dev) 51static int mcp4725_resume(struct device *dev)
52{ 52{
53 struct iio_dev *indio_dev = dev_to_iio_dev(dev); 53 struct mcp4725_data *data = iio_priv(i2c_get_clientdata(
54 struct mcp4725_data *data = iio_priv(indio_dev); 54 to_i2c_client(dev)));
55 u8 outbuf[2]; 55 u8 outbuf[2];
56 56
57 /* restore previous DAC value */ 57 /* restore previous DAC value */
@@ -59,7 +59,7 @@ static int mcp4725_resume(struct device *dev)
59 outbuf[1] = data->dac_value & 0xff; 59 outbuf[1] = data->dac_value & 0xff;
60 data->powerdown = false; 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#ifdef CONFIG_PM_SLEEP 65#ifdef CONFIG_PM_SLEEP
diff --git a/drivers/iio/iio_core.h b/drivers/iio/iio_core.h
index 05c1b74502a3..9b32253b824b 100644
--- a/drivers/iio/iio_core.h
+++ b/drivers/iio/iio_core.h
@@ -49,11 +49,15 @@ ssize_t iio_buffer_read_first_n_outer(struct file *filp, char __user *buf,
49#define iio_buffer_poll_addr (&iio_buffer_poll) 49#define iio_buffer_poll_addr (&iio_buffer_poll)
50#define iio_buffer_read_first_n_outer_addr (&iio_buffer_read_first_n_outer) 50#define iio_buffer_read_first_n_outer_addr (&iio_buffer_read_first_n_outer)
51 51
52void iio_disable_all_buffers(struct iio_dev *indio_dev);
53
52#else 54#else
53 55
54#define iio_buffer_poll_addr NULL 56#define iio_buffer_poll_addr NULL
55#define iio_buffer_read_first_n_outer_addr NULL 57#define iio_buffer_read_first_n_outer_addr NULL
56 58
59static inline void iio_disable_all_buffers(struct iio_dev *indio_dev) {}
60
57#endif 61#endif
58 62
59int iio_device_register_eventset(struct iio_dev *indio_dev); 63int iio_device_register_eventset(struct iio_dev *indio_dev);
diff --git a/drivers/iio/industrialio-buffer.c b/drivers/iio/industrialio-buffer.c
index e73033f3839a..2710f7245c3b 100644
--- a/drivers/iio/industrialio-buffer.c
+++ b/drivers/iio/industrialio-buffer.c
@@ -460,6 +460,25 @@ static int iio_compute_scan_bytes(struct iio_dev *indio_dev, const long *mask,
460 return bytes; 460 return bytes;
461} 461}
462 462
463void 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
463int iio_update_buffers(struct iio_dev *indio_dev, 482int iio_update_buffers(struct iio_dev *indio_dev,
464 struct iio_buffer *insert_buffer, 483 struct iio_buffer *insert_buffer,
465 struct iio_buffer *remove_buffer) 484 struct iio_buffer *remove_buffer)
@@ -528,8 +547,15 @@ int iio_update_buffers(struct iio_dev *indio_dev,
528 * Note can only occur when adding a buffer. 547 * Note can only occur when adding a buffer.
529 */ 548 */
530 list_del(&insert_buffer->buffer_list); 549 list_del(&insert_buffer->buffer_list);
531 indio_dev->active_scan_mask = old_mask; 550 if (old_mask) {
532 success = -EINVAL; 551 indio_dev->active_scan_mask = old_mask;
552 success = -EINVAL;
553 }
554 else {
555 kfree(compound_mask);
556 ret = -EINVAL;
557 goto error_ret;
558 }
533 } 559 }
534 } else { 560 } else {
535 indio_dev->active_scan_mask = compound_mask; 561 indio_dev->active_scan_mask = compound_mask;
diff --git a/drivers/iio/industrialio-core.c b/drivers/iio/industrialio-core.c
index 97f0297b120f..8e84cd522e49 100644
--- a/drivers/iio/industrialio-core.c
+++ b/drivers/iio/industrialio-core.c
@@ -848,8 +848,6 @@ static void iio_device_unregister_sysfs(struct iio_dev *indio_dev)
848static void iio_dev_release(struct device *device) 848static void iio_dev_release(struct device *device)
849{ 849{
850 struct iio_dev *indio_dev = dev_to_iio_dev(device); 850 struct iio_dev *indio_dev = dev_to_iio_dev(device);
851 if (indio_dev->chrdev.dev)
852 cdev_del(&indio_dev->chrdev);
853 if (indio_dev->modes & INDIO_BUFFER_TRIGGERED) 851 if (indio_dev->modes & INDIO_BUFFER_TRIGGERED)
854 iio_device_unregister_trigger_consumer(indio_dev); 852 iio_device_unregister_trigger_consumer(indio_dev);
855 iio_device_unregister_eventset(indio_dev); 853 iio_device_unregister_eventset(indio_dev);
@@ -970,6 +968,8 @@ static int iio_chrdev_open(struct inode *inode, struct file *filp)
970 if (test_and_set_bit(IIO_BUSY_BIT_POS, &indio_dev->flags)) 968 if (test_and_set_bit(IIO_BUSY_BIT_POS, &indio_dev->flags))
971 return -EBUSY; 969 return -EBUSY;
972 970
971 iio_device_get(indio_dev);
972
973 filp->private_data = indio_dev; 973 filp->private_data = indio_dev;
974 974
975 return 0; 975 return 0;
@@ -983,6 +983,8 @@ static int iio_chrdev_release(struct inode *inode, struct file *filp)
983 struct iio_dev *indio_dev = container_of(inode->i_cdev, 983 struct iio_dev *indio_dev = container_of(inode->i_cdev,
984 struct iio_dev, chrdev); 984 struct iio_dev, chrdev);
985 clear_bit(IIO_BUSY_BIT_POS, &indio_dev->flags); 985 clear_bit(IIO_BUSY_BIT_POS, &indio_dev->flags);
986 iio_device_put(indio_dev);
987
986 return 0; 988 return 0;
987} 989}
988 990
@@ -1052,18 +1054,20 @@ int iio_device_register(struct iio_dev *indio_dev)
1052 indio_dev->setup_ops == NULL) 1054 indio_dev->setup_ops == NULL)
1053 indio_dev->setup_ops = &noop_ring_setup_ops; 1055 indio_dev->setup_ops = &noop_ring_setup_ops;
1054 1056
1055 ret = device_add(&indio_dev->dev);
1056 if (ret < 0)
1057 goto error_unreg_eventset;
1058 cdev_init(&indio_dev->chrdev, &iio_buffer_fileops); 1057 cdev_init(&indio_dev->chrdev, &iio_buffer_fileops);
1059 indio_dev->chrdev.owner = indio_dev->info->driver_module; 1058 indio_dev->chrdev.owner = indio_dev->info->driver_module;
1059 indio_dev->chrdev.kobj.parent = &indio_dev->dev.kobj;
1060 ret = cdev_add(&indio_dev->chrdev, indio_dev->dev.devt, 1); 1060 ret = cdev_add(&indio_dev->chrdev, indio_dev->dev.devt, 1);
1061 if (ret < 0) 1061 if (ret < 0)
1062 goto error_del_device; 1062 goto error_unreg_eventset;
1063 return 0;
1064 1063
1065error_del_device: 1064 ret = device_add(&indio_dev->dev);
1066 device_del(&indio_dev->dev); 1065 if (ret < 0)
1066 goto error_cdev_del;
1067
1068 return 0;
1069error_cdev_del:
1070 cdev_del(&indio_dev->chrdev);
1067error_unreg_eventset: 1071error_unreg_eventset:
1068 iio_device_unregister_eventset(indio_dev); 1072 iio_device_unregister_eventset(indio_dev);
1069error_free_sysfs: 1073error_free_sysfs:
@@ -1078,9 +1082,16 @@ EXPORT_SYMBOL(iio_device_register);
1078void iio_device_unregister(struct iio_dev *indio_dev) 1082void iio_device_unregister(struct iio_dev *indio_dev)
1079{ 1083{
1080 mutex_lock(&indio_dev->info_exist_lock); 1084 mutex_lock(&indio_dev->info_exist_lock);
1085
1086 device_del(&indio_dev->dev);
1087
1088 if (indio_dev->chrdev.dev)
1089 cdev_del(&indio_dev->chrdev);
1090
1091 iio_disable_all_buffers(indio_dev);
1092
1081 indio_dev->info = NULL; 1093 indio_dev->info = NULL;
1082 mutex_unlock(&indio_dev->info_exist_lock); 1094 mutex_unlock(&indio_dev->info_exist_lock);
1083 device_del(&indio_dev->dev);
1084} 1095}
1085EXPORT_SYMBOL(iio_device_unregister); 1096EXPORT_SYMBOL(iio_device_unregister);
1086subsys_initcall(iio_init); 1097subsys_initcall(iio_init);
diff --git a/drivers/iio/industrialio-event.c b/drivers/iio/industrialio-event.c
index 10aa9ef86cec..6be65ef5faa9 100644
--- a/drivers/iio/industrialio-event.c
+++ b/drivers/iio/industrialio-event.c
@@ -72,7 +72,8 @@ EXPORT_SYMBOL(iio_push_event);
72static unsigned int iio_event_poll(struct file *filep, 72static unsigned int iio_event_poll(struct file *filep,
73 struct poll_table_struct *wait) 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 unsigned int events = 0; 77 unsigned int events = 0;
77 78
78 poll_wait(filep, &ev_int->wait, wait); 79 poll_wait(filep, &ev_int->wait, wait);
@@ -90,7 +91,8 @@ static ssize_t iio_event_chrdev_read(struct file *filep,
90 size_t count, 91 size_t count,
91 loff_t *f_ps) 92 loff_t *f_ps)
92{ 93{
93 struct iio_event_interface *ev_int = filep->private_data; 94 struct iio_dev *indio_dev = filep->private_data;
95 struct iio_event_interface *ev_int = indio_dev->event_interface;
94 unsigned int copied; 96 unsigned int copied;
95 int ret; 97 int ret;
96 98
@@ -121,7 +123,8 @@ error_unlock:
121 123
122static int iio_event_chrdev_release(struct inode *inode, struct file *filep) 124static int iio_event_chrdev_release(struct inode *inode, struct file *filep)
123{ 125{
124 struct iio_event_interface *ev_int = filep->private_data; 126 struct iio_dev *indio_dev = filep->private_data;
127 struct iio_event_interface *ev_int = indio_dev->event_interface;
125 128
126 spin_lock_irq(&ev_int->wait.lock); 129 spin_lock_irq(&ev_int->wait.lock);
127 __clear_bit(IIO_BUSY_BIT_POS, &ev_int->flags); 130 __clear_bit(IIO_BUSY_BIT_POS, &ev_int->flags);
@@ -133,6 +136,8 @@ static int iio_event_chrdev_release(struct inode *inode, struct file *filep)
133 kfifo_reset_out(&ev_int->det_events); 136 kfifo_reset_out(&ev_int->det_events);
134 spin_unlock_irq(&ev_int->wait.lock); 137 spin_unlock_irq(&ev_int->wait.lock);
135 138
139 iio_device_put(indio_dev);
140
136 return 0; 141 return 0;
137} 142}
138 143
@@ -158,12 +163,15 @@ int iio_event_getfd(struct iio_dev *indio_dev)
158 return -EBUSY; 163 return -EBUSY;
159 } 164 }
160 spin_unlock_irq(&ev_int->wait.lock); 165 spin_unlock_irq(&ev_int->wait.lock);
161 fd = anon_inode_getfd("iio:event", 166 iio_device_get(indio_dev);
162 &iio_event_chrdev_fileops, ev_int, O_RDONLY); 167
168 fd = anon_inode_getfd("iio:event", &iio_event_chrdev_fileops,
169 indio_dev, O_RDONLY);
163 if (fd < 0) { 170 if (fd < 0) {
164 spin_lock_irq(&ev_int->wait.lock); 171 spin_lock_irq(&ev_int->wait.lock);
165 __clear_bit(IIO_BUSY_BIT_POS, &ev_int->flags); 172 __clear_bit(IIO_BUSY_BIT_POS, &ev_int->flags);
166 spin_unlock_irq(&ev_int->wait.lock); 173 spin_unlock_irq(&ev_int->wait.lock);
174 iio_device_put(indio_dev);
167 } 175 }
168 return fd; 176 return fd;
169} 177}
@@ -276,7 +284,7 @@ static int iio_device_add_event_sysfs(struct iio_dev *indio_dev,
276 goto error_ret; 284 goto error_ret;
277 } 285 }
278 if (chan->modified) 286 if (chan->modified)
279 mask = IIO_MOD_EVENT_CODE(chan->type, 0, chan->channel, 287 mask = IIO_MOD_EVENT_CODE(chan->type, 0, chan->channel2,
280 i/IIO_EV_DIR_MAX, 288 i/IIO_EV_DIR_MAX,
281 i%IIO_EV_DIR_MAX); 289 i%IIO_EV_DIR_MAX);
282 else if (chan->differential) 290 else if (chan->differential)
diff --git a/drivers/iio/temperature/tmp006.c b/drivers/iio/temperature/tmp006.c
index 64ccde3f1f7a..6d63883da1ab 100644
--- a/drivers/iio/temperature/tmp006.c
+++ b/drivers/iio/temperature/tmp006.c
@@ -255,12 +255,14 @@ static int tmp006_remove(struct i2c_client *client)
255#ifdef CONFIG_PM_SLEEP 255#ifdef CONFIG_PM_SLEEP
256static int tmp006_suspend(struct device *dev) 256static 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
261static int tmp006_resume(struct device *dev) 262static 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 return i2c_smbus_write_word_swapped(data->client, TMP006_CONFIG, 266 return i2c_smbus_write_word_swapped(data->client, TMP006_CONFIG,
265 data->config | TMP006_CONFIG_MOD_MASK); 267 data->config | TMP006_CONFIG_MOD_MASK);
266} 268}
diff --git a/drivers/staging/comedi/Kconfig b/drivers/staging/comedi/Kconfig
index a84aab47a113..f73287eab373 100644
--- a/drivers/staging/comedi/Kconfig
+++ b/drivers/staging/comedi/Kconfig
@@ -96,6 +96,15 @@ config COMEDI_SKEL
96 To compile this driver as a module, choose M here: the module will be 96 To compile this driver as a module, choose M here: the module will be
97 called skel. 97 called skel.
98 98
99config 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
99endif # COMEDI_MISC_DRIVERS 108endif # COMEDI_MISC_DRIVERS
100 109
101menuconfig COMEDI_ISA_DRIVERS 110menuconfig COMEDI_ISA_DRIVERS
@@ -386,6 +395,14 @@ config COMEDI_DMM32AT
386 To compile this driver as a module, choose M here: the module will be 395 To compile this driver as a module, choose M here: the module will be
387 called dmm32at. 396 called dmm32at.
388 397
398config COMEDI_UNIOXX5
399 tristate "Fastwel UNIOxx-5 analog and digital io board support"
400 ---help---
401 Enable support for Fastwel UNIOxx-5 (analog and digital i/o) boards
402
403 To compile this driver as a module, choose M here: the module will be
404 called unioxx5.
405
389config COMEDI_FL512 406config COMEDI_FL512
390 tristate "FL512 ISA card support" 407 tristate "FL512 ISA card support"
391 ---help--- 408 ---help---
@@ -855,14 +872,6 @@ config COMEDI_DYNA_PCI10XX
855 To compile this driver as a module, choose M here: the module will be 872 To compile this driver as a module, choose M here: the module will be
856 called dyna_pci10xx. 873 called dyna_pci10xx.
857 874
858config COMEDI_UNIOXX5
859 tristate "Fastwel UNIOxx-5 analog and digital io board support"
860 ---help---
861 Enable support for Fastwel UNIOxx-5 (analog and digital i/o) boards
862
863 To compile this driver as a module, choose M here: the module will be
864 called unioxx5.
865
866config COMEDI_GSC_HPDI 875config COMEDI_GSC_HPDI
867 tristate "General Standards PCI-HPDI32 / PMC-HPDI32 support" 876 tristate "General Standards PCI-HPDI32 / PMC-HPDI32 support"
868 select COMEDI_FC 877 select COMEDI_FC
@@ -1085,14 +1094,6 @@ config COMEDI_S626
1085 To compile this driver as a module, choose M here: the module will be 1094 To compile this driver as a module, choose M here: the module will be
1086 called s626. 1095 called s626.
1087 1096
1088config COMEDI_SSV_DNP
1089 tristate "SSV Embedded Systems DIL/Net-PC support"
1090 ---help---
1091 Enable support for SSV Embedded Systems DIL/Net-PC
1092
1093 To compile this driver as a module, choose M here: the module will be
1094 called ssv_dnp.
1095
1096config COMEDI_MITE 1097config COMEDI_MITE
1097 depends on HAS_DMA 1098 depends on HAS_DMA
1098 tristate 1099 tristate
diff --git a/drivers/staging/dgap/dgap_driver.c b/drivers/staging/dgap/dgap_driver.c
index 724a685753dd..40ef785a0428 100644
--- a/drivers/staging/dgap/dgap_driver.c
+++ b/drivers/staging/dgap/dgap_driver.c
@@ -474,7 +474,7 @@ static void dgap_cleanup_board(struct board_t *brd)
474 474
475 DGAP_LOCK(dgap_global_lock, flags); 475 DGAP_LOCK(dgap_global_lock, flags);
476 brd->msgbuf = NULL; 476 brd->msgbuf = NULL;
477 printk(brd->msgbuf_head); 477 printk("%s", brd->msgbuf_head);
478 kfree(brd->msgbuf_head); 478 kfree(brd->msgbuf_head);
479 brd->msgbuf_head = NULL; 479 brd->msgbuf_head = NULL;
480 DGAP_UNLOCK(dgap_global_lock, flags); 480 DGAP_UNLOCK(dgap_global_lock, flags);
@@ -628,7 +628,7 @@ static int dgap_found_board(struct pci_dev *pdev, int id)
628 DPR_INIT(("dgap_scan(%d) - printing out the msgbuf\n", i)); 628 DPR_INIT(("dgap_scan(%d) - printing out the msgbuf\n", i));
629 DGAP_LOCK(dgap_global_lock, flags); 629 DGAP_LOCK(dgap_global_lock, flags);
630 brd->msgbuf = NULL; 630 brd->msgbuf = NULL;
631 printk(brd->msgbuf_head); 631 printk("%s", brd->msgbuf_head);
632 kfree(brd->msgbuf_head); 632 kfree(brd->msgbuf_head);
633 brd->msgbuf_head = NULL; 633 brd->msgbuf_head = NULL;
634 DGAP_UNLOCK(dgap_global_lock, flags); 634 DGAP_UNLOCK(dgap_global_lock, flags);
@@ -955,25 +955,28 @@ static void dgap_mbuf(struct board_t *brd, const char *fmt, ...) {
955 char buf[1024]; 955 char buf[1024];
956 int i; 956 int i;
957 unsigned long flags; 957 unsigned long flags;
958 size_t length;
958 959
959 DGAP_LOCK(dgap_global_lock, flags); 960 DGAP_LOCK(dgap_global_lock, flags);
960 961
961 /* Format buf using fmt and arguments contained in ap. */ 962 /* Format buf using fmt and arguments contained in ap. */
962 va_start(ap, fmt); 963 va_start(ap, fmt);
963 i = vsprintf(buf, fmt, ap); 964 i = vsnprintf(buf, sizeof(buf), fmt, ap);
964 va_end(ap); 965 va_end(ap);
965 966
966 DPR((buf)); 967 DPR((buf));
967 968
968 if (!brd || !brd->msgbuf) { 969 if (!brd || !brd->msgbuf) {
969 printk(buf); 970 printk("%s", buf);
970 DGAP_UNLOCK(dgap_global_lock, flags); 971 DGAP_UNLOCK(dgap_global_lock, flags);
971 return; 972 return;
972 } 973 }
973 974
974 memcpy(brd->msgbuf, buf, strlen(buf)); 975 length = strlen(buf) + 1;
975 brd->msgbuf += strlen(buf); 976 if (brd->msgbuf - brd->msgbuf_head < length)
976 *brd->msgbuf = 0; 977 length = brd->msgbuf - brd->msgbuf_head;
978 memcpy(brd->msgbuf, buf, length);
979 brd->msgbuf += length;
977 980
978 DGAP_UNLOCK(dgap_global_lock, flags); 981 DGAP_UNLOCK(dgap_global_lock, flags);
979} 982}
diff --git a/drivers/staging/dgnc/dgnc_driver.c b/drivers/staging/dgnc/dgnc_driver.c
index f8c1e22585d6..71d2b83cc3a1 100644
--- a/drivers/staging/dgnc/dgnc_driver.c
+++ b/drivers/staging/dgnc/dgnc_driver.c
@@ -454,7 +454,7 @@ static void dgnc_cleanup_board(struct board_t *brd)
454 454
455 DGNC_LOCK(dgnc_global_lock, flags); 455 DGNC_LOCK(dgnc_global_lock, flags);
456 brd->msgbuf = NULL; 456 brd->msgbuf = NULL;
457 printk(brd->msgbuf_head); 457 printk("%s", brd->msgbuf_head);
458 kfree(brd->msgbuf_head); 458 kfree(brd->msgbuf_head);
459 brd->msgbuf_head = NULL; 459 brd->msgbuf_head = NULL;
460 DGNC_UNLOCK(dgnc_global_lock, flags); 460 DGNC_UNLOCK(dgnc_global_lock, flags);
@@ -710,7 +710,7 @@ static int dgnc_found_board(struct pci_dev *pdev, int id)
710 DPR_INIT(("dgnc_scan(%d) - printing out the msgbuf\n", i)); 710 DPR_INIT(("dgnc_scan(%d) - printing out the msgbuf\n", i));
711 DGNC_LOCK(dgnc_global_lock, flags); 711 DGNC_LOCK(dgnc_global_lock, flags);
712 brd->msgbuf = NULL; 712 brd->msgbuf = NULL;
713 printk(brd->msgbuf_head); 713 printk("%s", brd->msgbuf_head);
714 kfree(brd->msgbuf_head); 714 kfree(brd->msgbuf_head);
715 brd->msgbuf_head = NULL; 715 brd->msgbuf_head = NULL;
716 DGNC_UNLOCK(dgnc_global_lock, flags); 716 DGNC_UNLOCK(dgnc_global_lock, flags);
diff --git a/drivers/staging/iio/Kconfig b/drivers/staging/iio/Kconfig
index db4d6dc03243..b36feb080cba 100644
--- a/drivers/staging/iio/Kconfig
+++ b/drivers/staging/iio/Kconfig
@@ -37,7 +37,7 @@ config IIO_SIMPLE_DUMMY_EVENTS
37 37
38config IIO_SIMPLE_DUMMY_BUFFER 38config IIO_SIMPLE_DUMMY_BUFFER
39 boolean "Buffered capture support" 39 boolean "Buffered capture support"
40 depends on IIO_KFIFO_BUF 40 select IIO_KFIFO_BUF
41 help 41 help
42 Add buffered data capture to the simple dummy driver. 42 Add buffered data capture to the simple dummy driver.
43 43
diff --git a/drivers/staging/iio/light/isl29018.c b/drivers/staging/iio/light/isl29018.c
index 351936c3efd6..e4998e4d4434 100644
--- a/drivers/staging/iio/light/isl29018.c
+++ b/drivers/staging/iio/light/isl29018.c
@@ -563,6 +563,7 @@ static int isl29018_probe(struct i2c_client *client,
563 mutex_init(&chip->lock); 563 mutex_init(&chip->lock);
564 564
565 chip->lux_scale = 1; 565 chip->lux_scale = 1;
566 chip->lux_uscale = 0;
566 chip->range = 1000; 567 chip->range = 1000;
567 chip->adc_bit = 16; 568 chip->adc_bit = 16;
568 chip->suspended = false; 569 chip->suspended = false;
diff --git a/drivers/staging/iio/magnetometer/hmc5843.c b/drivers/staging/iio/magnetometer/hmc5843.c
index d2748c329eae..c3f3f539e787 100644
--- a/drivers/staging/iio/magnetometer/hmc5843.c
+++ b/drivers/staging/iio/magnetometer/hmc5843.c
@@ -229,7 +229,7 @@ static int hmc5843_read_measurement(struct iio_dev *indio_dev,
229 if (result < 0) 229 if (result < 0)
230 return -EINVAL; 230 return -EINVAL;
231 231
232 *val = result; 232 *val = sign_extend32(result, 15);
233 return IIO_VAL_INT; 233 return IIO_VAL_INT;
234} 234}
235 235
diff --git a/drivers/staging/iio/meter/ade7854-spi.c b/drivers/staging/iio/meter/ade7854-spi.c
index a802cf2491d6..4c6d2041260b 100644
--- a/drivers/staging/iio/meter/ade7854-spi.c
+++ b/drivers/staging/iio/meter/ade7854-spi.c
@@ -299,7 +299,7 @@ static int ade7854_spi_probe(struct spi_device *spi)
299 if (ret) 299 if (ret)
300 iio_device_free(indio_dev); 300 iio_device_free(indio_dev);
301 301
302 return 0; 302 return ret;
303} 303}
304 304
305static int ade7854_spi_remove(struct spi_device *spi) 305static int ade7854_spi_remove(struct spi_device *spi)
diff --git a/drivers/staging/line6/toneport.c b/drivers/staging/line6/toneport.c
index 2f44d56700af..776d3632dc7d 100644
--- a/drivers/staging/line6/toneport.c
+++ b/drivers/staging/line6/toneport.c
@@ -244,13 +244,17 @@ static int snd_toneport_source_put(struct snd_kcontrol *kcontrol,
244 struct snd_line6_pcm *line6pcm = snd_kcontrol_chip(kcontrol); 244 struct snd_line6_pcm *line6pcm = snd_kcontrol_chip(kcontrol);
245 struct usb_line6_toneport *toneport = 245 struct usb_line6_toneport *toneport =
246 (struct usb_line6_toneport *)line6pcm->line6; 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 return 0; 253 return 0;
250 254
251 toneport->source = ucontrol->value.enumerated.item[0]; 255 toneport->source = source;
252 toneport_send_cmd(toneport->line6.usbdev, 256 toneport_send_cmd(toneport->line6.usbdev,
253 toneport_source_info[toneport->source].code, 0x0000); 257 toneport_source_info[source].code, 0x0000);
254 return 1; 258 return 1;
255} 259}
256 260
diff --git a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c
index 086ca3d7241b..26b49a24b3df 100644
--- a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c
+++ b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c
@@ -1802,7 +1802,7 @@ kiblnd_recv (lnet_ni_t *ni, void *private, lnet_msg_t *lntmsg, int delayed,
1802int 1802int
1803kiblnd_thread_start(int (*fn)(void *arg), void *arg, char *name) 1803kiblnd_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 if (IS_ERR(task)) 1807 if (IS_ERR(task))
1808 return PTR_ERR(task); 1808 return PTR_ERR(task);
diff --git a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c
index 2c581b7fa8ad..68a4f52ec998 100644
--- a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c
+++ b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c
@@ -1005,7 +1005,7 @@ ksocknal_send(lnet_ni_t *ni, void *private, lnet_msg_t *lntmsg)
1005int 1005int
1006ksocknal_thread_start(int (*fn)(void *arg), void *arg, char *name) 1006ksocknal_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 if (IS_ERR(task)) 1010 if (IS_ERR(task))
1011 return PTR_ERR(task); 1011 return PTR_ERR(task);
diff --git a/drivers/staging/lustre/lustre/Kconfig b/drivers/staging/lustre/lustre/Kconfig
index 4e898e491860..2156a44d0740 100644
--- a/drivers/staging/lustre/lustre/Kconfig
+++ b/drivers/staging/lustre/lustre/Kconfig
@@ -1,6 +1,6 @@
1config LUSTRE_FS 1config LUSTRE_FS
2 tristate "Lustre file system client support" 2 tristate "Lustre file system client support"
3 depends on INET && m 3 depends on INET && m && !MIPS && !XTENSA && !SUPERH
4 select LNET 4 select LNET
5 select CRYPTO 5 select CRYPTO
6 select CRYPTO_CRC32 6 select CRYPTO_CRC32
@@ -52,7 +52,7 @@ config LUSTRE_DEBUG_EXPENSIVE_CHECK
52config LUSTRE_TRANSLATE_ERRNOS 52config LUSTRE_TRANSLATE_ERRNOS
53 bool 53 bool
54 depends on LUSTRE_FS && !X86 54 depends on LUSTRE_FS && !X86
55 default true 55 default y
56 56
57config LUSTRE_LLITE_LLOOP 57config LUSTRE_LLITE_LLOOP
58 bool "Lustre virtual block device" 58 bool "Lustre virtual block device"
diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c b/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c
index 3916bda3004c..a100a0b96381 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c
@@ -800,9 +800,9 @@ static int ldlm_bl_thread_start(struct ldlm_bl_pool *blp)
800 800
801 init_completion(&bltd.bltd_comp); 801 init_completion(&bltd.bltd_comp);
802 bltd.bltd_num = atomic_read(&blp->blp_num_threads); 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 "ldlm_bl_%02d", bltd.bltd_num); 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 if (IS_ERR(task)) { 806 if (IS_ERR(task)) {
807 CERROR("cannot start LDLM thread ldlm_bl_%02d: rc %ld\n", 807 CERROR("cannot start LDLM thread ldlm_bl_%02d: rc %ld\n",
808 atomic_read(&blp->blp_num_threads), PTR_ERR(task)); 808 atomic_read(&blp->blp_num_threads), PTR_ERR(task));
diff --git a/drivers/staging/lustre/lustre/libcfs/workitem.c b/drivers/staging/lustre/lustre/libcfs/workitem.c
index 462172d1a756..1a55c81892e0 100644
--- a/drivers/staging/lustre/lustre/libcfs/workitem.c
+++ b/drivers/staging/lustre/lustre/libcfs/workitem.c
@@ -397,7 +397,7 @@ cfs_wi_sched_create(char *name, struct cfs_cpt_table *cptab,
397 sched->ws_name, sched->ws_nthreads); 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 if (!IS_ERR(task)) { 401 if (!IS_ERR(task)) {
402 nthrs--; 402 nthrs--;
403 continue; 403 continue;
diff --git a/drivers/staging/lustre/lustre/ptlrpc/pinger.c b/drivers/staging/lustre/lustre/ptlrpc/pinger.c
index 227a0ae9593b..5dec771d70ee 100644
--- a/drivers/staging/lustre/lustre/ptlrpc/pinger.c
+++ b/drivers/staging/lustre/lustre/ptlrpc/pinger.c
@@ -383,8 +383,8 @@ int ptlrpc_start_pinger(void)
383 383
384 /* CLONE_VM and CLONE_FILES just avoid a needless copy, because we 384 /* CLONE_VM and CLONE_FILES just avoid a needless copy, because we
385 * just drop the VM and FILES in cfs_daemonize_ctxt() right away. */ 385 * just drop the VM and FILES in cfs_daemonize_ctxt() right away. */
386 rc = PTR_ERR(kthread_run(ptlrpc_pinger_main, 386 rc = PTR_ERR(kthread_run(ptlrpc_pinger_main, &pinger_thread,
387 &pinger_thread, pinger_thread.t_name)); 387 "%s", pinger_thread.t_name));
388 if (IS_ERR_VALUE(rc)) { 388 if (IS_ERR_VALUE(rc)) {
389 CERROR("cannot start thread: %d\n", rc); 389 CERROR("cannot start thread: %d\n", rc);
390 return rc; 390 return rc;
diff --git a/drivers/staging/lustre/lustre/ptlrpc/ptlrpcd.c b/drivers/staging/lustre/lustre/ptlrpc/ptlrpcd.c
index fbdeff65d059..89c9be96f454 100644
--- a/drivers/staging/lustre/lustre/ptlrpc/ptlrpcd.c
+++ b/drivers/staging/lustre/lustre/ptlrpc/ptlrpcd.c
@@ -615,7 +615,7 @@ int ptlrpcd_start(int index, int max, const char *name, struct ptlrpcd_ctl *pc)
615 init_completion(&pc->pc_starting); 615 init_completion(&pc->pc_starting);
616 init_completion(&pc->pc_finishing); 616 init_completion(&pc->pc_finishing);
617 spin_lock_init(&pc->pc_lock); 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 pc->pc_set = ptlrpc_prep_set(); 619 pc->pc_set = ptlrpc_prep_set();
620 if (pc->pc_set == NULL) 620 if (pc->pc_set == NULL)
621 GOTO(out, rc = -ENOMEM); 621 GOTO(out, rc = -ENOMEM);
@@ -638,7 +638,7 @@ int ptlrpcd_start(int index, int max, const char *name, struct ptlrpcd_ctl *pc)
638 GOTO(out, rc); 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 if (IS_ERR(task)) 642 if (IS_ERR(task))
643 GOTO(out, rc = PTR_ERR(task)); 643 GOTO(out, rc = PTR_ERR(task));
644 644
@@ -745,7 +745,7 @@ static int ptlrpcd_init(void)
745 if (ptlrpcds == NULL) 745 if (ptlrpcds == NULL)
746 GOTO(out, rc = -ENOMEM); 746 GOTO(out, rc = -ENOMEM);
747 747
748 snprintf(name, 15, "ptlrpcd_rcv"); 748 snprintf(name, sizeof(name), "ptlrpcd_rcv");
749 set_bit(LIOD_RECOVERY, &ptlrpcds->pd_thread_rcv.pc_flags); 749 set_bit(LIOD_RECOVERY, &ptlrpcds->pd_thread_rcv.pc_flags);
750 rc = ptlrpcd_start(-1, nthreads, name, &ptlrpcds->pd_thread_rcv); 750 rc = ptlrpcd_start(-1, nthreads, name, &ptlrpcds->pd_thread_rcv);
751 if (rc < 0) 751 if (rc < 0)
@@ -764,7 +764,7 @@ static int ptlrpcd_init(void)
764 * unnecessary dependency. But how to distribute async RPCs load 764 * unnecessary dependency. But how to distribute async RPCs load
765 * among all the ptlrpc daemons becomes another trouble. */ 765 * among all the ptlrpc daemons becomes another trouble. */
766 for (i = 0; i < nthreads; i++) { 766 for (i = 0; i < nthreads; i++) {
767 snprintf(name, 15, "ptlrpcd_%d", i); 767 snprintf(name, sizeof(name), "ptlrpcd_%d", i);
768 rc = ptlrpcd_start(i, nthreads, name, &ptlrpcds->pd_threads[i]); 768 rc = ptlrpcd_start(i, nthreads, name, &ptlrpcds->pd_threads[i]);
769 if (rc < 0) 769 if (rc < 0)
770 GOTO(out, rc); 770 GOTO(out, rc);
diff --git a/drivers/staging/lustre/lustre/ptlrpc/sec_bulk.c b/drivers/staging/lustre/lustre/ptlrpc/sec_bulk.c
index e90c8fb7da6a..6547f46a7729 100644
--- a/drivers/staging/lustre/lustre/ptlrpc/sec_bulk.c
+++ b/drivers/staging/lustre/lustre/ptlrpc/sec_bulk.c
@@ -59,8 +59,8 @@
59 ****************************************/ 59 ****************************************/
60 60
61 61
62#define PTRS_PER_PAGE (PAGE_CACHE_SIZE / sizeof(void *)) 62#define POINTERS_PER_PAGE (PAGE_CACHE_SIZE / sizeof(void *))
63#define PAGES_PER_POOL (PTRS_PER_PAGE) 63#define PAGES_PER_POOL (POINTERS_PER_PAGE)
64 64
65#define IDLE_IDX_MAX (100) 65#define IDLE_IDX_MAX (100)
66#define IDLE_IDX_WEIGHT (3) 66#define IDLE_IDX_WEIGHT (3)
diff --git a/drivers/staging/lustre/lustre/ptlrpc/service.c b/drivers/staging/lustre/lustre/ptlrpc/service.c
index ac8b5fd2300b..acf75f3873d1 100644
--- a/drivers/staging/lustre/lustre/ptlrpc/service.c
+++ b/drivers/staging/lustre/lustre/ptlrpc/service.c
@@ -2718,15 +2718,15 @@ int ptlrpc_start_thread(struct ptlrpc_service_part *svcpt, int wait)
2718 spin_unlock(&svcpt->scp_lock); 2718 spin_unlock(&svcpt->scp_lock);
2719 2719
2720 if (svcpt->scp_cpt >= 0) { 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 svc->srv_thread_name, svcpt->scp_cpt, thread->t_id); 2722 svc->srv_thread_name, svcpt->scp_cpt, thread->t_id);
2723 } else { 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 svc->srv_thread_name, thread->t_id); 2725 svc->srv_thread_name, thread->t_id);
2726 } 2726 }
2727 2727
2728 CDEBUG(D_RPCTRACE, "starting thread '%s'\n", thread->t_name); 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 if (IS_ERR_VALUE(rc)) { 2730 if (IS_ERR_VALUE(rc)) {
2731 CERROR("cannot start thread '%s': rc %d\n", 2731 CERROR("cannot start thread '%s': rc %d\n",
2732 thread->t_name, rc); 2732 thread->t_name, rc);
diff --git a/drivers/staging/rtl8188eu/core/rtw_ieee80211.c b/drivers/staging/rtl8188eu/core/rtw_ieee80211.c
index 3605c5da822d..6fc77428e83a 100644
--- a/drivers/staging/rtl8188eu/core/rtw_ieee80211.c
+++ b/drivers/staging/rtl8188eu/core/rtw_ieee80211.c
@@ -157,8 +157,8 @@ _func_enter_;
157 157
158 *frlen = *frlen + (len + 2); 158 *frlen = *frlen + (len + 2);
159 159
160 return pbuf + len + 2;
161_func_exit_; 160_func_exit_;
161 return pbuf + len + 2;
162} 162}
163 163
164inline u8 *rtw_set_ie_ch_switch (u8 *buf, u32 *buf_len, u8 ch_switch_mode, 164inline u8 *rtw_set_ie_ch_switch (u8 *buf, u32 *buf_len, u8 ch_switch_mode,
diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
index 8b2ba26ba38d..4b2eb8e9b562 100644
--- a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
+++ b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
@@ -1827,13 +1827,13 @@ unsigned int OnAction_back(struct adapter *padapter, union recv_frame *precv_fra
1827 1827
1828#ifdef CONFIG_88EU_P2P 1828#ifdef CONFIG_88EU_P2P
1829 1829
1830static int get_reg_classes_full_count(struct p2p_channels channel_list) 1830static int get_reg_classes_full_count(struct p2p_channels *channel_list)
1831{ 1831{
1832 int cnt = 0; 1832 int cnt = 0;
1833 int i; 1833 int i;
1834 1834
1835 for (i = 0; i < channel_list.reg_classes; i++) { 1835 for (i = 0; i < channel_list->reg_classes; i++) {
1836 cnt += channel_list.reg_class[i].channels; 1836 cnt += channel_list->reg_class[i].channels;
1837 } 1837 }
1838 1838
1839 return cnt; 1839 return cnt;
@@ -2065,7 +2065,7 @@ void issue_p2p_GO_request(struct adapter *padapter, u8 *raddr)
2065 /* + number of channels in all classes */ 2065 /* + number of channels in all classes */
2066 len_channellist_attr = 3 2066 len_channellist_attr = 3
2067 + (1 + 1) * (u16)(pmlmeext->channel_list.reg_classes) 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 *(__le16 *)(p2pie + p2pielen) = cpu_to_le16(len_channellist_attr); 2070 *(__le16 *)(p2pie + p2pielen) = cpu_to_le16(len_channellist_attr);
2071 p2pielen += 2; 2071 p2pielen += 2;
@@ -2437,7 +2437,7 @@ static void issue_p2p_GO_response(struct adapter *padapter, u8 *raddr, u8 *frame
2437 /* + number of channels in all classes */ 2437 /* + number of channels in all classes */
2438 len_channellist_attr = 3 2438 len_channellist_attr = 3
2439 + (1 + 1) * (u16)pmlmeext->channel_list.reg_classes 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 *(__le16 *)(p2pie + p2pielen) = cpu_to_le16(len_channellist_attr); 2442 *(__le16 *)(p2pie + p2pielen) = cpu_to_le16(len_channellist_attr);
2443 2443
@@ -2859,7 +2859,7 @@ void issue_p2p_invitation_request(struct adapter *padapter, u8 *raddr)
2859 /* + number of channels in all classes */ 2859 /* + number of channels in all classes */
2860 len_channellist_attr = 3 2860 len_channellist_attr = 3
2861 + (1 + 1) * (u16)pmlmeext->channel_list.reg_classes 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 *(__le16 *)(p2pie + p2pielen) = cpu_to_le16(len_channellist_attr); 2864 *(__le16 *)(p2pie + p2pielen) = cpu_to_le16(len_channellist_attr);
2865 2865
@@ -3120,7 +3120,7 @@ void issue_p2p_invitation_response(struct adapter *padapter, u8 *raddr, u8 dialo
3120 /* + number of channels in all classes */ 3120 /* + number of channels in all classes */
3121 len_channellist_attr = 3 3121 len_channellist_attr = 3
3122 + (1 + 1) * (u16)pmlmeext->channel_list.reg_classes 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 *(__le16 *)(p2pie + p2pielen) = cpu_to_le16(len_channellist_attr); 3125 *(__le16 *)(p2pie + p2pielen) = cpu_to_le16(len_channellist_attr);
3126 p2pielen += 2; 3126 p2pielen += 2;
diff --git a/drivers/staging/rtl8188eu/core/rtw_wlan_util.c b/drivers/staging/rtl8188eu/core/rtw_wlan_util.c
index 013ea487e7ac..8018edd3d42e 100644
--- a/drivers/staging/rtl8188eu/core/rtw_wlan_util.c
+++ b/drivers/staging/rtl8188eu/core/rtw_wlan_util.c
@@ -631,7 +631,7 @@ void WMMOnAssocRsp(struct adapter *padapter)
631 inx[0] = 0; inx[1] = 1; inx[2] = 2; inx[3] = 3; 631 inx[0] = 0; inx[1] = 1; inx[2] = 2; inx[3] = 3;
632 632
633 if (pregpriv->wifi_spec == 1) { 633 if (pregpriv->wifi_spec == 1) {
634 u32 j, tmp, change_inx; 634 u32 j, tmp, change_inx = false;
635 635
636 /* entry indx: 0->vo, 1->vi, 2->be, 3->bk. */ 636 /* entry indx: 0->vo, 1->vi, 2->be, 3->bk. */
637 for (i = 0; i < 4; i++) { 637 for (i = 0; i < 4; i++) {
diff --git a/drivers/staging/rtl8188eu/include/odm.h b/drivers/staging/rtl8188eu/include/odm.h
index 2bfe72841921..4787bacdcad8 100644
--- a/drivers/staging/rtl8188eu/include/odm.h
+++ b/drivers/staging/rtl8188eu/include/odm.h
@@ -1010,7 +1010,7 @@ enum dm_dig_op {
1010#define DM_false_ALARM_THRESH_LOW 400 1010#define DM_false_ALARM_THRESH_LOW 400
1011#define DM_false_ALARM_THRESH_HIGH 1000 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#define DM_DIG_MIN_NIC 0x1e /* 0x22/0x1c */ 1014#define DM_DIG_MIN_NIC 0x1e /* 0x22/0x1c */
1015 1015
1016#define DM_DIG_MAX_AP 0x32 1016#define DM_DIG_MAX_AP 0x32
diff --git a/drivers/staging/rtl8188eu/include/rtl8188e_hal.h b/drivers/staging/rtl8188eu/include/rtl8188e_hal.h
index 52b280165a92..555c801d2ded 100644
--- a/drivers/staging/rtl8188eu/include/rtl8188e_hal.h
+++ b/drivers/staging/rtl8188eu/include/rtl8188e_hal.h
@@ -188,7 +188,7 @@ enum ChannelPlan {
188 188
189struct txpowerinfo24g { 189struct txpowerinfo24g {
190 u8 IndexCCK_Base[MAX_RF_PATH][MAX_CHNL_GROUP_24G]; 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 /* If only one tx, only BW20 and OFDM are used. */ 192 /* If only one tx, only BW20 and OFDM are used. */
193 s8 CCK_Diff[MAX_RF_PATH][MAX_TX_COUNT]; 193 s8 CCK_Diff[MAX_RF_PATH][MAX_TX_COUNT];
194 s8 OFDM_Diff[MAX_RF_PATH][MAX_TX_COUNT]; 194 s8 OFDM_Diff[MAX_RF_PATH][MAX_TX_COUNT];
diff --git a/drivers/staging/rtl8188eu/include/rtw_mlme_ext.h b/drivers/staging/rtl8188eu/include/rtw_mlme_ext.h
index a96b018e5e6a..853ab80a2b86 100644
--- a/drivers/staging/rtl8188eu/include/rtw_mlme_ext.h
+++ b/drivers/staging/rtl8188eu/include/rtw_mlme_ext.h
@@ -870,6 +870,7 @@ static struct fwevent wlanevents[] = {
870 {0, NULL}, 870 {0, NULL},
871 {0, NULL}, 871 {0, NULL},
872 {0, &rtw_cpwm_event_callback}, 872 {0, &rtw_cpwm_event_callback},
873 {0, NULL},
873}; 874};
874 875
875#endif/* _RTL_MLME_EXT_C_ */ 876#endif/* _RTL_MLME_EXT_C_ */
diff --git a/drivers/staging/vt6656/card.c b/drivers/staging/vt6656/card.c
index dbf11ecb794e..19d3cf451b88 100644
--- a/drivers/staging/vt6656/card.c
+++ b/drivers/staging/vt6656/card.c
@@ -172,8 +172,8 @@ static u16 swGetOFDMControlRate(struct vnt_private *pDevice, u16 wRateIdx)
172 if (!CARDbIsOFDMinBasicRate(pDevice)) { 172 if (!CARDbIsOFDMinBasicRate(pDevice)) {
173 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO 173 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO
174 "swGetOFDMControlRate:(NO OFDM) %d\n", wRateIdx); 174 "swGetOFDMControlRate:(NO OFDM) %d\n", wRateIdx);
175 if (wRateIdx > RATE_24M) 175 if (wRateIdx > RATE_24M)
176 wRateIdx = RATE_24M; 176 wRateIdx = RATE_24M;
177 return wRateIdx; 177 return wRateIdx;
178 } 178 }
179 179
diff --git a/drivers/staging/xillybus/xillybus_core.c b/drivers/staging/xillybus/xillybus_core.c
index efc56987a60b..7db6f03a0054 100644
--- a/drivers/staging/xillybus/xillybus_core.c
+++ b/drivers/staging/xillybus/xillybus_core.c
@@ -2054,7 +2054,7 @@ static int xillybus_init_chrdev(struct xilly_endpoint *endpoint,
2054 NULL, 2054 NULL,
2055 MKDEV(major, i), 2055 MKDEV(major, i),
2056 NULL, 2056 NULL,
2057 devname); 2057 "%s", devname);
2058 2058
2059 if (IS_ERR(device)) { 2059 if (IS_ERR(device)) {
2060 pr_warn("xillybus: Failed to create %s " 2060 pr_warn("xillybus: Failed to create %s "
diff --git a/drivers/staging/zram/zram_drv.c b/drivers/staging/zram/zram_drv.c
index 91d94b564433..2c4ed52ca849 100644
--- a/drivers/staging/zram/zram_drv.c
+++ b/drivers/staging/zram/zram_drv.c
@@ -981,4 +981,3 @@ MODULE_PARM_DESC(num_devices, "Number of zram devices");
981MODULE_LICENSE("Dual BSD/GPL"); 981MODULE_LICENSE("Dual BSD/GPL");
982MODULE_AUTHOR("Nitin Gupta <ngupta@vflare.org>"); 982MODULE_AUTHOR("Nitin Gupta <ngupta@vflare.org>");
983MODULE_DESCRIPTION("Compressed RAM Block Device"); 983MODULE_DESCRIPTION("Compressed RAM Block Device");
984MODULE_ALIAS("devname:zram");