[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200810141122.GD2123435@lunn.ch>
Date: Mon, 10 Aug 2020 16:11:22 +0200
From: Andrew Lunn <andrew@...n.ch>
To: Michal Kubecek <mkubecek@...e.cz>
Cc: netdev@...r.kernel.org
Subject: Re: [PATCH ethtool 1/7] netlink: get rid of signed/unsigned
comparison warnings
On Sun, Aug 09, 2020 at 11:24:19PM +0200, Michal Kubecek wrote:
> Get rid of compiler warnings about comparison between signed and
> unsigned integer values in netlink code.
>
> Signed-off-by: Michal Kubecek <mkubecek@...e.cz>
> ---
> netlink/features.c | 4 ++--
> netlink/netlink.c | 4 ++--
> netlink/netlink.h | 2 +-
> netlink/nlsock.c | 2 +-
> netlink/parser.c | 2 +-
> netlink/settings.c | 6 +++---
> 6 files changed, 10 insertions(+), 10 deletions(-)
>
> diff --git a/netlink/features.c b/netlink/features.c
> index 8b5b8588ca23..f5862e97a265 100644
> --- a/netlink/features.c
> +++ b/netlink/features.c
> @@ -149,7 +149,7 @@ int dump_features(const struct nlattr *const *tb,
> continue;
>
> for (j = 0; j < results.count; j++) {
> - if (feature_flags[j] == i) {
> + if (feature_flags[j] == (int)i) {
> n_match++;
> flag_value = flag_value ||
> feature_on(results.active, j);
> @@ -163,7 +163,7 @@ int dump_features(const struct nlattr *const *tb,
> for (j = 0; j < results.count; j++) {
> const char *name = get_string(feature_names, j);
>
> - if (feature_flags[j] != i)
> + if (feature_flags[j] != (int)i)
Hi Michal
Would it be better to make feature_flags an unsigned int * ? And
change the -1 to MAX_UNIT?
Andrew
Powered by blists - more mailing lists