diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2017-06-11 14:25:51 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-06-11 14:25:51 -0400 |
commit | 21c9eb7ca32be43a1c6fcb8194cf2d1aea771772 (patch) | |
tree | 4969a0f51efe15af2bbf7c5503b0a4fba39ad0ec | |
parent | 246baac2fd2917259ba5dd34f3be7d6d195cbeb8 (diff) | |
parent | 26f4b1f7a8da3eaa6c32e12f87c9f5388196dc67 (diff) |
Merge tag 'staging-4.12-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging
Pull staging/IIO fixes from Greg KH:
"These are mostly all IIO driver fixes, resolving a number of tiny
issues. There's also a ccree and lustre fix in here as well, both fix
problems found in those codebases.
All have been in linux-next with no reported issues"
* tag 'staging-4.12-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging:
staging: ccree: fix buffer copy
staging/lustre/lov: remove set_fs() call from lov_getstripe()
staging: ccree: add CRYPTO dependency
iio: adc: sun4i-gpadc-iio: fix parent device being used in devm function
iio: light: ltr501 Fix interchanged als/ps register field
iio: adc: bcm_iproc_adc: swap primary and secondary isr handler's
iio: trigger: fix NULL pointer dereference in iio_trigger_write_current()
iio: adc: max9611: Fix attribute measure unit
iio: adc: ti_am335x_adc: allocating too much in probe
iio: adc: sun4i-gpadc-iio: Fix module autoload when OF devices are registered
iio: adc: sun4i-gpadc-iio: Fix module autoload when PLATFORM devices are registered
iio: proximity: as3935: fix iio_trigger_poll issue
iio: proximity: as3935: fix AS3935_INT mask
iio: adc: Max9611: checking for ERR_PTR instead of NULL in probe
iio: proximity: as3935: recalibrate RCO after resume
-rw-r--r-- | drivers/iio/adc/bcm_iproc_adc.c | 8 | ||||
-rw-r--r-- | drivers/iio/adc/max9611.c | 10 | ||||
-rw-r--r-- | drivers/iio/adc/sun4i-gpadc-iio.c | 38 | ||||
-rw-r--r-- | drivers/iio/adc/ti_am335x_adc.c | 2 | ||||
-rw-r--r-- | drivers/iio/industrialio-trigger.c | 3 | ||||
-rw-r--r-- | drivers/iio/light/ltr501.c | 4 | ||||
-rw-r--r-- | drivers/iio/proximity/as3935.c | 14 | ||||
-rw-r--r-- | drivers/staging/ccree/Kconfig | 2 | ||||
-rw-r--r-- | drivers/staging/ccree/ssi_buffer_mgr.c | 3 | ||||
-rw-r--r-- | drivers/staging/lustre/lustre/lov/lov_pack.c | 9 |
10 files changed, 47 insertions, 46 deletions
diff --git a/drivers/iio/adc/bcm_iproc_adc.c b/drivers/iio/adc/bcm_iproc_adc.c index 21d38c8af21e..7f4f9c4150e3 100644 --- a/drivers/iio/adc/bcm_iproc_adc.c +++ b/drivers/iio/adc/bcm_iproc_adc.c | |||
@@ -143,7 +143,7 @@ static void iproc_adc_reg_dump(struct iio_dev *indio_dev) | |||
143 | iproc_adc_dbg_reg(dev, adc_priv, IPROC_SOFT_BYPASS_DATA); | 143 | iproc_adc_dbg_reg(dev, adc_priv, IPROC_SOFT_BYPASS_DATA); |
144 | } | 144 | } |
145 | 145 | ||
146 | static irqreturn_t iproc_adc_interrupt_handler(int irq, void *data) | 146 | static irqreturn_t iproc_adc_interrupt_thread(int irq, void *data) |
147 | { | 147 | { |
148 | u32 channel_intr_status; | 148 | u32 channel_intr_status; |
149 | u32 intr_status; | 149 | u32 intr_status; |
@@ -167,7 +167,7 @@ static irqreturn_t iproc_adc_interrupt_handler(int irq, void *data) | |||
167 | return IRQ_NONE; | 167 | return IRQ_NONE; |
168 | } | 168 | } |
169 | 169 | ||
170 | static irqreturn_t iproc_adc_interrupt_thread(int irq, void *data) | 170 | static irqreturn_t iproc_adc_interrupt_handler(int irq, void *data) |
171 | { | 171 | { |
172 | irqreturn_t retval = IRQ_NONE; | 172 | irqreturn_t retval = IRQ_NONE; |
173 | struct iproc_adc_priv *adc_priv; | 173 | struct iproc_adc_priv *adc_priv; |
@@ -181,7 +181,7 @@ static irqreturn_t iproc_adc_interrupt_thread(int irq, void *data) | |||
181 | adc_priv = iio_priv(indio_dev); | 181 | adc_priv = iio_priv(indio_dev); |
182 | 182 | ||
183 | regmap_read(adc_priv->regmap, IPROC_INTERRUPT_STATUS, &intr_status); | 183 | regmap_read(adc_priv->regmap, IPROC_INTERRUPT_STATUS, &intr_status); |
184 | dev_dbg(&indio_dev->dev, "iproc_adc_interrupt_thread(),INTRPT_STS:%x\n", | 184 | dev_dbg(&indio_dev->dev, "iproc_adc_interrupt_handler(),INTRPT_STS:%x\n", |
185 | intr_status); | 185 | intr_status); |
186 | 186 | ||
187 | intr_channels = (intr_status & IPROC_ADC_INTR_MASK) >> IPROC_ADC_INTR; | 187 | intr_channels = (intr_status & IPROC_ADC_INTR_MASK) >> IPROC_ADC_INTR; |
@@ -566,8 +566,8 @@ static int iproc_adc_probe(struct platform_device *pdev) | |||
566 | } | 566 | } |
567 | 567 | ||
568 | ret = devm_request_threaded_irq(&pdev->dev, adc_priv->irqno, | 568 | ret = devm_request_threaded_irq(&pdev->dev, adc_priv->irqno, |
569 | iproc_adc_interrupt_thread, | ||
570 | iproc_adc_interrupt_handler, | 569 | iproc_adc_interrupt_handler, |
570 | iproc_adc_interrupt_thread, | ||
571 | IRQF_SHARED, "iproc-adc", indio_dev); | 571 | IRQF_SHARED, "iproc-adc", indio_dev); |
572 | if (ret) { | 572 | if (ret) { |
573 | dev_err(&pdev->dev, "request_irq error %d\n", ret); | 573 | dev_err(&pdev->dev, "request_irq error %d\n", ret); |
diff --git a/drivers/iio/adc/max9611.c b/drivers/iio/adc/max9611.c index ec82106480e1..b0526e4b9530 100644 --- a/drivers/iio/adc/max9611.c +++ b/drivers/iio/adc/max9611.c | |||
@@ -438,10 +438,10 @@ static ssize_t max9611_shunt_resistor_show(struct device *dev, | |||
438 | struct max9611_dev *max9611 = iio_priv(dev_to_iio_dev(dev)); | 438 | struct max9611_dev *max9611 = iio_priv(dev_to_iio_dev(dev)); |
439 | unsigned int i, r; | 439 | unsigned int i, r; |
440 | 440 | ||
441 | i = max9611->shunt_resistor_uohm / 1000; | 441 | i = max9611->shunt_resistor_uohm / 1000000; |
442 | r = max9611->shunt_resistor_uohm % 1000; | 442 | r = max9611->shunt_resistor_uohm % 1000000; |
443 | 443 | ||
444 | return sprintf(buf, "%u.%03u\n", i, r); | 444 | return sprintf(buf, "%u.%06u\n", i, r); |
445 | } | 445 | } |
446 | 446 | ||
447 | static IIO_DEVICE_ATTR(in_power_shunt_resistor, 0444, | 447 | static IIO_DEVICE_ATTR(in_power_shunt_resistor, 0444, |
@@ -536,8 +536,8 @@ static int max9611_probe(struct i2c_client *client, | |||
536 | int ret; | 536 | int ret; |
537 | 537 | ||
538 | indio_dev = devm_iio_device_alloc(&client->dev, sizeof(*max9611)); | 538 | indio_dev = devm_iio_device_alloc(&client->dev, sizeof(*max9611)); |
539 | if (IS_ERR(indio_dev)) | 539 | if (!indio_dev) |
540 | return PTR_ERR(indio_dev); | 540 | return -ENOMEM; |
541 | 541 | ||
542 | i2c_set_clientdata(client, indio_dev); | 542 | i2c_set_clientdata(client, indio_dev); |
543 | 543 | ||
diff --git a/drivers/iio/adc/sun4i-gpadc-iio.c b/drivers/iio/adc/sun4i-gpadc-iio.c index b23527309088..81d4c39e414a 100644 --- a/drivers/iio/adc/sun4i-gpadc-iio.c +++ b/drivers/iio/adc/sun4i-gpadc-iio.c | |||
@@ -105,6 +105,8 @@ struct sun4i_gpadc_iio { | |||
105 | bool no_irq; | 105 | bool no_irq; |
106 | /* prevents concurrent reads of temperature and ADC */ | 106 | /* prevents concurrent reads of temperature and ADC */ |
107 | struct mutex mutex; | 107 | struct mutex mutex; |
108 | struct thermal_zone_device *tzd; | ||
109 | struct device *sensor_device; | ||
108 | }; | 110 | }; |
109 | 111 | ||
110 | #define SUN4I_GPADC_ADC_CHANNEL(_channel, _name) { \ | 112 | #define SUN4I_GPADC_ADC_CHANNEL(_channel, _name) { \ |
@@ -502,7 +504,6 @@ static int sun4i_gpadc_probe_dt(struct platform_device *pdev, | |||
502 | { | 504 | { |
503 | struct sun4i_gpadc_iio *info = iio_priv(indio_dev); | 505 | struct sun4i_gpadc_iio *info = iio_priv(indio_dev); |
504 | const struct of_device_id *of_dev; | 506 | const struct of_device_id *of_dev; |
505 | struct thermal_zone_device *tzd; | ||
506 | struct resource *mem; | 507 | struct resource *mem; |
507 | void __iomem *base; | 508 | void __iomem *base; |
508 | int ret; | 509 | int ret; |
@@ -532,13 +533,14 @@ static int sun4i_gpadc_probe_dt(struct platform_device *pdev, | |||
532 | if (!IS_ENABLED(CONFIG_THERMAL_OF)) | 533 | if (!IS_ENABLED(CONFIG_THERMAL_OF)) |
533 | return 0; | 534 | return 0; |
534 | 535 | ||
535 | tzd = devm_thermal_zone_of_sensor_register(&pdev->dev, 0, info, | 536 | info->sensor_device = &pdev->dev; |
536 | &sun4i_ts_tz_ops); | 537 | info->tzd = thermal_zone_of_sensor_register(info->sensor_device, 0, |
537 | if (IS_ERR(tzd)) | 538 | info, &sun4i_ts_tz_ops); |
539 | if (IS_ERR(info->tzd)) | ||
538 | dev_err(&pdev->dev, "could not register thermal sensor: %ld\n", | 540 | dev_err(&pdev->dev, "could not register thermal sensor: %ld\n", |
539 | PTR_ERR(tzd)); | 541 | PTR_ERR(info->tzd)); |
540 | 542 | ||
541 | return PTR_ERR_OR_ZERO(tzd); | 543 | return PTR_ERR_OR_ZERO(info->tzd); |
542 | } | 544 | } |
543 | 545 | ||
544 | static int sun4i_gpadc_probe_mfd(struct platform_device *pdev, | 546 | static int sun4i_gpadc_probe_mfd(struct platform_device *pdev, |
@@ -584,15 +586,15 @@ static int sun4i_gpadc_probe_mfd(struct platform_device *pdev, | |||
584 | * of_node, and the device from this driver as third argument to | 586 | * of_node, and the device from this driver as third argument to |
585 | * return the temperature. | 587 | * return the temperature. |
586 | */ | 588 | */ |
587 | struct thermal_zone_device *tzd; | 589 | info->sensor_device = pdev->dev.parent; |
588 | tzd = devm_thermal_zone_of_sensor_register(pdev->dev.parent, 0, | 590 | info->tzd = thermal_zone_of_sensor_register(info->sensor_device, |
589 | info, | 591 | 0, info, |
590 | &sun4i_ts_tz_ops); | 592 | &sun4i_ts_tz_ops); |
591 | if (IS_ERR(tzd)) { | 593 | if (IS_ERR(info->tzd)) { |
592 | dev_err(&pdev->dev, | 594 | dev_err(&pdev->dev, |
593 | "could not register thermal sensor: %ld\n", | 595 | "could not register thermal sensor: %ld\n", |
594 | PTR_ERR(tzd)); | 596 | PTR_ERR(info->tzd)); |
595 | return PTR_ERR(tzd); | 597 | return PTR_ERR(info->tzd); |
596 | } | 598 | } |
597 | } else { | 599 | } else { |
598 | indio_dev->num_channels = | 600 | indio_dev->num_channels = |
@@ -688,7 +690,13 @@ static int sun4i_gpadc_remove(struct platform_device *pdev) | |||
688 | 690 | ||
689 | pm_runtime_put(&pdev->dev); | 691 | pm_runtime_put(&pdev->dev); |
690 | pm_runtime_disable(&pdev->dev); | 692 | pm_runtime_disable(&pdev->dev); |
691 | if (!info->no_irq && IS_ENABLED(CONFIG_THERMAL_OF)) | 693 | |
694 | if (!IS_ENABLED(CONFIG_THERMAL_OF)) | ||
695 | return 0; | ||
696 | |||
697 | thermal_zone_of_sensor_unregister(info->sensor_device, info->tzd); | ||
698 | |||
699 | if (!info->no_irq) | ||
692 | iio_map_array_unregister(indio_dev); | 700 | iio_map_array_unregister(indio_dev); |
693 | 701 | ||
694 | return 0; | 702 | return 0; |
@@ -700,6 +708,7 @@ static const struct platform_device_id sun4i_gpadc_id[] = { | |||
700 | { "sun6i-a31-gpadc-iio", (kernel_ulong_t)&sun6i_gpadc_data }, | 708 | { "sun6i-a31-gpadc-iio", (kernel_ulong_t)&sun6i_gpadc_data }, |
701 | { /* sentinel */ }, | 709 | { /* sentinel */ }, |
702 | }; | 710 | }; |
711 | MODULE_DEVICE_TABLE(platform, sun4i_gpadc_id); | ||
703 | 712 | ||
704 | static struct platform_driver sun4i_gpadc_driver = { | 713 | static struct platform_driver sun4i_gpadc_driver = { |
705 | .driver = { | 714 | .driver = { |
@@ -711,6 +720,7 @@ static struct platform_driver sun4i_gpadc_driver = { | |||
711 | .probe = sun4i_gpadc_probe, | 720 | .probe = sun4i_gpadc_probe, |
712 | .remove = sun4i_gpadc_remove, | 721 | .remove = sun4i_gpadc_remove, |
713 | }; | 722 | }; |
723 | MODULE_DEVICE_TABLE(of, sun4i_gpadc_of_id); | ||
714 | 724 | ||
715 | module_platform_driver(sun4i_gpadc_driver); | 725 | module_platform_driver(sun4i_gpadc_driver); |
716 | 726 | ||
diff --git a/drivers/iio/adc/ti_am335x_adc.c b/drivers/iio/adc/ti_am335x_adc.c index 4282ceca3d8f..6cbed7eb118a 100644 --- a/drivers/iio/adc/ti_am335x_adc.c +++ b/drivers/iio/adc/ti_am335x_adc.c | |||
@@ -614,7 +614,7 @@ static int tiadc_probe(struct platform_device *pdev) | |||
614 | return -EINVAL; | 614 | return -EINVAL; |
615 | } | 615 | } |
616 | 616 | ||
617 | indio_dev = devm_iio_device_alloc(&pdev->dev, sizeof(*indio_dev)); | 617 | indio_dev = devm_iio_device_alloc(&pdev->dev, sizeof(*adc_dev)); |
618 | if (indio_dev == NULL) { | 618 | if (indio_dev == NULL) { |
619 | dev_err(&pdev->dev, "failed to allocate iio device\n"); | 619 | dev_err(&pdev->dev, "failed to allocate iio device\n"); |
620 | return -ENOMEM; | 620 | return -ENOMEM; |
diff --git a/drivers/iio/industrialio-trigger.c b/drivers/iio/industrialio-trigger.c index 978e1592c2a3..4061fed93f1f 100644 --- a/drivers/iio/industrialio-trigger.c +++ b/drivers/iio/industrialio-trigger.c | |||
@@ -451,7 +451,8 @@ static ssize_t iio_trigger_write_current(struct device *dev, | |||
451 | return len; | 451 | return len; |
452 | 452 | ||
453 | out_trigger_put: | 453 | out_trigger_put: |
454 | iio_trigger_put(trig); | 454 | if (trig) |
455 | iio_trigger_put(trig); | ||
455 | return ret; | 456 | return ret; |
456 | } | 457 | } |
457 | 458 | ||
diff --git a/drivers/iio/light/ltr501.c b/drivers/iio/light/ltr501.c index b30e0c1c6cc4..67838edd8b37 100644 --- a/drivers/iio/light/ltr501.c +++ b/drivers/iio/light/ltr501.c | |||
@@ -74,9 +74,9 @@ static const int int_time_mapping[] = {100000, 50000, 200000, 400000}; | |||
74 | static const struct reg_field reg_field_it = | 74 | static const struct reg_field reg_field_it = |
75 | REG_FIELD(LTR501_ALS_MEAS_RATE, 3, 4); | 75 | REG_FIELD(LTR501_ALS_MEAS_RATE, 3, 4); |
76 | static const struct reg_field reg_field_als_intr = | 76 | static const struct reg_field reg_field_als_intr = |
77 | REG_FIELD(LTR501_INTR, 0, 0); | ||
78 | static const struct reg_field reg_field_ps_intr = | ||
79 | REG_FIELD(LTR501_INTR, 1, 1); | 77 | REG_FIELD(LTR501_INTR, 1, 1); |
78 | static const struct reg_field reg_field_ps_intr = | ||
79 | REG_FIELD(LTR501_INTR, 0, 0); | ||
80 | static const struct reg_field reg_field_als_rate = | 80 | static const struct reg_field reg_field_als_rate = |
81 | REG_FIELD(LTR501_ALS_MEAS_RATE, 0, 2); | 81 | REG_FIELD(LTR501_ALS_MEAS_RATE, 0, 2); |
82 | static const struct reg_field reg_field_ps_rate = | 82 | static const struct reg_field reg_field_ps_rate = |
diff --git a/drivers/iio/proximity/as3935.c b/drivers/iio/proximity/as3935.c index ddf9bee89f77..aa4df0dcc8c9 100644 --- a/drivers/iio/proximity/as3935.c +++ b/drivers/iio/proximity/as3935.c | |||
@@ -40,9 +40,9 @@ | |||
40 | #define AS3935_AFE_PWR_BIT BIT(0) | 40 | #define AS3935_AFE_PWR_BIT BIT(0) |
41 | 41 | ||
42 | #define AS3935_INT 0x03 | 42 | #define AS3935_INT 0x03 |
43 | #define AS3935_INT_MASK 0x07 | 43 | #define AS3935_INT_MASK 0x0f |
44 | #define AS3935_EVENT_INT BIT(3) | 44 | #define AS3935_EVENT_INT BIT(3) |
45 | #define AS3935_NOISE_INT BIT(1) | 45 | #define AS3935_NOISE_INT BIT(0) |
46 | 46 | ||
47 | #define AS3935_DATA 0x07 | 47 | #define AS3935_DATA 0x07 |
48 | #define AS3935_DATA_MASK 0x3F | 48 | #define AS3935_DATA_MASK 0x3F |
@@ -215,7 +215,7 @@ static irqreturn_t as3935_trigger_handler(int irq, void *private) | |||
215 | 215 | ||
216 | st->buffer[0] = val & AS3935_DATA_MASK; | 216 | st->buffer[0] = val & AS3935_DATA_MASK; |
217 | iio_push_to_buffers_with_timestamp(indio_dev, &st->buffer, | 217 | iio_push_to_buffers_with_timestamp(indio_dev, &st->buffer, |
218 | pf->timestamp); | 218 | iio_get_time_ns(indio_dev)); |
219 | err_read: | 219 | err_read: |
220 | iio_trigger_notify_done(indio_dev->trig); | 220 | iio_trigger_notify_done(indio_dev->trig); |
221 | 221 | ||
@@ -244,7 +244,7 @@ static void as3935_event_work(struct work_struct *work) | |||
244 | 244 | ||
245 | switch (val) { | 245 | switch (val) { |
246 | case AS3935_EVENT_INT: | 246 | case AS3935_EVENT_INT: |
247 | iio_trigger_poll(st->trig); | 247 | iio_trigger_poll_chained(st->trig); |
248 | break; | 248 | break; |
249 | case AS3935_NOISE_INT: | 249 | case AS3935_NOISE_INT: |
250 | dev_warn(&st->spi->dev, "noise level is too high\n"); | 250 | dev_warn(&st->spi->dev, "noise level is too high\n"); |
@@ -269,8 +269,6 @@ static irqreturn_t as3935_interrupt_handler(int irq, void *private) | |||
269 | 269 | ||
270 | static void calibrate_as3935(struct as3935_state *st) | 270 | static void calibrate_as3935(struct as3935_state *st) |
271 | { | 271 | { |
272 | mutex_lock(&st->lock); | ||
273 | |||
274 | /* mask disturber interrupt bit */ | 272 | /* mask disturber interrupt bit */ |
275 | as3935_write(st, AS3935_INT, BIT(5)); | 273 | as3935_write(st, AS3935_INT, BIT(5)); |
276 | 274 | ||
@@ -280,8 +278,6 @@ static void calibrate_as3935(struct as3935_state *st) | |||
280 | 278 | ||
281 | mdelay(2); | 279 | mdelay(2); |
282 | as3935_write(st, AS3935_TUNE_CAP, (st->tune_cap / TUNE_CAP_DIV)); | 280 | as3935_write(st, AS3935_TUNE_CAP, (st->tune_cap / TUNE_CAP_DIV)); |
283 | |||
284 | mutex_unlock(&st->lock); | ||
285 | } | 281 | } |
286 | 282 | ||
287 | #ifdef CONFIG_PM_SLEEP | 283 | #ifdef CONFIG_PM_SLEEP |
@@ -318,6 +314,8 @@ static int as3935_resume(struct device *dev) | |||
318 | val &= ~AS3935_AFE_PWR_BIT; | 314 | val &= ~AS3935_AFE_PWR_BIT; |
319 | ret = as3935_write(st, AS3935_AFE_GAIN, val); | 315 | ret = as3935_write(st, AS3935_AFE_GAIN, val); |
320 | 316 | ||
317 | calibrate_as3935(st); | ||
318 | |||
321 | err_resume: | 319 | err_resume: |
322 | mutex_unlock(&st->lock); | 320 | mutex_unlock(&st->lock); |
323 | 321 | ||
diff --git a/drivers/staging/ccree/Kconfig b/drivers/staging/ccree/Kconfig index ae627049c499..4be87f503e3b 100644 --- a/drivers/staging/ccree/Kconfig +++ b/drivers/staging/ccree/Kconfig | |||
@@ -1,6 +1,6 @@ | |||
1 | config CRYPTO_DEV_CCREE | 1 | config CRYPTO_DEV_CCREE |
2 | tristate "Support for ARM TrustZone CryptoCell C7XX family of Crypto accelerators" | 2 | tristate "Support for ARM TrustZone CryptoCell C7XX family of Crypto accelerators" |
3 | depends on CRYPTO_HW && OF && HAS_DMA | 3 | depends on CRYPTO && CRYPTO_HW && OF && HAS_DMA |
4 | default n | 4 | default n |
5 | select CRYPTO_HASH | 5 | select CRYPTO_HASH |
6 | select CRYPTO_BLKCIPHER | 6 | select CRYPTO_BLKCIPHER |
diff --git a/drivers/staging/ccree/ssi_buffer_mgr.c b/drivers/staging/ccree/ssi_buffer_mgr.c index 038e2ff5e545..6471d3d2d375 100644 --- a/drivers/staging/ccree/ssi_buffer_mgr.c +++ b/drivers/staging/ccree/ssi_buffer_mgr.c | |||
@@ -216,7 +216,8 @@ void ssi_buffer_mgr_copy_scatterlist_portion( | |||
216 | uint32_t nents, lbytes; | 216 | uint32_t nents, lbytes; |
217 | 217 | ||
218 | nents = ssi_buffer_mgr_get_sgl_nents(sg, end, &lbytes, NULL); | 218 | nents = ssi_buffer_mgr_get_sgl_nents(sg, end, &lbytes, NULL); |
219 | sg_copy_buffer(sg, nents, (void *)dest, (end - to_skip), 0, (direct == SSI_SG_TO_BUF)); | 219 | sg_copy_buffer(sg, nents, (void *)dest, (end - to_skip + 1), to_skip, |
220 | (direct == SSI_SG_TO_BUF)); | ||
220 | } | 221 | } |
221 | 222 | ||
222 | static inline int ssi_buffer_mgr_render_buff_to_mlli( | 223 | static inline int ssi_buffer_mgr_render_buff_to_mlli( |
diff --git a/drivers/staging/lustre/lustre/lov/lov_pack.c b/drivers/staging/lustre/lustre/lov/lov_pack.c index 2e1bd47337fd..e6727cefde05 100644 --- a/drivers/staging/lustre/lustre/lov/lov_pack.c +++ b/drivers/staging/lustre/lustre/lov/lov_pack.c | |||
@@ -293,18 +293,10 @@ int lov_getstripe(struct lov_object *obj, struct lov_stripe_md *lsm, | |||
293 | size_t lmmk_size; | 293 | size_t lmmk_size; |
294 | size_t lum_size; | 294 | size_t lum_size; |
295 | int rc; | 295 | int rc; |
296 | mm_segment_t seg; | ||
297 | 296 | ||
298 | if (!lsm) | 297 | if (!lsm) |
299 | return -ENODATA; | 298 | return -ENODATA; |
300 | 299 | ||
301 | /* | ||
302 | * "Switch to kernel segment" to allow copying from kernel space by | ||
303 | * copy_{to,from}_user(). | ||
304 | */ | ||
305 | seg = get_fs(); | ||
306 | set_fs(KERNEL_DS); | ||
307 | |||
308 | if (lsm->lsm_magic != LOV_MAGIC_V1 && lsm->lsm_magic != LOV_MAGIC_V3) { | 300 | if (lsm->lsm_magic != LOV_MAGIC_V1 && lsm->lsm_magic != LOV_MAGIC_V3) { |
309 | CERROR("bad LSM MAGIC: 0x%08X != 0x%08X nor 0x%08X\n", | 301 | CERROR("bad LSM MAGIC: 0x%08X != 0x%08X nor 0x%08X\n", |
310 | lsm->lsm_magic, LOV_MAGIC_V1, LOV_MAGIC_V3); | 302 | lsm->lsm_magic, LOV_MAGIC_V1, LOV_MAGIC_V3); |
@@ -406,6 +398,5 @@ int lov_getstripe(struct lov_object *obj, struct lov_stripe_md *lsm, | |||
406 | out_free: | 398 | out_free: |
407 | kvfree(lmmk); | 399 | kvfree(lmmk); |
408 | out: | 400 | out: |
409 | set_fs(seg); | ||
410 | return rc; | 401 | return rc; |
411 | } | 402 | } |