* [chrome-os:chromeos-4.4 23/39] net/core/ethtool.c:648:5-34: Move constant to right.
@ 2020-09-02 2:15 kernel test robot
2020-09-02 2:15 ` [PATCH] UPSTREAM:net: ethtool: fix compare_const_fl.cocci warnings kernel test robot
0 siblings, 1 reply; 4+ messages in thread
From: kernel test robot @ 2020-09-02 2:15 UTC (permalink / raw
To: kbuild
[-- Attachment #1: Type: text/plain, Size: 1094 bytes --]
CC: kbuild-all(a)lists.01.org
TO: cros-kernel-buildreports(a)googlegroups.com
TO: Guenter Roeck <groeck@google.com>
tree: https://chromium.googlesource.com/chromiumos/third_party/kernel chromeos-4.4
head: 718be6ad0e1b9e4a35f04c66a844a0d0298d7e35
commit: 9dbdde22e919de21d4297fedc79bee9fc8538154 [23/39] UPSTREAM:net: ethtool: add new ETHTOOL_xLINKSETTINGS API
:::::: branch date: 2 days ago
:::::: commit date: 4 days ago
config: c6x-randconfig-c004-20200901 (attached as .config)
compiler: c6x-elf-gcc (GCC) 7.5.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Julia Lawall <julia.lawall@lip6.fr>
coccinelle warnings: (new ones prefixed by >>)
>> 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.
Please review and possibly fold the followup patch.
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 17905 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] UPSTREAM:net: ethtool: fix compare_const_fl.cocci warnings
2020-09-02 2:15 [chrome-os:chromeos-4.4 23/39] net/core/ethtool.c:648:5-34: Move constant to right kernel test robot
@ 2020-09-02 2:15 ` kernel test robot
0 siblings, 0 replies; 4+ messages in thread
From: kernel test robot @ 2020-09-02 2:15 UTC (permalink / raw
To: kbuild
[-- Attachment #1: Type: text/plain, Size: 2454 bytes --]
CC: kbuild-all(a)lists.01.org
TO: cros-kernel-buildreports(a)googlegroups.com
TO: Guenter Roeck <groeck@google.com>
From: kernel test robot <lkp@intel.com>
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 <decot@googlers.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---
tree: https://chromium.googlesource.com/chromiumos/third_party/kernel chromeos-4.4
head: 718be6ad0e1b9e4a35f04c66a844a0d0298d7e35
commit: 9dbdde22e919de21d4297fedc79bee9fc8538154 [23/39] UPSTREAM:net: ethtool: 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
- != link_ksettings.base.link_mode_masks_nwords) {
+ if (link_ksettings.base.link_mode_masks_nwords
+ != __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
- != link_ksettings.base.link_mode_masks_nwords)
+ if (link_ksettings.base.link_mode_masks_nwords
+ != __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
- != link_ksettings.base.link_mode_masks_nwords)
+ if (link_ksettings.base.link_mode_masks_nwords
+ != __ETHTOOL_LINK_MODE_MASK_NU32)
return -EINVAL;
return dev->ethtool_ops->set_link_ksettings(dev, &link_ksettings);
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] UPSTREAM:net: ethtool: fix compare_const_fl.cocci warnings
@ 2020-09-02 10:22 Julia Lawall
2020-09-02 16:42 ` Guenter Roeck
0 siblings, 1 reply; 4+ messages in thread
From: Julia Lawall @ 2020-09-02 10:22 UTC (permalink / raw
To: kbuild-all
[-- Attachment #1: Type: text/plain, Size: 2187 bytes --]
From: kernel test robot <lkp@intel.com>
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 <decot@googlers.com>
Signed-off-by: kernel test robot <lkp@intel.com>
Signed-off-by: Julia Lawall <julia.lawall@inria.fr>
---
tree: https://chromium.googlesource.com/chromiumos/third_party/kernel chromeos-4.4
head: 718be6ad0e1b9e4a35f04c66a844a0d0298d7e35
commit: 9dbdde22e919de21d4297fedc79bee9fc8538154 [23/39] UPSTREAM:net: ethtool: 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
- != link_ksettings.base.link_mode_masks_nwords) {
+ if (link_ksettings.base.link_mode_masks_nwords
+ != __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
- != link_ksettings.base.link_mode_masks_nwords)
+ if (link_ksettings.base.link_mode_masks_nwords
+ != __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
- != link_ksettings.base.link_mode_masks_nwords)
+ if (link_ksettings.base.link_mode_masks_nwords
+ != __ETHTOOL_LINK_MODE_MASK_NU32)
return -EINVAL;
return dev->ethtool_ops->set_link_ksettings(dev, &link_ksettings);
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] UPSTREAM:net: ethtool: fix compare_const_fl.cocci warnings
2020-09-02 10:22 Julia Lawall
@ 2020-09-02 16:42 ` Guenter Roeck
0 siblings, 0 replies; 4+ messages in thread
From: Guenter Roeck @ 2020-09-02 16:42 UTC (permalink / raw
To: kbuild-all
[-- Attachment #1: Type: text/plain, Size: 2796 bytes --]
On Wed, Sep 2, 2020 at 3:22 AM Julia Lawall <julia.lawall@inria.fr> wrote:
>
> From: kernel test robot <lkp@intel.com>
>
> 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 <decot@googlers.com>
> Signed-off-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Julia Lawall <julia.lawall@inria.fr>
> ---
>
> tree: https://chromium.googlesource.com/chromiumos/third_party/kernel chromeos-4.4
> head: 718be6ad0e1b9e4a35f04c66a844a0d0298d7e35
> commit: 9dbdde22e919de21d4297fedc79bee9fc8538154 [23/39] UPSTREAM:net: ethtool: 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.
>
Yoda Programming I dislike too, but that kind of change should really
be made in the upstream kernel (in net/ethtool/ioctl.c). No idea how
Dave thinks about that.
Thanks,
Guenter
> 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
> - != link_ksettings.base.link_mode_masks_nwords) {
> + if (link_ksettings.base.link_mode_masks_nwords
> + != __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
> - != link_ksettings.base.link_mode_masks_nwords)
> + if (link_ksettings.base.link_mode_masks_nwords
> + != __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
> - != link_ksettings.base.link_mode_masks_nwords)
> + if (link_ksettings.base.link_mode_masks_nwords
> + != __ETHTOOL_LINK_MODE_MASK_NU32)
> return -EINVAL;
>
> return dev->ethtool_ops->set_link_ksettings(dev, &link_ksettings);
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-09-02 16:42 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-09-02 2:15 [chrome-os:chromeos-4.4 23/39] net/core/ethtool.c:648:5-34: Move constant to right kernel test robot
2020-09-02 2:15 ` [PATCH] UPSTREAM:net: ethtool: fix compare_const_fl.cocci warnings kernel test robot
-- strict thread matches above, loose matches on Subject: below --
2020-09-02 10:22 Julia Lawall
2020-09-02 16:42 ` Guenter Roeck
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.