From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: multipart/mixed; boundary="===============0802812086125691345==" MIME-Version: 1.0 From: kernel test robot Subject: [PATCH] UPSTREAM:net: ethtool: fix compare_const_fl.cocci warnings Date: Wed, 02 Sep 2020 10:15:57 +0800 Message-ID: <20200902021557.GA26875@a6e1cfe33f74> In-Reply-To: <202009021032.4Z8nJhzC%lkp@intel.com> List-Id: To: kbuild@lists.01.org --===============0802812086125691345== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable CC: kbuild-all(a)lists.01.org TO: cros-kernel-buildreports(a)googlegroups.com TO: Guenter Roeck From: kernel test robot net/core/ethtool.c:648:5-34: Move constant to right. net/core/ethtool.c:712:5-34: Move constant to right. net/core/ethtool.c:724:5-34: Move constant to right. Move constants to the right of binary operators. Semantic patch information: Depends on personal taste in some cases. Generated by: scripts/coccinelle/misc/compare_const_fl.cocci Fixes: 9dbdde22e919 ("UPSTREAM:net: ethtool: add new ETHTOOL_xLINKSETTINGS = API") CC: David Decotigny Signed-off-by: kernel test robot --- tree: https://chromium.googlesource.com/chromiumos/third_party/kernel chr= omeos-4.4 head: 718be6ad0e1b9e4a35f04c66a844a0d0298d7e35 commit: 9dbdde22e919de21d4297fedc79bee9fc8538154 [23/39] UPSTREAM:net: etht= ool: add new ETHTOOL_xLINKSETTINGS API :::::: branch date: 2 days ago :::::: commit date: 4 days ago Please take the patch only if it's a positive warning. Thanks! ethtool.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) --- a/net/core/ethtool.c +++ b/net/core/ethtool.c @@ -645,8 +645,8 @@ static int ethtool_get_link_ksettings(st sizeof(link_ksettings.base))) return -EFAULT; = - if (__ETHTOOL_LINK_MODE_MASK_NU32 - !=3D link_ksettings.base.link_mode_masks_nwords) { + if (link_ksettings.base.link_mode_masks_nwords + !=3D __ETHTOOL_LINK_MODE_MASK_NU32) { /* wrong link mode nbits requested */ memset(&link_ksettings, 0, sizeof(link_ksettings)); /* keep cmd field reset to 0 */ @@ -709,8 +709,8 @@ static int ethtool_set_link_ksettings(st sizeof(link_ksettings.base))) return -EFAULT; = - if (__ETHTOOL_LINK_MODE_MASK_NU32 - !=3D link_ksettings.base.link_mode_masks_nwords) + if (link_ksettings.base.link_mode_masks_nwords + !=3D __ETHTOOL_LINK_MODE_MASK_NU32) return -EINVAL; = /* copy the whole structure, now that we know it has expected @@ -721,8 +721,8 @@ static int ethtool_set_link_ksettings(st return err; = /* re-check nwords field, just in case */ - if (__ETHTOOL_LINK_MODE_MASK_NU32 - !=3D link_ksettings.base.link_mode_masks_nwords) + if (link_ksettings.base.link_mode_masks_nwords + !=3D __ETHTOOL_LINK_MODE_MASK_NU32) return -EINVAL; = return dev->ethtool_ops->set_link_ksettings(dev, &link_ksettings); --===============0802812086125691345==--