Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

vlan: use correct format characters

When compiling with -Wformat, clang emits the following warning:

net/8021q/vlanproc.c:284:22: warning: format specifies type 'unsigned
short' but the argument has type 'int' [-Wformat]
mp->priority, ((mp->vlan_qos >> 13) & 0x7));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~

The types of these arguments are unconditionally defined, so this patch
updates the format character to the correct ones for ints and unsigned
ints.

Link: https://github.com/ClangBuiltLinux/linux/issues/378
Signed-off-by: Bill Wendling <morbo@google.com>
Link: https://lore.kernel.org/r/20220316213125.2353370-1-morbo@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Bill Wendling and committed by
Jakub Kicinski
8624a95e c011072c

+1 -1
+1 -1
net/8021q/vlanproc.c
··· 280 280 const struct vlan_priority_tci_mapping *mp 281 281 = vlan->egress_priority_map[i]; 282 282 while (mp) { 283 - seq_printf(seq, "%u:%hu ", 283 + seq_printf(seq, "%u:%d ", 284 284 mp->priority, ((mp->vlan_qos >> 13) & 0x7)); 285 285 mp = mp->next; 286 286 }