All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: oe-kbuild@lists.linux.dev
Cc: lkp@intel.com, Julia Lawall <julia.lawall@inria.fr>
Subject: Re: [PATCH v8 5/7] ACPI: APEI: EINJ: Create debugfs files to enter device id and syndrome
Date: Tue, 10 Jun 2025 00:13:16 +0800	[thread overview]
Message-ID: <202506100008.WCNjNbsv-lkp@intel.com> (raw)

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
In-Reply-To: <20250604223804.842501-6-zaidal@os.amperecomputing.com>
References: <20250604223804.842501-6-zaidal@os.amperecomputing.com>
TO: Zaid Alali <zaidal@os.amperecomputing.com>

Hi Zaid,

kernel test robot noticed the following build warnings:

[auto build test WARNING on rafael-pm/linux-next]
[also build test WARNING on rafael-pm/bleeding-edge linus/master v6.16-rc1 next-20250606]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Zaid-Alali/ACPI-APEI-EINJ-Fix-kernel-test-sparse-warnings/20250605-064102
base:   https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git linux-next
patch link:    https://lore.kernel.org/r/20250604223804.842501-6-zaidal%40os.amperecomputing.com
patch subject: [PATCH v8 5/7] ACPI: APEI: EINJ: Create debugfs files to enter device id and syndrome
:::::: branch date: 5 days ago
:::::: commit date: 5 days ago
config: i386-randconfig-054-20250609 (https://download.01.org/0day-ci/archive/20250610/202506100008.WCNjNbsv-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0

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>
| Reported-by: Julia Lawall <julia.lawall@inria.fr>
| Closes: https://lore.kernel.org/r/202506100008.WCNjNbsv-lkp@intel.com/

cocci warnings: (new ones prefixed by >>)
>> drivers/acpi/apei/einj-core.c:884:5-6: WARNING: Unsigned expression compared with zero: c < 0

vim +884 drivers/acpi/apei/einj-core.c

fe9ef21f215600 Tony Luck 2025-06-04  867  
fe9ef21f215600 Tony Luck 2025-06-04  868  static ssize_t u128_write(struct file *f, const char __user *buf, size_t count, loff_t *off)
fe9ef21f215600 Tony Luck 2025-06-04  869  {
fe9ef21f215600 Tony Luck 2025-06-04  870  	char input[2 + 2 * COMPONENT_LEN + 2];
fe9ef21f215600 Tony Luck 2025-06-04  871  	u8 *save = f->f_inode->i_private;
fe9ef21f215600 Tony Luck 2025-06-04  872  	u8 tmp[COMPONENT_LEN];
fe9ef21f215600 Tony Luck 2025-06-04  873  	char byte[3] = {};
fe9ef21f215600 Tony Luck 2025-06-04  874  	char *s, *e;
fe9ef21f215600 Tony Luck 2025-06-04  875  	size_t c;
fe9ef21f215600 Tony Luck 2025-06-04  876  	long val;
fe9ef21f215600 Tony Luck 2025-06-04  877  	int i;
fe9ef21f215600 Tony Luck 2025-06-04  878  
fe9ef21f215600 Tony Luck 2025-06-04  879  	/* Require that user supply whole input line in one write(2) syscall */
fe9ef21f215600 Tony Luck 2025-06-04  880  	if (*off)
fe9ef21f215600 Tony Luck 2025-06-04  881  		return -EINVAL;
fe9ef21f215600 Tony Luck 2025-06-04  882  
fe9ef21f215600 Tony Luck 2025-06-04  883  	c = simple_write_to_buffer(input, sizeof(input), off, buf, count);
fe9ef21f215600 Tony Luck 2025-06-04 @884  	if (c < 0)
fe9ef21f215600 Tony Luck 2025-06-04  885  		return c;
fe9ef21f215600 Tony Luck 2025-06-04  886  
fe9ef21f215600 Tony Luck 2025-06-04  887  	if (c < 1 || input[c - 1] != '\n')
fe9ef21f215600 Tony Luck 2025-06-04  888  		return -EINVAL;
fe9ef21f215600 Tony Luck 2025-06-04  889  
fe9ef21f215600 Tony Luck 2025-06-04  890  	/* Empty line means invalidate this entry */
fe9ef21f215600 Tony Luck 2025-06-04  891  	if (c == 1) {
fe9ef21f215600 Tony Luck 2025-06-04  892  		memset(save, 0xff, COMPONENT_LEN);
fe9ef21f215600 Tony Luck 2025-06-04  893  		return c;
fe9ef21f215600 Tony Luck 2025-06-04  894  	}
fe9ef21f215600 Tony Luck 2025-06-04  895  
fe9ef21f215600 Tony Luck 2025-06-04  896  	if (input[0] == '0' && (input[1] == 'x' || input[1] == 'X'))
fe9ef21f215600 Tony Luck 2025-06-04  897  		s = input + 2;
fe9ef21f215600 Tony Luck 2025-06-04  898  	else
fe9ef21f215600 Tony Luck 2025-06-04  899  		s = input;
fe9ef21f215600 Tony Luck 2025-06-04  900  	e = input + c - 1;
fe9ef21f215600 Tony Luck 2025-06-04  901  
fe9ef21f215600 Tony Luck 2025-06-04  902  	for (i = 0; i < COMPONENT_LEN; i++) {
fe9ef21f215600 Tony Luck 2025-06-04  903  		byte[1] = *--e;
fe9ef21f215600 Tony Luck 2025-06-04  904  		byte[0] = e > s ? *--e : '0';
fe9ef21f215600 Tony Luck 2025-06-04  905  		if (kstrtol(byte, 16, &val))
fe9ef21f215600 Tony Luck 2025-06-04  906  			return -EINVAL;
fe9ef21f215600 Tony Luck 2025-06-04  907  		tmp[i] = val;
fe9ef21f215600 Tony Luck 2025-06-04  908  		if (e <= s)
fe9ef21f215600 Tony Luck 2025-06-04  909  			break;
fe9ef21f215600 Tony Luck 2025-06-04  910  	}
fe9ef21f215600 Tony Luck 2025-06-04  911  	while (++i < COMPONENT_LEN)
fe9ef21f215600 Tony Luck 2025-06-04  912  		tmp[i] = 0;
fe9ef21f215600 Tony Luck 2025-06-04  913  
fe9ef21f215600 Tony Luck 2025-06-04  914  	memcpy(save, tmp, COMPONENT_LEN);
fe9ef21f215600 Tony Luck 2025-06-04  915  
fe9ef21f215600 Tony Luck 2025-06-04  916  	return c;
fe9ef21f215600 Tony Luck 2025-06-04  917  }
fe9ef21f215600 Tony Luck 2025-06-04  918  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

             reply	other threads:[~2025-06-09 16:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-09 16:13 kernel test robot [this message]
  -- strict thread matches above, loose matches on Subject: below --
2025-06-04 22:37 [PATCH v8 0/7] Enable EINJv2 Support Zaid Alali
2025-06-04 22:38 ` [PATCH v8 5/7] ACPI: APEI: EINJ: Create debugfs files to enter device id and syndrome Zaid Alali
2025-06-06  3:14   ` kernel test robot

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=202506100008.WCNjNbsv-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=julia.lawall@inria.fr \
    --cc=oe-kbuild@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.