From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.0 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DE25BC433E0 for ; Mon, 10 Aug 2020 14:11:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BF2E620748 for ; Mon, 10 Aug 2020 14:11:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726990AbgHJOLZ (ORCPT ); Mon, 10 Aug 2020 10:11:25 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:48704 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726814AbgHJOLY (ORCPT ); Mon, 10 Aug 2020 10:11:24 -0400 Received: from andrew by vps0.lunn.ch with local (Exim 4.94) (envelope-from ) id 1k58WI-008xB0-9z; Mon, 10 Aug 2020 16:11:22 +0200 Date: Mon, 10 Aug 2020 16:11:22 +0200 From: Andrew Lunn To: Michal Kubecek Cc: netdev@vger.kernel.org Subject: Re: [PATCH ethtool 1/7] netlink: get rid of signed/unsigned comparison warnings Message-ID: <20200810141122.GD2123435@lunn.ch> References: <90fd688121efaea8acce2a9547585416433493f3.1597007533.git.mkubecek@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <90fd688121efaea8acce2a9547585416433493f3.1597007533.git.mkubecek@suse.cz> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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 > --- > 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