From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 49B3F20F070 for ; Wed, 19 Mar 2025 05:07:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.9 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742360834; cv=none; b=A+Ae4D1NEjX22DCnE/BH9O2WptPKKi88TfOILkA68L/5RmE6sUWoP+Vs6LwWUVvEJoyznuSXJakCRtEDTwFwFaVCaQzyJ0aald5t8lbDuNTdoUYYZeoB3xIBua1La6l1o+wsJnU0qbykcSyT9MtSfXVvH9oVoJ1rzU2Sos6FnTc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742360834; c=relaxed/simple; bh=cH7r98RzDbaaU8OlKhJ751vRkoeRdtSKlbBKQb9u7Rc=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition; b=NzwI+EYabuKHljfg5CVtHH5mSCzFjdeLnyON69Y6lKo8Uj6OV3hcBpZgnG2VXS3rVCEhW2mgXImtVFrGgvNWpPZDqEUXzdfjGxQU2GOTX0i9tTulvXbkrEENEEfSKVqJzMRwbabHhmhHZUbyP1sGu2YMWaAhUzj4RfN/89rzJdM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=VSG+dM/q; arc=none smtp.client-ip=192.198.163.9 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="VSG+dM/q" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1742360831; x=1773896831; h=date:from:to:cc:subject:message-id:mime-version; bh=cH7r98RzDbaaU8OlKhJ751vRkoeRdtSKlbBKQb9u7Rc=; b=VSG+dM/q98Av6xjKW2iqK7snZ/bWjZORM0VbmmyJMMwNZpsotTNc6URr c5yKdbIW6C5fumlloiRfZN6VSR+nOWII4WUBojan05OWYALsx9HJ7Qmiq SpWhmXM0cNj+UNM0ldxudZuwell2Hns/T1cEJ6HbcdoDp9QcQjGUCfSij cgQjgd/kaM/Fwm7v3+6/lCN3IfhcRoWXRZHsbaS0CTXyF31e981BrkaW2 j33+ARU8Ib7mPYrI+lmxLePKEUclV683valSpprW696K1l7/+s9Nta9gg Q9Dzfa0GfW3hlk2kHyyikbL9TvnzvxZBae3v4od54IKUIPVDFa8fz5/Eh w==; X-CSE-ConnectionGUID: jgEVv7KxSamSCzLktT7YiQ== X-CSE-MsgGUID: jMqcWREvTUCSoWrJyKdaQA== X-IronPort-AV: E=McAfee;i="6700,10204,11377"; a="54165551" X-IronPort-AV: E=Sophos;i="6.14,258,1736841600"; d="scan'208";a="54165551" Received: from orviesa001.jf.intel.com ([10.64.159.141]) by fmvoesa103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Mar 2025 22:07:11 -0700 X-CSE-ConnectionGUID: UMb3RN2zSRObhPJtdCMx4Q== X-CSE-MsgGUID: D9z7EaFATg6d62fMkB8t9w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.14,258,1736841600"; d="scan'208";a="159614975" Received: from lkp-server02.sh.intel.com (HELO a4747d147074) ([10.239.97.151]) by orviesa001.jf.intel.com with ESMTP; 18 Mar 2025 22:07:10 -0700 Received: from kbuild by a4747d147074 with local (Exim 4.96) (envelope-from ) id 1tuldz-000ENH-0A; Wed, 19 Mar 2025 05:07:07 +0000 Date: Wed, 19 Mar 2025 13:06:36 +0800 From: kernel test robot To: Krishna Kurapati Cc: oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org, Johan Hovold Subject: drivers/usb/dwc3/core.c:1499:47: warning: '%u' directive output may be truncated writing between 1 and 10 bytes into a region of size 4 Message-ID: <202503191317.9hvDBfeq-lkp@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi Krishna, FYI, the error/warning still remains. tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: 81e4f8d68c66da301bb881862735bd74c6241a19 commit: 3f12222a4bebeb13ce06ddecc1610ad32fa835dd usb: dwc3: core: Fix compile warning on s390 gcc in dwc3_get_phy call date: 11 months ago config: sparc64-randconfig-001-20250319 (https://download.01.org/0day-ci/archive/20250319/202503191317.9hvDBfeq-lkp@intel.com/config) compiler: sparc64-linux-gcc (GCC) 8.5.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250319/202503191317.9hvDBfeq-lkp@intel.com/reproduce) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot | Closes: https://lore.kernel.org/oe-kbuild-all/202503191317.9hvDBfeq-lkp@intel.com/ All warnings (new ones prefixed by >>): drivers/usb/dwc3/core.c: In function 'dwc3_core_init': >> drivers/usb/dwc3/core.c:1499:47: warning: '%u' directive output may be truncated writing between 1 and 10 bytes into a region of size 4 [-Wformat-truncation=] snprintf(phy_name, sizeof(phy_name), "usb3-%u", i); ^~ drivers/usb/dwc3/core.c:1499:41: note: directive argument in the range [0, 2147483647] snprintf(phy_name, sizeof(phy_name), "usb3-%u", i); ^~~~~~~~~ drivers/usb/dwc3/core.c:1499:4: note: 'snprintf' output between 7 and 16 bytes into a destination of size 9 snprintf(phy_name, sizeof(phy_name), "usb3-%u", i); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/usb/dwc3/core.c:1482:48: warning: '%u' directive output may be truncated writing between 1 and 10 bytes into a region of size 4 [-Wformat-truncation=] snprintf(phy_name, sizeof(phy_name), "usb2-%u", i); ^~ drivers/usb/dwc3/core.c:1482:42: note: directive argument in the range [0, 2147483647] snprintf(phy_name, sizeof(phy_name), "usb2-%u", i); ^~~~~~~~~ drivers/usb/dwc3/core.c:1482:4: note: 'snprintf' output between 7 and 16 bytes into a destination of size 9 snprintf(phy_name, sizeof(phy_name), "usb2-%u", i); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ vim +1499 drivers/usb/dwc3/core.c 1445 1446 static int dwc3_core_get_phy(struct dwc3 *dwc) 1447 { 1448 struct device *dev = dwc->dev; 1449 struct device_node *node = dev->of_node; 1450 char phy_name[9]; 1451 int ret; 1452 u8 i; 1453 1454 if (node) { 1455 dwc->usb2_phy = devm_usb_get_phy_by_phandle(dev, "usb-phy", 0); 1456 dwc->usb3_phy = devm_usb_get_phy_by_phandle(dev, "usb-phy", 1); 1457 } else { 1458 dwc->usb2_phy = devm_usb_get_phy(dev, USB_PHY_TYPE_USB2); 1459 dwc->usb3_phy = devm_usb_get_phy(dev, USB_PHY_TYPE_USB3); 1460 } 1461 1462 if (IS_ERR(dwc->usb2_phy)) { 1463 ret = PTR_ERR(dwc->usb2_phy); 1464 if (ret == -ENXIO || ret == -ENODEV) 1465 dwc->usb2_phy = NULL; 1466 else 1467 return dev_err_probe(dev, ret, "no usb2 phy configured\n"); 1468 } 1469 1470 if (IS_ERR(dwc->usb3_phy)) { 1471 ret = PTR_ERR(dwc->usb3_phy); 1472 if (ret == -ENXIO || ret == -ENODEV) 1473 dwc->usb3_phy = NULL; 1474 else 1475 return dev_err_probe(dev, ret, "no usb3 phy configured\n"); 1476 } 1477 1478 for (i = 0; i < dwc->num_usb2_ports; i++) { 1479 if (dwc->num_usb2_ports == 1) 1480 snprintf(phy_name, sizeof(phy_name), "usb2-phy"); 1481 else 1482 snprintf(phy_name, sizeof(phy_name), "usb2-%u", i); 1483 1484 dwc->usb2_generic_phy[i] = devm_phy_get(dev, phy_name); 1485 if (IS_ERR(dwc->usb2_generic_phy[i])) { 1486 ret = PTR_ERR(dwc->usb2_generic_phy[i]); 1487 if (ret == -ENOSYS || ret == -ENODEV) 1488 dwc->usb2_generic_phy[i] = NULL; 1489 else 1490 return dev_err_probe(dev, ret, "failed to lookup phy %s\n", 1491 phy_name); 1492 } 1493 } 1494 1495 for (i = 0; i < dwc->num_usb3_ports; i++) { 1496 if (dwc->num_usb3_ports == 1) 1497 snprintf(phy_name, sizeof(phy_name), "usb3-phy"); 1498 else > 1499 snprintf(phy_name, sizeof(phy_name), "usb3-%u", i); 1500 1501 dwc->usb3_generic_phy[i] = devm_phy_get(dev, phy_name); 1502 if (IS_ERR(dwc->usb3_generic_phy[i])) { 1503 ret = PTR_ERR(dwc->usb3_generic_phy[i]); 1504 if (ret == -ENOSYS || ret == -ENODEV) 1505 dwc->usb3_generic_phy[i] = NULL; 1506 else 1507 return dev_err_probe(dev, ret, "failed to lookup phy %s\n", 1508 phy_name); 1509 } 1510 } 1511 1512 return 0; 1513 } 1514 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki