Skip to content

Commit 0ec29cc

Browse files
bwendlingarndb
authored andcommitted
soc: qcom: smem: use correct format characters
When compiling with -Wformat, clang emits the following warnings: drivers/soc/qcom/smem.c:847:41: warning: format specifies type 'unsigned short' but the argument has type 'unsigned int' [-Wformat] dev_err(smem->dev, "bad host %hu\n", remote_host); ~~~ ^~~~~~~~~~~ %u ./include/linux/dev_printk.h:144:65: note: expanded from macro 'dev_err' dev_printk_index_wrap(_dev_err, KERN_ERR, dev, dev_fmt(fmt), ##__VA_ARGS__) ~~~ ^~~~~~~~~~~ ./include/linux/dev_printk.h:110:23: note: expanded from macro 'dev_printk_index_wrap' _p_func(dev, fmt, ##__VA_ARGS__); \ ~~~ ^~~~~~~~~~~ drivers/soc/qcom/smem.c:852:47: warning: format specifies type 'unsigned short' but the argument has type 'unsigned int' [-Wformat] dev_err(smem->dev, "duplicate host %hu\n", remote_host); ~~~ ^~~~~~~~~~~ %u ./include/linux/dev_printk.h:144:65: note: expanded from macro 'dev_err' dev_printk_index_wrap(_dev_err, KERN_ERR, dev, dev_fmt(fmt), ##__VA_ARGS__) ~~~ ^~~~~~~~~~~ ./include/linux/dev_printk.h:110:23: note: expanded from macro 'dev_printk_index_wrap' _p_func(dev, fmt, ##__VA_ARGS__); \ ~~~ ^~~~~~~~~~~ The types of these arguments are unconditionally defined, so this patch updates the format character to the correct one and change type of remote_host to "u16" to match with other types. Signed-off-by: Bill Wendling <[email protected]> Tested-by: Justin Stitt <[email protected]> Reviewed-by: Justin Stitt <[email protected]> Link: ClangBuiltLinux#378 Signed-off-by: Arnd Bergmann <[email protected]>
1 parent 7ecd8a7 commit 0ec29cc

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/soc/qcom/smem.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -926,7 +926,7 @@ qcom_smem_enumerate_partitions(struct qcom_smem *smem, u16 local_host)
926926
struct smem_partition_header *header;
927927
struct smem_ptable_entry *entry;
928928
struct smem_ptable *ptable;
929-
unsigned int remote_host;
929+
u16 remote_host;
930930
u16 host0, host1;
931931
int i;
932932

@@ -951,12 +951,12 @@ qcom_smem_enumerate_partitions(struct qcom_smem *smem, u16 local_host)
951951
continue;
952952

953953
if (remote_host >= SMEM_HOST_COUNT) {
954-
dev_err(smem->dev, "bad host %hu\n", remote_host);
954+
dev_err(smem->dev, "bad host %u\n", remote_host);
955955
return -EINVAL;
956956
}
957957

958958
if (smem->partitions[remote_host].virt_base) {
959-
dev_err(smem->dev, "duplicate host %hu\n", remote_host);
959+
dev_err(smem->dev, "duplicate host %u\n", remote_host);
960960
return -EINVAL;
961961
}
962962

0 commit comments

Comments
 (0)