All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Sasha Finkelstein via B4 Relay
	<devnull+fnkl.kernel.gmail.com@kernel.org>
Cc: oe-kbuild-all@lists.linux.dev
Subject: Re: [PATCH v2 2/4] input: apple_z2: Add a driver for Apple Z2 touchscreens
Date: Sat, 7 Dec 2024 05:02:13 +0800	[thread overview]
Message-ID: <202412070418.34Bo5VZa-lkp@intel.com> (raw)
In-Reply-To: <20241128-z2-v2-2-76cc59bbf117@gmail.com>

Hi Sasha,

kernel test robot noticed the following build warnings:

[auto build test WARNING on 9f16d5e6f220661f73b36a4be1b21575651d8833]

url:    https://github.com/intel-lab-lkp/linux/commits/Sasha-Finkelstein-via-B4-Relay/dt-bindings-input-touchscreen-Add-Z2-controller/20241129-063212
base:   9f16d5e6f220661f73b36a4be1b21575651d8833
patch link:    https://lore.kernel.org/r/20241128-z2-v2-2-76cc59bbf117%40gmail.com
patch subject: [PATCH v2 2/4] input: apple_z2: Add a driver for Apple Z2 touchscreens
config: um-randconfig-r123-20241206 (https://download.01.org/0day-ci/archive/20241207/202412070418.34Bo5VZa-lkp@intel.com/config)
compiler: clang version 15.0.7 (https://github.com/llvm/llvm-project 8dfdcc7b7bf66834a761bd8de445840ef68e4d1a)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241207/202412070418.34Bo5VZa-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/202412070418.34Bo5VZa-lkp@intel.com/

sparse warnings: (new ones prefixed by >>)
>> drivers/input/touchscreen/apple_z2.c:296:35: sparse: sparse: cast to restricted __le32
   drivers/input/touchscreen/apple_z2.c: note: in included file (through arch/um/include/linux/time-internal.h, arch/x86/um/asm/processor.h, include/linux/sched.h, ...):
   include/linux/list.h:83:21: sparse: sparse: self-comparison always evaluates to true
   include/linux/list.h:83:21: sparse: sparse: self-comparison always evaluates to true
   include/linux/list.h:83:21: sparse: sparse: self-comparison always evaluates to true
   include/linux/list.h:83:21: sparse: sparse: self-comparison always evaluates to true

vim +296 drivers/input/touchscreen/apple_z2.c

   243	
   244	static int apple_z2_upload_firmware(struct apple_z2 *z2)
   245	{
   246		const struct firmware *fw __free(firmware) = NULL;
   247		struct apple_z2_fw_hdr *fw_hdr;
   248		size_t fw_idx = sizeof(struct apple_z2_fw_hdr);
   249		int error;
   250		u32 load_cmd;
   251		u32 size;
   252		u32 address;
   253		char *data;
   254		u8 bits_per_word;
   255		size_t cal_size;
   256	
   257		error = request_firmware(&fw, z2->fw_name, &z2->spidev->dev);
   258		if (error) {
   259			dev_err(&z2->spidev->dev, "unable to load firmware");
   260			return error;
   261		}
   262	
   263		fw_hdr = (struct apple_z2_fw_hdr *)fw->data;
   264		if (le32_to_cpu(fw_hdr->magic) != APPLE_Z2_FW_MAGIC || le32_to_cpu(fw_hdr->version) != 1) {
   265			dev_err(&z2->spidev->dev, "invalid firmware header");
   266			return -EINVAL;
   267		}
   268	
   269		/*
   270		 * This will interrupt the upload half-way if the file is malformed
   271		 * As the device has no non-volatile storage to corrupt, and gets reset
   272		 * on boot anyway, this is fine.
   273		 */
   274		while (fw_idx < fw->size) {
   275			if (fw->size - fw_idx < 8) {
   276				dev_err(&z2->spidev->dev, "firmware malformed");
   277				return -EINVAL;
   278			}
   279	
   280			load_cmd = le32_to_cpu(*(__le32 *)(fw->data + fw_idx));
   281			fw_idx += 4;
   282			if (load_cmd == LOAD_COMMAND_INIT_PAYLOAD || load_cmd == LOAD_COMMAND_SEND_BLOB) {
   283				size = le32_to_cpu(*(__le32 *)(fw->data + fw_idx));
   284				fw_idx += 4;
   285				if (fw->size - fw_idx < size) {
   286					dev_err(&z2->spidev->dev, "firmware malformed");
   287					return -EINVAL;
   288				}
   289				bits_per_word = load_cmd == LOAD_COMMAND_SEND_BLOB ? 16 : 8;
   290				error = apple_z2_send_firmware_blob(z2, fw->data + fw_idx,
   291								    size, bits_per_word);
   292				if (error)
   293					return error;
   294				fw_idx += size;
   295			} else if (load_cmd == 2) {
 > 296				address = le32_to_cpu(*(u32 *)(fw->data + fw_idx));
   297				fw_idx += 4;
   298				cal_size = device_property_count_u8(&z2->spidev->dev, CAL_PROP_NAME);
   299				if (cal_size != 0) {
   300					size = cal_size + sizeof(struct apple_z2_hbpp_blob_hdr) + 4;
   301					data = kzalloc(size, GFP_KERNEL);
   302					error = apple_z2_build_cal_blob(z2, address, cal_size, data);
   303					if (!error)
   304						error = apple_z2_send_firmware_blob(z2, data, size, 16);
   305					kfree(data);
   306					if (error)
   307						return error;
   308				}
   309			} else {
   310				dev_err(&z2->spidev->dev, "firmware malformed");
   311				return -EINVAL;
   312			}
   313			if (fw_idx % 4 != 0)
   314				fw_idx += 4 - (fw_idx % 4);
   315		}
   316	
   317	
   318		z2->booted = 1;
   319		apple_z2_read_packet(z2);
   320		return 0;
   321	}
   322	

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

  parent reply	other threads:[~2024-12-06 21:02 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-28 22:29 [PATCH v2 0/4] Driver for Apple Z2 touchscreens Sasha Finkelstein via B4 Relay
2024-11-28 22:29 ` Sasha Finkelstein
2024-11-28 22:29 ` [PATCH v2 1/4] dt-bindings: input: touchscreen: Add Z2 controller Sasha Finkelstein via B4 Relay
2024-11-28 22:29   ` Sasha Finkelstein
2024-11-29  7:16   ` Krzysztof Kozlowski
2024-11-29  7:53     ` Sasha Finkelstein
2024-11-29  8:25       ` Krzysztof Kozlowski
2024-11-28 22:29 ` [PATCH v2 2/4] input: apple_z2: Add a driver for Apple Z2 touchscreens Sasha Finkelstein via B4 Relay
2024-11-28 22:29   ` Sasha Finkelstein
2024-12-02 15:46   ` Jeff Johnson
2024-12-03 23:07   ` Dmitry Torokhov
2024-12-04  9:28     ` Sasha Finkelstein
2024-12-06 21:02   ` kernel test robot [this message]
2024-11-28 22:29 ` [PATCH v2 3/4] arm64: dts: apple: Add touchbar digitizer nodes Sasha Finkelstein via B4 Relay
2024-11-28 22:29   ` Sasha Finkelstein
2024-11-29  1:49   ` Nick Chan
2024-12-03  8:04   ` Janne Grunau
2024-11-28 22:29 ` [PATCH v2 4/4] MAINTAINERS: Add entries for Apple Z2 touchscreen driver Sasha Finkelstein via B4 Relay
2024-11-28 22:29   ` Sasha Finkelstein
2024-12-02 17:30 ` [PATCH v2 0/4] Driver for Apple Z2 touchscreens Neal Gompa

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=202412070418.34Bo5VZa-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=devnull+fnkl.kernel.gmail.com@kernel.org \
    --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.