Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

Pull staging and IIO driver fixes from Greg KH:
"Here are some small IIO driver fixes and one Staging driver fix for
5.13-rc2.

Nothing major, just some resolutions for reported problems:

- gcc-11 bogus warning fix for rtl8723bs

- iio driver tiny fixes

All of these have been in linux-next for many days with no reported
issues"

* tag 'staging-5.13-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging:
iio: tsl2583: Fix division by a zero lux_val
iio: core: return ENODEV if ioctl is unknown
iio: core: fix ioctl handlers removal
iio: gyro: mpu3050: Fix reported temperature value
iio: hid-sensors: select IIO_TRIGGERED_BUFFER under HID_SENSOR_IIO_TRIGGER
iio: proximity: pulsedlight: Fix rumtime PM imbalance on error
iio: light: gp2ap002: Fix rumtime PM imbalance on error
staging: rtl8723bs: avoid bogus gcc warning

+50 -41
-1
drivers/iio/accel/Kconfig
··· 229 229 config HID_SENSOR_ACCEL_3D 230 230 depends on HID_SENSOR_HUB 231 231 select IIO_BUFFER 232 - select IIO_TRIGGERED_BUFFER 233 232 select HID_SENSOR_IIO_COMMON 234 233 select HID_SENSOR_IIO_TRIGGER 235 234 tristate "HID Accelerometers 3D"
+1
drivers/iio/common/hid-sensors/Kconfig
··· 19 19 tristate "Common module (trigger) for all HID Sensor IIO drivers" 20 20 depends on HID_SENSOR_HUB && HID_SENSOR_IIO_COMMON && IIO_BUFFER 21 21 select IIO_TRIGGER 22 + select IIO_TRIGGERED_BUFFER 22 23 help 23 24 Say yes here to build trigger support for HID sensors. 24 25 Triggers will be send if all requested attributes were read.
-1
drivers/iio/gyro/Kconfig
··· 111 111 config HID_SENSOR_GYRO_3D 112 112 depends on HID_SENSOR_HUB 113 113 select IIO_BUFFER 114 - select IIO_TRIGGERED_BUFFER 115 114 select HID_SENSOR_IIO_COMMON 116 115 select HID_SENSOR_IIO_TRIGGER 117 116 tristate "HID Gyroscope 3D"
+11 -2
drivers/iio/gyro/mpu3050-core.c
··· 272 272 case IIO_CHAN_INFO_OFFSET: 273 273 switch (chan->type) { 274 274 case IIO_TEMP: 275 - /* The temperature scaling is (x+23000)/280 Celsius */ 275 + /* 276 + * The temperature scaling is (x+23000)/280 Celsius 277 + * for the "best fit straight line" temperature range 278 + * of -30C..85C. The 23000 includes room temperature 279 + * offset of +35C, 280 is the precision scale and x is 280 + * the 16-bit signed integer reported by hardware. 281 + * 282 + * Temperature value itself represents temperature of 283 + * the sensor die. 284 + */ 276 285 *val = 23000; 277 286 return IIO_VAL_INT; 278 287 default: ··· 338 329 goto out_read_raw_unlock; 339 330 } 340 331 341 - *val = be16_to_cpu(raw_val); 332 + *val = (s16)be16_to_cpu(raw_val); 342 333 ret = IIO_VAL_INT; 343 334 344 335 goto out_read_raw_unlock;
-1
drivers/iio/humidity/Kconfig
··· 52 52 tristate "HID Environmental humidity sensor" 53 53 depends on HID_SENSOR_HUB 54 54 select IIO_BUFFER 55 - select IIO_TRIGGERED_BUFFER 56 55 select HID_SENSOR_IIO_COMMON 57 56 select HID_SENSOR_IIO_TRIGGER 58 57 help
+1 -8
drivers/iio/industrialio-core.c
··· 1778 1778 if (!indio_dev->info) 1779 1779 goto out_unlock; 1780 1780 1781 - ret = -EINVAL; 1782 1781 list_for_each_entry(h, &iio_dev_opaque->ioctl_handlers, entry) { 1783 1782 ret = h->ioctl(indio_dev, filp, cmd, arg); 1784 1783 if (ret != IIO_IOCTL_UNHANDLED) ··· 1785 1786 } 1786 1787 1787 1788 if (ret == IIO_IOCTL_UNHANDLED) 1788 - ret = -EINVAL; 1789 + ret = -ENODEV; 1789 1790 1790 1791 out_unlock: 1791 1792 mutex_unlock(&indio_dev->info_exist_lock); ··· 1925 1926 **/ 1926 1927 void iio_device_unregister(struct iio_dev *indio_dev) 1927 1928 { 1928 - struct iio_dev_opaque *iio_dev_opaque = to_iio_dev_opaque(indio_dev); 1929 - struct iio_ioctl_handler *h, *t; 1930 - 1931 1929 cdev_device_del(&indio_dev->chrdev, &indio_dev->dev); 1932 1930 1933 1931 mutex_lock(&indio_dev->info_exist_lock); ··· 1934 1938 iio_disable_all_buffers(indio_dev); 1935 1939 1936 1940 indio_dev->info = NULL; 1937 - 1938 - list_for_each_entry_safe(h, t, &iio_dev_opaque->ioctl_handlers, entry) 1939 - list_del(&h->entry); 1940 1941 1941 1942 iio_device_wakeup_eventset(indio_dev); 1942 1943 iio_buffer_wakeup_poll(indio_dev);
-2
drivers/iio/light/Kconfig
··· 256 256 config HID_SENSOR_ALS 257 257 depends on HID_SENSOR_HUB 258 258 select IIO_BUFFER 259 - select IIO_TRIGGERED_BUFFER 260 259 select HID_SENSOR_IIO_COMMON 261 260 select HID_SENSOR_IIO_TRIGGER 262 261 tristate "HID ALS" ··· 269 270 config HID_SENSOR_PROX 270 271 depends on HID_SENSOR_HUB 271 272 select IIO_BUFFER 272 - select IIO_TRIGGERED_BUFFER 273 273 select HID_SENSOR_IIO_COMMON 274 274 select HID_SENSOR_IIO_TRIGGER 275 275 tristate "HID PROX"
+3 -2
drivers/iio/light/gp2ap002.c
··· 582 582 "gp2ap002", indio_dev); 583 583 if (ret) { 584 584 dev_err(dev, "unable to request IRQ\n"); 585 - goto out_disable_vio; 585 + goto out_put_pm; 586 586 } 587 587 gp2ap002->irq = client->irq; 588 588 ··· 612 612 613 613 return 0; 614 614 615 - out_disable_pm: 615 + out_put_pm: 616 616 pm_runtime_put_noidle(dev); 617 + out_disable_pm: 617 618 pm_runtime_disable(dev); 618 619 out_disable_vio: 619 620 regulator_disable(gp2ap002->vio);
+8
drivers/iio/light/tsl2583.c
··· 341 341 return lux_val; 342 342 } 343 343 344 + /* Avoid division by zero of lux_value later on */ 345 + if (lux_val == 0) { 346 + dev_err(&chip->client->dev, 347 + "%s: lux_val of 0 will produce out of range trim_value\n", 348 + __func__); 349 + return -ENODATA; 350 + } 351 + 344 352 gain_trim_val = (unsigned int)(((chip->als_settings.als_cal_target) 345 353 * chip->als_settings.als_gain_trim) / lux_val); 346 354 if ((gain_trim_val < 250) || (gain_trim_val > 4000)) {
-1
drivers/iio/magnetometer/Kconfig
··· 95 95 config HID_SENSOR_MAGNETOMETER_3D 96 96 depends on HID_SENSOR_HUB 97 97 select IIO_BUFFER 98 - select IIO_TRIGGERED_BUFFER 99 98 select HID_SENSOR_IIO_COMMON 100 99 select HID_SENSOR_IIO_TRIGGER 101 100 tristate "HID Magenetometer 3D"
-2
drivers/iio/orientation/Kconfig
··· 9 9 config HID_SENSOR_INCLINOMETER_3D 10 10 depends on HID_SENSOR_HUB 11 11 select IIO_BUFFER 12 - select IIO_TRIGGERED_BUFFER 13 12 select HID_SENSOR_IIO_COMMON 14 13 select HID_SENSOR_IIO_TRIGGER 15 14 tristate "HID Inclinometer 3D" ··· 19 20 config HID_SENSOR_DEVICE_ROTATION 20 21 depends on HID_SENSOR_HUB 21 22 select IIO_BUFFER 22 - select IIO_TRIGGERED_BUFFER 23 23 select HID_SENSOR_IIO_COMMON 24 24 select HID_SENSOR_IIO_TRIGGER 25 25 tristate "HID Device Rotation"
-1
drivers/iio/pressure/Kconfig
··· 79 79 config HID_SENSOR_PRESS 80 80 depends on HID_SENSOR_HUB 81 81 select IIO_BUFFER 82 - select IIO_TRIGGERED_BUFFER 83 82 select HID_SENSOR_IIO_COMMON 84 83 select HID_SENSOR_IIO_TRIGGER 85 84 tristate "HID PRESS"
+1
drivers/iio/proximity/pulsedlight-lidar-lite-v2.c
··· 160 160 ret = lidar_write_control(data, LIDAR_REG_CONTROL_ACQUIRE); 161 161 if (ret < 0) { 162 162 dev_err(&client->dev, "cannot send start measurement command"); 163 + pm_runtime_put_noidle(&client->dev); 163 164 return ret; 164 165 } 165 166
-1
drivers/iio/temperature/Kconfig
··· 45 45 tristate "HID Environmental temperature sensor" 46 46 depends on HID_SENSOR_HUB 47 47 select IIO_BUFFER 48 - select IIO_TRIGGERED_BUFFER 49 48 select HID_SENSOR_IIO_COMMON 50 49 select HID_SENSOR_IIO_TRIGGER 51 50 help
+13 -10
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c
··· 527 527 struct mlme_priv *pmlmepriv = &padapter->mlmepriv; 528 528 struct security_priv *psecuritypriv = &(padapter->securitypriv); 529 529 struct sta_priv *pstapriv = &padapter->stapriv; 530 + char *grpkey = padapter->securitypriv.dot118021XGrpKey[param->u.crypt.idx].skey; 531 + char *txkey = padapter->securitypriv.dot118021XGrptxmickey[param->u.crypt.idx].skey; 532 + char *rxkey = padapter->securitypriv.dot118021XGrprxmickey[param->u.crypt.idx].skey; 530 533 531 534 param->u.crypt.err = 0; 532 535 param->u.crypt.alg[IEEE_CRYPT_ALG_NAME_LEN - 1] = '\0'; ··· 612 609 { 613 610 if (strcmp(param->u.crypt.alg, "WEP") == 0) 614 611 { 615 - memcpy(psecuritypriv->dot118021XGrpKey[param->u.crypt.idx].skey, param->u.crypt.key, (param->u.crypt.key_len > 16 ? 16 : param->u.crypt.key_len)); 612 + memcpy(grpkey, param->u.crypt.key, (param->u.crypt.key_len > 16 ? 16 : param->u.crypt.key_len)); 616 613 617 614 psecuritypriv->dot118021XGrpPrivacy = _WEP40_; 618 615 if (param->u.crypt.key_len == 13) ··· 625 622 { 626 623 psecuritypriv->dot118021XGrpPrivacy = _TKIP_; 627 624 628 - memcpy(psecuritypriv->dot118021XGrpKey[param->u.crypt.idx].skey, param->u.crypt.key, (param->u.crypt.key_len > 16 ? 16 : param->u.crypt.key_len)); 625 + memcpy(grpkey, param->u.crypt.key, (param->u.crypt.key_len > 16 ? 16 : param->u.crypt.key_len)); 629 626 630 627 /* DEBUG_ERR("set key length :param->u.crypt.key_len =%d\n", param->u.crypt.key_len); */ 631 628 /* set mic key */ 632 - memcpy(psecuritypriv->dot118021XGrptxmickey[param->u.crypt.idx].skey, &(param->u.crypt.key[16]), 8); 633 - memcpy(psecuritypriv->dot118021XGrprxmickey[param->u.crypt.idx].skey, &(param->u.crypt.key[24]), 8); 629 + memcpy(txkey, &(param->u.crypt.key[16]), 8); 630 + memcpy(rxkey, &(param->u.crypt.key[24]), 8); 634 631 635 632 psecuritypriv->busetkipkey = true; 636 633 ··· 639 636 { 640 637 psecuritypriv->dot118021XGrpPrivacy = _AES_; 641 638 642 - memcpy(psecuritypriv->dot118021XGrpKey[param->u.crypt.idx].skey, param->u.crypt.key, (param->u.crypt.key_len > 16 ? 16 : param->u.crypt.key_len)); 639 + memcpy(grpkey, param->u.crypt.key, (param->u.crypt.key_len > 16 ? 16 : param->u.crypt.key_len)); 643 640 } 644 641 else 645 642 { ··· 716 713 { 717 714 if (strcmp(param->u.crypt.alg, "WEP") == 0) 718 715 { 719 - memcpy(psecuritypriv->dot118021XGrpKey[param->u.crypt.idx].skey, param->u.crypt.key, (param->u.crypt.key_len > 16 ? 16 : param->u.crypt.key_len)); 716 + memcpy(grpkey, param->u.crypt.key, (param->u.crypt.key_len > 16 ? 16 : param->u.crypt.key_len)); 720 717 721 718 psecuritypriv->dot118021XGrpPrivacy = _WEP40_; 722 719 if (param->u.crypt.key_len == 13) ··· 728 725 { 729 726 psecuritypriv->dot118021XGrpPrivacy = _TKIP_; 730 727 731 - memcpy(psecuritypriv->dot118021XGrpKey[param->u.crypt.idx].skey, param->u.crypt.key, (param->u.crypt.key_len > 16 ? 16 : param->u.crypt.key_len)); 728 + memcpy(grpkey, param->u.crypt.key, (param->u.crypt.key_len > 16 ? 16 : param->u.crypt.key_len)); 732 729 733 730 /* DEBUG_ERR("set key length :param->u.crypt.key_len =%d\n", param->u.crypt.key_len); */ 734 731 /* set mic key */ 735 - memcpy(psecuritypriv->dot118021XGrptxmickey[param->u.crypt.idx].skey, &(param->u.crypt.key[16]), 8); 736 - memcpy(psecuritypriv->dot118021XGrprxmickey[param->u.crypt.idx].skey, &(param->u.crypt.key[24]), 8); 732 + memcpy(txkey, &(param->u.crypt.key[16]), 8); 733 + memcpy(rxkey, &(param->u.crypt.key[24]), 8); 737 734 738 735 psecuritypriv->busetkipkey = true; 739 736 ··· 742 739 { 743 740 psecuritypriv->dot118021XGrpPrivacy = _AES_; 744 741 745 - memcpy(psecuritypriv->dot118021XGrpKey[param->u.crypt.idx].skey, param->u.crypt.key, (param->u.crypt.key_len > 16 ? 16 : param->u.crypt.key_len)); 742 + memcpy(grpkey, param->u.crypt.key, (param->u.crypt.key_len > 16 ? 16 : param->u.crypt.key_len)); 746 743 } 747 744 else 748 745 {
+12 -9
drivers/staging/rtl8723bs/os_dep/ioctl_linux.c
··· 2963 2963 struct mlme_priv *pmlmepriv = &padapter->mlmepriv; 2964 2964 struct security_priv *psecuritypriv = &(padapter->securitypriv); 2965 2965 struct sta_priv *pstapriv = &padapter->stapriv; 2966 + char *txkey = padapter->securitypriv.dot118021XGrptxmickey[param->u.crypt.idx].skey; 2967 + char *rxkey = padapter->securitypriv.dot118021XGrprxmickey[param->u.crypt.idx].skey; 2968 + char *grpkey = psecuritypriv->dot118021XGrpKey[param->u.crypt.idx].skey; 2966 2969 2967 2970 param->u.crypt.err = 0; 2968 2971 param->u.crypt.alg[IEEE_CRYPT_ALG_NAME_LEN - 1] = '\0'; ··· 3067 3064 if (!psta && check_fwstate(pmlmepriv, WIFI_AP_STATE)) { /* group key */ 3068 3065 if (param->u.crypt.set_tx == 1) { 3069 3066 if (strcmp(param->u.crypt.alg, "WEP") == 0) { 3070 - memcpy(psecuritypriv->dot118021XGrpKey[param->u.crypt.idx].skey, param->u.crypt.key, (param->u.crypt.key_len > 16 ? 16 : param->u.crypt.key_len)); 3067 + memcpy(grpkey, param->u.crypt.key, (param->u.crypt.key_len > 16 ? 16 : param->u.crypt.key_len)); 3071 3068 3072 3069 psecuritypriv->dot118021XGrpPrivacy = _WEP40_; 3073 3070 if (param->u.crypt.key_len == 13) ··· 3076 3073 } else if (strcmp(param->u.crypt.alg, "TKIP") == 0) { 3077 3074 psecuritypriv->dot118021XGrpPrivacy = _TKIP_; 3078 3075 3079 - memcpy(psecuritypriv->dot118021XGrpKey[param->u.crypt.idx].skey, param->u.crypt.key, (param->u.crypt.key_len > 16 ? 16 : param->u.crypt.key_len)); 3076 + memcpy(grpkey, param->u.crypt.key, (param->u.crypt.key_len > 16 ? 16 : param->u.crypt.key_len)); 3080 3077 3081 3078 /* DEBUG_ERR("set key length :param->u.crypt.key_len =%d\n", param->u.crypt.key_len); */ 3082 3079 /* set mic key */ 3083 - memcpy(psecuritypriv->dot118021XGrptxmickey[param->u.crypt.idx].skey, &(param->u.crypt.key[16]), 8); 3080 + memcpy(txkey, &(param->u.crypt.key[16]), 8); 3084 3081 memcpy(psecuritypriv->dot118021XGrprxmickey[param->u.crypt.idx].skey, &(param->u.crypt.key[24]), 8); 3085 3082 3086 3083 psecuritypriv->busetkipkey = true; ··· 3089 3086 else if (strcmp(param->u.crypt.alg, "CCMP") == 0) { 3090 3087 psecuritypriv->dot118021XGrpPrivacy = _AES_; 3091 3088 3092 - memcpy(psecuritypriv->dot118021XGrpKey[param->u.crypt.idx].skey, param->u.crypt.key, (param->u.crypt.key_len > 16 ? 16 : param->u.crypt.key_len)); 3089 + memcpy(grpkey, param->u.crypt.key, (param->u.crypt.key_len > 16 ? 16 : param->u.crypt.key_len)); 3093 3090 } else { 3094 3091 psecuritypriv->dot118021XGrpPrivacy = _NO_PRIVACY_; 3095 3092 } ··· 3145 3142 3146 3143 } else { /* group key??? */ 3147 3144 if (strcmp(param->u.crypt.alg, "WEP") == 0) { 3148 - memcpy(psecuritypriv->dot118021XGrpKey[param->u.crypt.idx].skey, param->u.crypt.key, (param->u.crypt.key_len > 16 ? 16 : param->u.crypt.key_len)); 3145 + memcpy(grpkey, param->u.crypt.key, (param->u.crypt.key_len > 16 ? 16 : param->u.crypt.key_len)); 3149 3146 3150 3147 psecuritypriv->dot118021XGrpPrivacy = _WEP40_; 3151 3148 if (param->u.crypt.key_len == 13) ··· 3153 3150 } else if (strcmp(param->u.crypt.alg, "TKIP") == 0) { 3154 3151 psecuritypriv->dot118021XGrpPrivacy = _TKIP_; 3155 3152 3156 - memcpy(psecuritypriv->dot118021XGrpKey[param->u.crypt.idx].skey, param->u.crypt.key, (param->u.crypt.key_len > 16 ? 16 : param->u.crypt.key_len)); 3153 + memcpy(grpkey, param->u.crypt.key, (param->u.crypt.key_len > 16 ? 16 : param->u.crypt.key_len)); 3157 3154 3158 3155 /* DEBUG_ERR("set key length :param->u.crypt.key_len =%d\n", param->u.crypt.key_len); */ 3159 3156 /* set mic key */ 3160 - memcpy(psecuritypriv->dot118021XGrptxmickey[param->u.crypt.idx].skey, &(param->u.crypt.key[16]), 8); 3161 - memcpy(psecuritypriv->dot118021XGrprxmickey[param->u.crypt.idx].skey, &(param->u.crypt.key[24]), 8); 3157 + memcpy(txkey, &(param->u.crypt.key[16]), 8); 3158 + memcpy(rxkey, &(param->u.crypt.key[24]), 8); 3162 3159 3163 3160 psecuritypriv->busetkipkey = true; 3164 3161 3165 3162 } else if (strcmp(param->u.crypt.alg, "CCMP") == 0) { 3166 3163 psecuritypriv->dot118021XGrpPrivacy = _AES_; 3167 3164 3168 - memcpy(psecuritypriv->dot118021XGrpKey[param->u.crypt.idx].skey, param->u.crypt.key, (param->u.crypt.key_len > 16 ? 16 : param->u.crypt.key_len)); 3165 + memcpy(grpkey, param->u.crypt.key, (param->u.crypt.key_len > 16 ? 16 : param->u.crypt.key_len)); 3169 3166 } else { 3170 3167 psecuritypriv->dot118021XGrpPrivacy = _NO_PRIVACY_; 3171 3168 }