Please check on the various mentioned lines. Based on the definitions of the macros, I don't see any benefit from duplicating the constants, so perhaps something else was intended. julia ---------- Forwarded message ---------- Date: Thu, 3 Nov 2022 04:06:42 +0800 From: kernel test robot To: oe-kbuild@lists.linux.dev Cc: lkp@intel.com, Julia Lawall Subject: [linux-next:master 3930/4832] drivers/net/phy/motorcomm.c:1122:8-35: duplicated argument to & or | BCC: lkp@intel.com CC: oe-kbuild-all@lists.linux.dev CC: Linux Memory Management List TO: Frank CC: Andrew Lunn tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master head: 61c3426aca2c71052ddcd06c32e29d92304990fd commit: 70479a40954cf353e87a486997a3477108c75aa9 [3930/4832] net: phy: Add driver for Motorcomm yt8521 gigabit ethernet phy :::::: branch date: 16 hours ago :::::: commit date: 2 days ago config: i386-randconfig-c001 compiler: gcc-11 (Debian 11.3.0-8) 11.3.0 If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot | Reported-by: Julia Lawall cocci warnings: (new ones prefixed by >>) >> drivers/net/phy/motorcomm.c:1122:8-35: duplicated argument to & or | drivers/net/phy/motorcomm.c:1126:8-35: duplicated argument to & or | drivers/net/phy/motorcomm.c:1130:8-34: duplicated argument to & or | drivers/net/phy/motorcomm.c:1134:8-34: duplicated argument to & or | vim +1122 drivers/net/phy/motorcomm.c 70479a40954cf3 Frank 2022-10-28 1103 70479a40954cf3 Frank 2022-10-28 1104 /** 70479a40954cf3 Frank 2022-10-28 1105 * yt8521_config_init() - called to initialize the PHY 70479a40954cf3 Frank 2022-10-28 1106 * @phydev: a pointer to a &struct phy_device 70479a40954cf3 Frank 2022-10-28 1107 * 70479a40954cf3 Frank 2022-10-28 1108 * returns 0 or negative errno code 70479a40954cf3 Frank 2022-10-28 1109 */ 70479a40954cf3 Frank 2022-10-28 1110 static int yt8521_config_init(struct phy_device *phydev) 70479a40954cf3 Frank 2022-10-28 1111 { 70479a40954cf3 Frank 2022-10-28 1112 int old_page; 70479a40954cf3 Frank 2022-10-28 1113 int ret = 0; 70479a40954cf3 Frank 2022-10-28 1114 u16 val; 70479a40954cf3 Frank 2022-10-28 1115 70479a40954cf3 Frank 2022-10-28 1116 old_page = phy_select_page(phydev, YT8521_RSSR_UTP_SPACE); 70479a40954cf3 Frank 2022-10-28 1117 if (old_page < 0) 70479a40954cf3 Frank 2022-10-28 1118 goto err_restore_page; 70479a40954cf3 Frank 2022-10-28 1119 70479a40954cf3 Frank 2022-10-28 1120 switch (phydev->interface) { 70479a40954cf3 Frank 2022-10-28 1121 case PHY_INTERFACE_MODE_RGMII: 70479a40954cf3 Frank 2022-10-28 @1122 val = YT8521_RC1R_GE_TX_DELAY_DIS | YT8521_RC1R_GE_TX_DELAY_DIS; 70479a40954cf3 Frank 2022-10-28 1123 val |= YT8521_RC1R_RX_DELAY_DIS; 70479a40954cf3 Frank 2022-10-28 1124 break; 70479a40954cf3 Frank 2022-10-28 1125 case PHY_INTERFACE_MODE_RGMII_RXID: 70479a40954cf3 Frank 2022-10-28 1126 val = YT8521_RC1R_GE_TX_DELAY_DIS | YT8521_RC1R_GE_TX_DELAY_DIS; 70479a40954cf3 Frank 2022-10-28 1127 val |= YT8521_RC1R_RX_DELAY_EN; 70479a40954cf3 Frank 2022-10-28 1128 break; 70479a40954cf3 Frank 2022-10-28 1129 case PHY_INTERFACE_MODE_RGMII_TXID: 70479a40954cf3 Frank 2022-10-28 1130 val = YT8521_RC1R_GE_TX_DELAY_EN | YT8521_RC1R_GE_TX_DELAY_EN; 70479a40954cf3 Frank 2022-10-28 1131 val |= YT8521_RC1R_RX_DELAY_DIS; 70479a40954cf3 Frank 2022-10-28 1132 break; 70479a40954cf3 Frank 2022-10-28 1133 case PHY_INTERFACE_MODE_RGMII_ID: 70479a40954cf3 Frank 2022-10-28 1134 val = YT8521_RC1R_GE_TX_DELAY_EN | YT8521_RC1R_GE_TX_DELAY_EN; 70479a40954cf3 Frank 2022-10-28 1135 val |= YT8521_RC1R_RX_DELAY_EN; 70479a40954cf3 Frank 2022-10-28 1136 break; 70479a40954cf3 Frank 2022-10-28 1137 case PHY_INTERFACE_MODE_SGMII: 70479a40954cf3 Frank 2022-10-28 1138 break; 70479a40954cf3 Frank 2022-10-28 1139 default: /* do not support other modes */ 70479a40954cf3 Frank 2022-10-28 1140 ret = -EOPNOTSUPP; 70479a40954cf3 Frank 2022-10-28 1141 goto err_restore_page; 70479a40954cf3 Frank 2022-10-28 1142 } 70479a40954cf3 Frank 2022-10-28 1143 70479a40954cf3 Frank 2022-10-28 1144 /* set rgmii delay mode */ 70479a40954cf3 Frank 2022-10-28 1145 if (phydev->interface != PHY_INTERFACE_MODE_SGMII) { 70479a40954cf3 Frank 2022-10-28 1146 ret = ytphy_modify_ext(phydev, YT8521_RGMII_CONFIG1_REG, 70479a40954cf3 Frank 2022-10-28 1147 (YT8521_RC1R_RX_DELAY_MASK | 70479a40954cf3 Frank 2022-10-28 1148 YT8521_RC1R_FE_TX_DELAY_MASK | 70479a40954cf3 Frank 2022-10-28 1149 YT8521_RC1R_GE_TX_DELAY_MASK), 70479a40954cf3 Frank 2022-10-28 1150 val); 70479a40954cf3 Frank 2022-10-28 1151 if (ret < 0) 70479a40954cf3 Frank 2022-10-28 1152 goto err_restore_page; 70479a40954cf3 Frank 2022-10-28 1153 } 70479a40954cf3 Frank 2022-10-28 1154 70479a40954cf3 Frank 2022-10-28 1155 /* disable auto sleep */ 70479a40954cf3 Frank 2022-10-28 1156 ret = ytphy_modify_ext(phydev, YT8521_EXTREG_SLEEP_CONTROL1_REG, 70479a40954cf3 Frank 2022-10-28 1157 YT8521_ESC1R_SLEEP_SW, 0); 70479a40954cf3 Frank 2022-10-28 1158 if (ret < 0) 70479a40954cf3 Frank 2022-10-28 1159 goto err_restore_page; 70479a40954cf3 Frank 2022-10-28 1160 70479a40954cf3 Frank 2022-10-28 1161 /* enable RXC clock when no wire plug */ 70479a40954cf3 Frank 2022-10-28 1162 ret = ytphy_modify_ext(phydev, YT8521_CLOCK_GATING_REG, 70479a40954cf3 Frank 2022-10-28 1163 YT8521_CGR_RX_CLK_EN, 0); 70479a40954cf3 Frank 2022-10-28 1164 if (ret < 0) 70479a40954cf3 Frank 2022-10-28 1165 goto err_restore_page; 70479a40954cf3 Frank 2022-10-28 1166 70479a40954cf3 Frank 2022-10-28 1167 err_restore_page: 70479a40954cf3 Frank 2022-10-28 1168 return phy_restore_page(phydev, old_page, ret); 70479a40954cf3 Frank 2022-10-28 1169 } 70479a40954cf3 Frank 2022-10-28 1170 -- 0-DAY CI Kernel Test Service https://01.org/lkp