drivers/usb/cdns3/cdnsp-gadget.c:1178:6: warning: variable 'temp_64' set but not used

From: kernel test robot
Date: Thu Sep 02 2021 - 08:33:47 EST


Hi Pawel,

FYI, the error/warning still remains.

tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 4ac6d90867a4de2e12117e755dbd76e08d88697f
commit: 3d82904559f4f5a2622db1b21de3edf2eded7664 usb: cdnsp: cdns3 Add main part of Cadence USBSSP DRD Driver
date: 8 months ago
config: i386-randconfig-a016-20210902 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project c9948e9254fbb6ea00f66c7b4542311d21e060be)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=3d82904559f4f5a2622db1b21de3edf2eded7664
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 3d82904559f4f5a2622db1b21de3edf2eded7664
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=i386

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All warnings (new ones prefixed by >>):

>> drivers/usb/cdns3/cdnsp-gadget.c:1178:6: warning: variable 'temp_64' set but not used [-Wunused-but-set-variable]
u64 temp_64;
^
1 warning generated.


vim +/temp_64 +1178 drivers/usb/cdns3/cdnsp-gadget.c

1173
1174 static int cdnsp_run(struct cdnsp_device *pdev,
1175 enum usb_device_speed speed)
1176 {
1177 u32 fs_speed = 0;
> 1178 u64 temp_64;
1179 u32 temp;
1180 int ret;
1181
1182 temp_64 = cdnsp_read_64(&pdev->ir_set->erst_dequeue);
1183 temp_64 &= ~ERST_PTR_MASK;
1184 temp = readl(&pdev->ir_set->irq_control);
1185 temp &= ~IMOD_INTERVAL_MASK;
1186 temp |= ((IMOD_DEFAULT_INTERVAL / 250) & IMOD_INTERVAL_MASK);
1187 writel(temp, &pdev->ir_set->irq_control);
1188
1189 temp = readl(&pdev->port3x_regs->mode_addr);
1190
1191 switch (speed) {
1192 case USB_SPEED_SUPER_PLUS:
1193 temp |= CFG_3XPORT_SSP_SUPPORT;
1194 break;
1195 case USB_SPEED_SUPER:
1196 temp &= ~CFG_3XPORT_SSP_SUPPORT;
1197 break;
1198 case USB_SPEED_HIGH:
1199 break;
1200 case USB_SPEED_FULL:
1201 fs_speed = PORT_REG6_FORCE_FS;
1202 break;
1203 default:
1204 dev_err(pdev->dev, "invalid maximum_speed parameter %d\n",
1205 speed);
1206 fallthrough;
1207 case USB_SPEED_UNKNOWN:
1208 /* Default to superspeed. */
1209 speed = USB_SPEED_SUPER;
1210 break;
1211 }
1212
1213 if (speed >= USB_SPEED_SUPER) {
1214 writel(temp, &pdev->port3x_regs->mode_addr);
1215 cdnsp_set_link_state(pdev, &pdev->usb3_port.regs->portsc,
1216 XDEV_RXDETECT);
1217 } else {
1218 cdnsp_disable_port(pdev, &pdev->usb3_port.regs->portsc);
1219 }
1220
1221 cdnsp_set_link_state(pdev, &pdev->usb2_port.regs->portsc,
1222 XDEV_RXDETECT);
1223
1224 cdnsp_gadget_ep0_desc.wMaxPacketSize = cpu_to_le16(512);
1225
1226 writel(PORT_REG6_L1_L0_HW_EN | fs_speed, &pdev->port20_regs->port_reg6);
1227
1228 ret = cdnsp_start(pdev);
1229 if (ret) {
1230 ret = -ENODEV;
1231 goto err;
1232 }
1233
1234 temp = readl(&pdev->op_regs->command);
1235 temp |= (CMD_INTE);
1236 writel(temp, &pdev->op_regs->command);
1237
1238 temp = readl(&pdev->ir_set->irq_pending);
1239 writel(IMAN_IE_SET(temp), &pdev->ir_set->irq_pending);
1240
1241 return 0;
1242 err:
1243 cdnsp_halt(pdev);
1244 return ret;
1245 }
1246

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip