diff mbox series

[v2] net: phy: mscc: fix excluded_middle.cocci warnings

Message ID alpine.DEB.2.22.394.2011161633240.2682@hadrien
State Superseded
Headers show
Series [v2] net: phy: mscc: fix excluded_middle.cocci warnings | expand

Commit Message

Julia Lawall Nov. 16, 2020, 3:34 p.m. UTC
From: kernel test robot <lkp@intel.com>

Condition !A || A && B is equivalent to !A || B.

Generated by: scripts/coccinelle/misc/excluded_middle.cocci

Fixes: b76f0ea01312 ("coccinelle: misc: add excluded_middle.cocci script")
CC: Denis Efremov <efremov@linux.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
Signed-off-by: Julia Lawall <julia.lawall@inria.fr>
---

v2: add netdev mailing list

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   e28c0d7c92c89016c12a677616668957351e7542
commit: b76f0ea013125358d1b4ca147a6f9b6883dd2493 coccinelle: misc: add excluded_middle.cocci script
:::::: branch date: 8 hours ago
:::::: commit date: 8 weeks ago

Please take the patch only if it's a positive warning. Thanks!

 mscc_ptp.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Antoine Tenart Nov. 16, 2020, 9:15 p.m. UTC | #1
Hello Julia,

Quoting Julia Lawall (2020-11-16 16:34:44)
> From: kernel test robot <lkp@intel.com>
> 
> Condition !A || A && B is equivalent to !A || B.
> 
> Generated by: scripts/coccinelle/misc/excluded_middle.cocci
> 
> Fixes: b76f0ea01312 ("coccinelle: misc: add excluded_middle.cocci script")
> CC: Denis Efremov <efremov@linux.com>
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Julia Lawall <julia.lawall@inria.fr>

Reviewed-by: Antoine Tenart <atenart@kernel.org>

Thanks!
Antoine

> ---
> 
> v2: add netdev mailing list
> 
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> head:   e28c0d7c92c89016c12a677616668957351e7542
> commit: b76f0ea013125358d1b4ca147a6f9b6883dd2493 coccinelle: misc: add excluded_middle.cocci script
> :::::: branch date: 8 hours ago
> :::::: commit date: 8 weeks ago
> 
> Please take the patch only if it's a positive warning. Thanks!
> 
>  mscc_ptp.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> --- a/drivers/net/phy/mscc/mscc_ptp.c
> +++ b/drivers/net/phy/mscc/mscc_ptp.c
> @@ -136,7 +136,7 @@ static void vsc85xx_ts_write_csr(struct
> 
>         phy_ts_base_write(phydev, MSCC_EXT_PAGE_ACCESS, MSCC_PHY_PAGE_1588);
> 
> -       if (!cond || (cond && upper))
> +       if (!cond || upper)
>                 phy_ts_base_write(phydev, MSCC_PHY_TS_CSR_DATA_MSB, upper);
> 
>         phy_ts_base_write(phydev, MSCC_PHY_TS_CSR_DATA_LSB, lower);
Jakub Kicinski Nov. 17, 2020, 6:28 p.m. UTC | #2
On Mon, 16 Nov 2020 22:15:01 +0100 Antoine Tenart wrote:
> Quoting Julia Lawall (2020-11-16 16:34:44)
> > From: kernel test robot <lkp@intel.com>
> > 
> > Condition !A || A && B is equivalent to !A || B.
> > 
> > Generated by: scripts/coccinelle/misc/excluded_middle.cocci
> > 
> > Fixes: b76f0ea01312 ("coccinelle: misc: add excluded_middle.cocci script")
> > CC: Denis Efremov <efremov@linux.com>
> > Reported-by: kernel test robot <lkp@intel.com>
> > Signed-off-by: kernel test robot <lkp@intel.com>
> > Signed-off-by: Julia Lawall <julia.lawall@inria.fr>  
> 
> Reviewed-by: Antoine Tenart <atenart@kernel.org>

Applied, thanks!
diff mbox series

Patch

--- a/drivers/net/phy/mscc/mscc_ptp.c
+++ b/drivers/net/phy/mscc/mscc_ptp.c
@@ -136,7 +136,7 @@  static void vsc85xx_ts_write_csr(struct

 	phy_ts_base_write(phydev, MSCC_EXT_PAGE_ACCESS, MSCC_PHY_PAGE_1588);

-	if (!cond || (cond && upper))
+	if (!cond || upper)
 		phy_ts_base_write(phydev, MSCC_PHY_TS_CSR_DATA_MSB, upper);

 	phy_ts_base_write(phydev, MSCC_PHY_TS_CSR_DATA_LSB, lower);