Skip to content

Commit

Permalink
mei: me: fix clang -Wformat warning
Browse files Browse the repository at this point in the history
jira LE-1907
Rebuild_History Non-Buildable kernel-rt-4.18.0-477.10.1.rt7.274.el8_8
commit-author Justin Stitt <justinstitt@google.com>
commit d618072

When building with Clang we encounter the following warning:
| drivers/misc/mei/hw-me.c:564:44: error: format specifies type 'unsigned
| short' but the argument has type 'int' [-Werror,-Wformat]
| dev_dbg(dev->dev, "empty slots = %hu.\n", empty_slots);

The format specifier used is `%hu` which specifies an unsigned short,
however, empty_slots is an int -- hence the warning.

Link: ClangBuiltLinux/linux#378
	Tested-by: Nick Desaulniers <ndesaulniers@google.com>
	Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
	Signed-off-by: Justin Stitt <justinstitt@google.com>
Link: https://lore.kernel.org/r/20220708203549.3834790-1-justinstitt@google.com
	Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit d618072)
	Signed-off-by: Jonathan Maple <jmaple@ciq.com>
  • Loading branch information
PlaidCat committed Sep 13, 2024
1 parent 36f8cfb commit 209bd4f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/misc/mei/hw-me.c
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ static int mei_me_hbuf_write(struct mei_device *dev,
dev_dbg(dev->dev, MEI_HDR_FMT, MEI_HDR_PRM((struct mei_msg_hdr *)hdr));

empty_slots = mei_hbuf_empty_slots(dev);
dev_dbg(dev->dev, "empty slots = %hu.\n", empty_slots);
dev_dbg(dev->dev, "empty slots = %d.\n", empty_slots);

if (empty_slots < 0)
return -EOVERFLOW;
Expand Down

0 comments on commit 209bd4f

Please sign in to comment.