@@ -33,27 +33,22 @@ int get_report_descriptor(int sensor_idx, u8 *rep_desc)
{
switch (sensor_idx) {
case accel_idx: /* accel */
- memset(rep_desc, 0, sizeof(accel3_report_descriptor));
memcpy(rep_desc, accel3_report_descriptor,
sizeof(accel3_report_descriptor));
break;
case gyro_idx: /* gyro */
- memset(rep_desc, 0, sizeof(gyro3_report_descriptor));
memcpy(rep_desc, gyro3_report_descriptor,
sizeof(gyro3_report_descriptor));
break;
case mag_idx: /* Magnetometer */
- memset(rep_desc, 0, sizeof(comp3_report_descriptor));
memcpy(rep_desc, comp3_report_descriptor,
sizeof(comp3_report_descriptor));
break;
case als_idx: /* ambient light sensor */
- memset(rep_desc, 0, sizeof(als_report_descriptor));
memcpy(rep_desc, als_report_descriptor,
sizeof(als_report_descriptor));
break;
case HPD_IDX: /* HPD sensor */
- memset(rep_desc, 0, sizeof(hpd_report_descriptor));
memcpy(rep_desc, hpd_report_descriptor,
sizeof(hpd_report_descriptor));
break;
The region set by the call to memset is immediately overwritten by the subsequent call to memcpy. So we drop redundant memset. Signed-off-by: Haowen Bai <baihaowen@meizu.com> --- drivers/hid/amd-sfh-hid/hid_descriptor/amd_sfh_hid_desc.c | 5 ----- 1 file changed, 5 deletions(-)