* [PATCH RESEND] HID: uclogic: Fix warning in uclogic_rdesc_template_apply
@ 2022-08-15 14:27 José Expósito
2022-08-25 8:25 ` Jiri Kosina
0 siblings, 1 reply; 2+ messages in thread
From: José Expósito @ 2022-08-15 14:27 UTC (permalink / raw)
To: jikos
Cc: benjamin.tissoires, spbnick, linux-input, linux-kernel,
José Expósito
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>
---
Kindly resending this patch so it doesn't get lost after the merge
window.
---
drivers/hid/hid-uclogic-rdesc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/hid/hid-uclogic-rdesc.c b/drivers/hid/hid-uclogic-rdesc.c
index 3d68e8b0784d..81ca22398ed5 100644
--- a/drivers/hid/hid-uclogic-rdesc.c
+++ b/drivers/hid/hid-uclogic-rdesc.c
@@ -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) {
--
2.25.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH RESEND] HID: uclogic: Fix warning in uclogic_rdesc_template_apply
2022-08-15 14:27 [PATCH RESEND] HID: uclogic: Fix warning in uclogic_rdesc_template_apply José Expósito
@ 2022-08-25 8:25 ` Jiri Kosina
0 siblings, 0 replies; 2+ messages in thread
From: Jiri Kosina @ 2022-08-25 8:25 UTC (permalink / raw)
To: José Expósito
Cc: benjamin.tissoires, spbnick, linux-input, linux-kernel
On Mon, 15 Aug 2022, José Expósito wrote:
> 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>
>
> ---
>
> Kindly resending this patch so it doesn't get lost after the merge
> window.
> ---
> drivers/hid/hid-uclogic-rdesc.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/hid/hid-uclogic-rdesc.c b/drivers/hid/hid-uclogic-rdesc.c
> index 3d68e8b0784d..81ca22398ed5 100644
> --- a/drivers/hid/hid-uclogic-rdesc.c
> +++ b/drivers/hid/hid-uclogic-rdesc.c
> @@ -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) {
Applied, thank you José.
--
Jiri Kosina
SUSE Labs
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-08-25 8:26 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-15 14:27 [PATCH RESEND] HID: uclogic: Fix warning in uclogic_rdesc_template_apply José Expósito
2022-08-25 8:25 ` Jiri Kosina
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).