Commit f785738f authored by Jiri Slaby (SUSE)'s avatar Jiri Slaby (SUSE) Committed by sanglipeng
Browse files

wireguard: timers: cast enum limits members to int in prints

stable inclusion
from stable-v5.10.180
commit 5434c7019d2308a474ddb8accbb7279f1a327036
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I8DDFN

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=5434c7019d2308a474ddb8accbb7279f1a327036

--------------------------------

commit 2d4ee16d upstream.

Since gcc13, each member of an enum has the same type as the enum. And
that is inherited from its members. Provided "REKEY_AFTER_MESSAGES =
1ULL << 60", the named type is unsigned long.

This generates warnings with gcc-13:
  error: format '%d' expects argument of type 'int', but argument 6 has type 'long unsigned int'

Cast those particular enum members to int when printing them.

Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=36113


Cc: Martin Liska <mliska@suse.cz>
Signed-off-by: default avatarJiri Slaby (SUSE) <jirislaby@kernel.org>
Signed-off-by: default avatarJason A. Donenfeld <Jason@zx2c4.com>
Link: https://lore.kernel.org/all/20221213225208.3343692-2-Jason@zx2c4.com/


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
Cc: Chris Clayton <chris2553@googlemail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarsanglipeng <sanglipeng1@jd.com>
parent 46f4b871
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment