Skip to content

Commit

Permalink
HID: uclogic: Fix warning in uclogic_rdesc_template_apply
Browse files Browse the repository at this point in the history
[ Upstream commit 609174e ]

Building with Sparse enabled prints this warning:

    warning: incorrect type in assignment (different base types)
        expected signed int x
        got restricted __le32 [usertype]

Cast the return value of cpu_to_le32() to fix the warning.

Fixes: 08177f4 ("HID: uclogic: merge hid-huion driver in hid-uclogic")
Signed-off-by: José Expósito <jose.exposito89@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
JoseExposito authored and gregkh committed Oct 21, 2022
1 parent 0e1cd92 commit 176876d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/hid/hid-uclogic-rdesc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1113,7 +1113,7 @@ __u8 *uclogic_rdesc_template_apply(const __u8 *template_ptr,
memcmp(p, pen_head, sizeof(pen_head)) == 0 &&
p[sizeof(pen_head)] < param_num) {
v = param_list[p[sizeof(pen_head)]];
put_unaligned(cpu_to_le32(v), (s32 *)p);
put_unaligned((__force u32)cpu_to_le32(v), (s32 *)p);
p += sizeof(pen_head) + 1;
} else if (memcmp(p, btn_head, sizeof(btn_head)) == 0 &&
p[sizeof(btn_head)] < param_num) {
Expand Down

0 comments on commit 176876d

Please sign in to comment.