From: kernel test robot <lkp@intel.com>
To: LiuJunyuan <2058432396@qq.com>, gregkh@linuxfoundation.org
Cc: oe-kbuild-all@lists.linux.dev, linux-staging@lists.linux.dev,
linux-kernel@vger.kernel.org, LiuJunyuan <2058432396@qq.com>
Subject: Re: [PATCH] staging: vme_user: use scnprintf in tsi148_alloc_resource
Date: Sat, 24 Oct 2026 10:25:27 +0800 [thread overview]
Message-ID: <202610241010.ezQcs5lj-lkp@intel.com> (raw)
In-Reply-To: <tencent_F5EEA06B3CD49F9EFF5C185259BF4134DA0A@qq.com>
Hi LiuJunyuan,
kernel test robot noticed the following build warnings:
[auto build test WARNING on staging/staging-testing]
url: https://github.com/intel-lab-lkp/linux/commits/LiuJunyuan/staging-vme_user-use-scnprintf-in-tsi148_alloc_resource/20261021-111349
base: staging/staging-testing
patch link: https://lore.kernel.org/r/tencent_F5EEA06B3CD49F9EFF5C185259BF4134DA0A%40qq.com
patch subject: [PATCH] staging: vme_user: use scnprintf in tsi148_alloc_resource
config: i386-randconfig-1006-20261021 (https://download.01.org/0day-ci/archive/20261024/202610241010.ezQcs5lj-lkp@intel.com/config)
compiler: gcc-14 (Debian 14.2.0-19) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261024/202610241010.ezQcs5lj-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 <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202610241010.ezQcs5lj-lkp@intel.com/
All warnings (new ones prefixed by >>):
drivers/staging/vme_user/vme_tsi148.c: In function 'tsi148_alloc_resource':
>> drivers/staging/vme_user/vme_tsi148.c:748:38: warning: passing argument 1 of 'scnprintf' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
748 | scnprintf(image->bus_resource.name, VMENAMSIZ + 3, "%s.%d",
| ~~~~~~~~~~~~~~~~~~~^~~~~
In file included from include/linux/kernel.h:32,
from include/linux/random.h:7,
from include/linux/nodemask.h:94,
from include/linux/numa.h:6,
from include/linux/cpumask.h:15,
from arch/x86/include/asm/paravirt.h:19,
from arch/x86/include/asm/irqflags.h:100,
from include/linux/irqflags.h:18,
from arch/x86/include/asm/special_insns.h:10,
from arch/x86/include/asm/processor.h:25,
from arch/x86/include/asm/timex.h:5,
from include/linux/timex.h:67,
from include/linux/time32.h:13,
from include/linux/time.h:60,
from include/linux/stat.h:19,
from include/linux/module.h:13,
from drivers/staging/vme_user/vme_tsi148.c:12:
include/linux/sprintf.h:15:36: note: expected 'char *' but argument is of type 'const char *'
15 | __printf(3, 4) int scnprintf(char *buf, size_t size, const char *fmt, ...);
| ~~~~~~^~~
vim +748 drivers/staging/vme_user/vme_tsi148.c
705
706 /*
707 * Allocate and map PCI Resource
708 */
709 static int tsi148_alloc_resource(struct vme_master_resource *image,
710 unsigned long long size)
711 {
712 unsigned long long existing_size;
713 int retval = 0;
714 struct pci_dev *pdev;
715 struct vme_bridge *tsi148_bridge;
716
717 tsi148_bridge = image->parent;
718
719 pdev = to_pci_dev(tsi148_bridge->parent);
720
721 existing_size = (unsigned long long)(image->bus_resource.end -
722 image->bus_resource.start);
723
724 /* If the existing size is OK, return */
725 if ((size != 0) && (existing_size == (size - 1)))
726 return 0;
727
728 if (existing_size != 0) {
729 iounmap(image->kern_base);
730 image->kern_base = NULL;
731 kfree(image->bus_resource.name);
732 release_resource(&image->bus_resource);
733 memset(&image->bus_resource, 0, sizeof(image->bus_resource));
734 }
735
736 /* Exit here if size is zero */
737 if (size == 0)
738 return 0;
739
740 if (!image->bus_resource.name) {
741 image->bus_resource.name = kmalloc(VMENAMSIZ + 3, GFP_ATOMIC);
742 if (!image->bus_resource.name) {
743 retval = -ENOMEM;
744 goto err_name;
745 }
746 }
747
> 748 scnprintf(image->bus_resource.name, VMENAMSIZ + 3, "%s.%d",
749 tsi148_bridge->name, image->number);
750
751 image->bus_resource.start = 0;
752 image->bus_resource.end = (unsigned long)size;
753 image->bus_resource.flags = IORESOURCE_MEM;
754
755 retval = pci_bus_alloc_resource(pdev->bus, &image->bus_resource,
756 size, 0x10000, PCIBIOS_MIN_MEM,
757 0, NULL, NULL);
758 if (retval) {
759 dev_err(tsi148_bridge->parent, "Failed to allocate mem resource for window %d size 0x%lx start 0x%lx\n",
760 image->number, (unsigned long)size,
761 (unsigned long)image->bus_resource.start);
762 goto err_resource;
763 }
764
765 image->kern_base = ioremap(image->bus_resource.start, size);
766 if (!image->kern_base) {
767 dev_err(tsi148_bridge->parent, "Failed to remap resource\n");
768 retval = -ENOMEM;
769 goto err_remap;
770 }
771
772 return 0;
773
774 err_remap:
775 release_resource(&image->bus_resource);
776 err_resource:
777 kfree(image->bus_resource.name);
778 memset(&image->bus_resource, 0, sizeof(image->bus_resource));
779 err_name:
780 return retval;
781 }
782
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
prev parent reply other threads:[~2026-10-24 2:25 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-21 3:13 [PATCH] staging: vme_user: use scnprintf in tsi148_alloc_resource LiuJunyuan
2026-10-21 6:01 ` Dan Carpenter
2026-10-21 6:15 ` Greg KH
2026-10-21 9:01 ` David Laight
2026-10-23 13:36 ` Greg KH
2026-10-24 2:25 ` kernel test robot [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202610241010.ezQcs5lj-lkp@intel.com \
--to=lkp@intel.com \
--cc=2058432396@qq.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=oe-kbuild-all@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.