Received: by 2002:a05:7412:3290:b0:fa:6e18:a558 with SMTP id ev16csp299333rdb; Thu, 25 Jan 2024 16:16:38 -0800 (PST) X-Google-Smtp-Source: AGHT+IGmVzzJl/YYjDo02/kKC5BSaNHN+3BFvhgn7TBFKqiBx3HIv7zojwtFGwLFwXLqaw1Uf4Hy X-Received: by 2002:a17:903:32cd:b0:1d7:2f9a:9fcf with SMTP id i13-20020a17090332cd00b001d72f9a9fcfmr469188plr.2.1706228198423; Thu, 25 Jan 2024 16:16:38 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706228198; cv=pass; d=google.com; s=arc-20160816; b=I9qDKPlfcHMb1rVDMPIh/IMnAAW26vSLEYhT5ansDjB+SAYJpRY1bo8fKSc3mu6LmJ 5PeZVYjp2MLutK6S4okCJsnpLBmu8dNW2VTmN5HDr+GBbvijOn5/1qQk6QEZw1M+iZfd U5M+Nv58GhMKONVUUBVZ+zZ9YIfnqoKZBp4+mgV70JlH4TaOD1VSMFzYjFwmprVmc2S4 zP5IuetiCAGt3knTW/w5IxdI1iqCPZXp6AggwCW94X4Ow561Pk/4lxKfa9dqZyTkUfhG QM5nWufm0vVikv6oxZJ6Lb7FEuv49WpUAQEncoCLz7Bj+2ihutFGoaOmTqBpl1RC5Rr7 92aQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-disposition:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:message-id:subject:cc:to:from:date :dkim-signature; bh=XRk0fjXfI05RJ5LoAKlnoydClgKyqxzLLd4onTk5vKw=; fh=e5RonhpQJZRwBfDAlaH8BCeDABH7AHImG+do0mmglvM=; b=ITd3bZ7JLqGa72FqS8toEou5FcKH/rld5WKe3ThV9878JmHw4kq2lottibpP9dpMvt TL3qTq8VUNOKRa2MwAyVkM8lUKSf6zixNtcVcI4Cu9sF/LdO8Tx5be3pa1zWh7vI3KGe v9n/2lfeRCLrtMkAxvAgJeMzQcdx6NlYzmQtkVNOz7wRaifmX89WLvM3/BL0yaVMk5LD I4kYSI7CazeDcSVyboeZK/atxZ8QcPbpoZBMYI9OeEWRr01R93xKfaWguTt/AdUxXpED 9L4aXF32XwJl2u38wY0InHzxjzJ9+6fK4oJMgk+OIK5zUno1FFLszO/QM3TlkTPmDxQP AiTA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=jd9N1OAH; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-39454-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-39454-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id l18-20020a170903121200b001d765f39633si110520plh.329.2024.01.25.16.16.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jan 2024 16:16:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-39454-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=jd9N1OAH; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-39454-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-39454-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 134D828437E for ; Fri, 26 Jan 2024 00:16:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7DE0A7F0; Fri, 26 Jan 2024 00:16:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="jd9N1OAH" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.11]) (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 7EDB619D for ; Fri, 26 Jan 2024 00:16:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.11 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706228189; cv=none; b=mBOdNc/Zj4AKfVkOHXLw0qJWv69VjPcLZKeqOr1RA8eVZW2hwQmzjxHQtcuNXFyJCH5heQvjo5D2wEX/x++YOL1NiWRBQ/BCxHUKpV70dEsEqKSAocDunNqo4QOkJ1r9AiqSckakULoqD88R3/fwuZPLZQY3ip0GG75qMiChE3o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706228189; c=relaxed/simple; bh=QenIm/O/0t1RHkGK8L/kzIvF3qZtbD1RKxpivllizPs=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition; b=qxOwtJ+5xwEMQ1yFfkqjMhLjstMiSBzfMw6RbkEutdKpBYWXhXx8OeSMuyypj7m896AW92DnlMgozavpIs3ozOzzWCO8aEht48U+TxNGzMJpuqlHKwZmzujSp1D6Zk1tl99yCBTE2TTH1p9BKI+CkvAbRBVg7yb3zcV/S8og/y4= 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=jd9N1OAH; arc=none smtp.client-ip=198.175.65.11 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1706228187; x=1737764187; h=date:from:to:cc:subject:message-id:mime-version; bh=QenIm/O/0t1RHkGK8L/kzIvF3qZtbD1RKxpivllizPs=; b=jd9N1OAHgTQiTVkMsKv3j4lKXzY0rAjzxHNPgiCyaCkbpWtYQsXWvPxT A5uKHeJTdTfLxuN3yzEFhC4/tiEOe6XQkWfL5sCPIFKHTEZduM0KNjPPo 4CdPrnIu1OrRMGmj+myrpkSpAEThncfpr9H9XtktrJuKV+eIB+PEM0KJh HXCpQ7bbP+MBstv/wHwn7jom/vQJJkfAtou8NXbM8E8NOZNSdaUSW3o0L 9Gx2+SZjcUG+ARqWRmE0hjUBCZA16k4C8ODl5/zIEeWPy5WB9GliPADo0 gnDcSJDslgwjFWiWQCfmDgSBkwVbPSCCdrFqc0F8QeTJ0j2sz7aT6oTMp g==; X-IronPort-AV: E=McAfee;i="6600,9927,10964"; a="8994332" X-IronPort-AV: E=Sophos;i="6.05,216,1701158400"; d="scan'208";a="8994332" Received: from orviesa003.jf.intel.com ([10.64.159.143]) by orvoesa103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Jan 2024 16:16:26 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.05,216,1701158400"; d="scan'208";a="2448537" Received: from lkp-server01.sh.intel.com (HELO 370188f8dc87) ([10.239.97.150]) by orviesa003.jf.intel.com with ESMTP; 25 Jan 2024 16:16:25 -0800 Received: from kbuild by 370188f8dc87 with local (Exim 4.96) (envelope-from ) id 1rT9tO-0000W4-2q; Fri, 26 Jan 2024 00:16:22 +0000 Date: Fri, 26 Jan 2024 08:16:07 +0800 From: kernel test robot To: Nagarjuna Kristam Cc: oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org, Thierry Reding Subject: drivers/usb/gadget/udc/tegra-xudc.c:3417:60: warning: '%d' directive output may be truncated writing between 1 and 10 bytes into a region of size 2 Message-ID: <202401260821.tiWXcPF2-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 tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: ecb1b8288dc7ccbdcb3b9df005fa1c0e0c0388a7 commit: b4e19931c98a088fbd80b5c3f892261c9a0e6c23 usb: gadget: tegra-xudc: Support multiple device modes date: 3 years, 10 months ago config: arm64-randconfig-002-20240106 (https://download.01.org/0day-ci/archive/20240126/202401260821.tiWXcPF2-lkp@intel.com/config) compiler: aarch64-linux-gcc (GCC) 13.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240126/202401260821.tiWXcPF2-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/202401260821.tiWXcPF2-lkp@intel.com/ All warnings (new ones prefixed by >>): drivers/usb/gadget/udc/tegra-xudc.c: In function 'tegra_xudc_phy_get': >> drivers/usb/gadget/udc/tegra-xudc.c:3417:60: warning: '%d' directive output may be truncated writing between 1 and 10 bytes into a region of size 2 [-Wformat-truncation=] 3417 | snprintf(phy_name, sizeof(phy_name), "usb3-%d", usb3); | ^~ drivers/usb/gadget/udc/tegra-xudc.c:3417:54: note: directive argument in the range [0, 2147483647] 3417 | snprintf(phy_name, sizeof(phy_name), "usb3-%d", usb3); | ^~~~~~~~~ drivers/usb/gadget/udc/tegra-xudc.c:3417:17: note: 'snprintf' output between 7 and 16 bytes into a destination of size 7 3417 | snprintf(phy_name, sizeof(phy_name), "usb3-%d", usb3); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ vim +3417 drivers/usb/gadget/udc/tegra-xudc.c 3360 3361 static int tegra_xudc_phy_get(struct tegra_xudc *xudc) 3362 { 3363 int err = 0, usb3; 3364 unsigned int i; 3365 3366 xudc->utmi_phy = devm_kcalloc(xudc->dev, xudc->soc->num_phys, 3367 sizeof(*xudc->utmi_phy), GFP_KERNEL); 3368 if (!xudc->utmi_phy) 3369 return -ENOMEM; 3370 3371 xudc->usb3_phy = devm_kcalloc(xudc->dev, xudc->soc->num_phys, 3372 sizeof(*xudc->usb3_phy), GFP_KERNEL); 3373 if (!xudc->usb3_phy) 3374 return -ENOMEM; 3375 3376 xudc->usbphy = devm_kcalloc(xudc->dev, xudc->soc->num_phys, 3377 sizeof(*xudc->usbphy), GFP_KERNEL); 3378 if (!xudc->usbphy) 3379 return -ENOMEM; 3380 3381 xudc->vbus_nb.notifier_call = tegra_xudc_vbus_notify; 3382 3383 for (i = 0; i < xudc->soc->num_phys; i++) { 3384 char phy_name[] = "usb.-."; 3385 3386 /* Get USB2 phy */ 3387 snprintf(phy_name, sizeof(phy_name), "usb2-%d", i); 3388 xudc->utmi_phy[i] = devm_phy_optional_get(xudc->dev, phy_name); 3389 if (IS_ERR(xudc->utmi_phy[i])) { 3390 err = PTR_ERR(xudc->utmi_phy[i]); 3391 if (err != -EPROBE_DEFER) 3392 dev_err(xudc->dev, "failed to get usb2-%d phy: %d\n", 3393 i, err); 3394 3395 goto clean_up; 3396 } else if (xudc->utmi_phy[i]) { 3397 /* Get usb-phy, if utmi phy is available */ 3398 xudc->usbphy[i] = devm_usb_get_phy_by_node(xudc->dev, 3399 xudc->utmi_phy[i]->dev.of_node, 3400 &xudc->vbus_nb); 3401 if (IS_ERR(xudc->usbphy[i])) { 3402 err = PTR_ERR(xudc->usbphy[i]); 3403 dev_err(xudc->dev, "failed to get usbphy-%d: %d\n", 3404 i, err); 3405 goto clean_up; 3406 } 3407 } else if (!xudc->utmi_phy[i]) { 3408 /* if utmi phy is not available, ignore USB3 phy get */ 3409 continue; 3410 } 3411 3412 /* Get USB3 phy */ 3413 usb3 = tegra_xusb_padctl_get_usb3_companion(xudc->padctl, i); 3414 if (usb3 < 0) 3415 continue; 3416 > 3417 snprintf(phy_name, sizeof(phy_name), "usb3-%d", usb3); 3418 xudc->usb3_phy[i] = devm_phy_optional_get(xudc->dev, phy_name); 3419 if (IS_ERR(xudc->usb3_phy[i])) { 3420 err = PTR_ERR(xudc->usb3_phy[i]); 3421 if (err != -EPROBE_DEFER) 3422 dev_err(xudc->dev, "failed to get usb3-%d phy: %d\n", 3423 usb3, err); 3424 3425 goto clean_up; 3426 } else if (xudc->usb3_phy[i]) 3427 dev_dbg(xudc->dev, "usb3_phy-%d registered", usb3); 3428 } 3429 3430 return err; 3431 3432 clean_up: 3433 for (i = 0; i < xudc->soc->num_phys; i++) { 3434 xudc->usb3_phy[i] = NULL; 3435 xudc->utmi_phy[i] = NULL; 3436 xudc->usbphy[i] = NULL; 3437 } 3438 3439 return err; 3440 } 3441 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki