Re: [PATCH] HID: hid-sensor-hub: Fix sparse warning

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 26 Feb 2015, Srinivas Pandruvada wrote:

> Address issue reported by kbuild test robot <fengguang.wu@xxxxxxxxx>
> 
> sparse warnings: (new ones prefixed by >>)
> 
> >> drivers/hid/hid-sensor-hub.c:223:39: sparse: incorrect type in argument 3 (different base types)
>    drivers/hid/hid-sensor-hub.c:223:39:    expected signed int [signed] [usertype] [explicitly-signed] <noident>
>    drivers/hid/hid-sensor-hub.c:223:39:    got restricted __le32 [usertype] <noident>
> >> drivers/hid/hid-sensor-hub.c:231:31: sparse: incorrect type in argument 3 (different base types)
>    drivers/hid/hid-sensor-hub.c:231:31:    expected signed int [signed] [usertype] [explicitly-signed] <noident>
>    drivers/hid/hid-sensor-hub.c:231:31:    got restricted __le32 [usertype] <noident>
> 
> vim +223 drivers/hid/hid-sensor-hub.c
> 
>    217          }
>    218
>    219          remaining_bytes = do_div(buffer_size, sizeof(__s32));
>    220          if (buffer_size) {
>    221                  for (i = 0; i < buffer_size; ++i) {
>    222                          hid_set_field(report->field[field_index], i,
>  > 223                                        cpu_to_le32(*buf32));
>    224                          ++buf32;
>    225                  }
>    226          }
>    227          if (remaining_bytes) {
>    228                  value = 0;
>    229                  memcpy(&value, (u8 *)buf32, remaining_bytes);
>    230                  hid_set_field(report->field[field_index], i,
>  > 231                                cpu_to_le32(value));
>    232          }
>    233          hid_hw_request(hsdev->hdev, report, HID_REQ_SET_REPORT);
>    234          hid_hw_wait(hsdev->hdev);
> 
> Since I can't change the type of hid_set_field argument 3, using __force __s32 to remove
> this warning.

Queued in for-4.1/sensor-hub

> ---

This '---' is wrong here, it would make git ignore your signoff. I have 
fixed that up.

> 
> Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@xxxxxxxxxxxxxxx>

-- 
Jiri Kosina
SUSE Labs
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux