Content-Type: multipart/mixed; boundary="===============3392472371497001835==" MIME-Version: 1.0 From: Julia Lawall To: kbuild-all@lists.01.org Subject: [PATCH] UPSTREAM:net: ethtool: fix compare_const_fl.cocci warnings Date: Wed, 02 Sep 2020 12:22:18 +0200 Message-ID: List-Id: --===============3392472371497001835== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: kernel test robot Move constants to the right of binary operators. 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 Signed-off-by: Julia Lawall --- 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 This is probably a matter of personal preference, but to me it does look a little nicer after the change. 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); --===============3392472371497001835==--