Messages in this thread | | | From | Chaitanya Kulkarni <> | Subject | Re: [PATCH v2] target: iscsi: fix clang -Wformat warnings | Date | Mon, 18 Jul 2022 21:35:27 +0000 |
| |
On 7/18/22 11:04, Justin Stitt wrote: > When building with Clang we encounter these warnings: > | drivers/target/iscsi/iscsi_target_login.c:719:24: error: format > | specifies type 'unsigned short' but the argument has type 'int' > | [-Werror,-Wformat] " from node: %s\n", atomic_read(&sess->nconn), > - > | drivers/target/iscsi/iscsi_target_login.c:767:12: error: format > | specifies type 'unsigned short' but the argument has type 'int' > | [-Werror,-Wformat] " %s\n", atomic_read(&sess->nconn), > - > | drivers/target/iscsi/iscsi_target.c:4365:12: error: format specifies > | type 'unsigned short' but the argument has type 'int' [-Werror,-Wformat] > | " %s\n", atomic_read(&sess->nconn) > > For all warnings, the format specifier is `%hu` which describes an > unsigned short. The resulting type of atomic_read is an int. The > proposed fix is to listen to Clang and swap the format specifier. > > Link: https://github.com/ClangBuiltLinux/linux/issues/378 > Signed-off-by: Justin Stitt <justinstitt@google.com>
Looks good.
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
-ck
| |