Linux kernel -stable discussions
 help / color / mirror / Atom feed
* [PATCH] nvmem: layouts: onie-tlv: fix read_post_process assignment
@ 2026-05-12  2:57 chalianis1
  2026-05-12  3:04 ` anis chali
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: chalianis1 @ 2026-05-12  2:57 UTC (permalink / raw)
  To: miquel.raynal, srini, gregkh; +Cc: linux-kernel, stable, Chali Anis

From: Chali Anis <chalianis1@gmail.com>

Assign the onie_tlv_read_cb callback directly to
read_post_process instead of calling it during assignment.

The field expects a function pointer, not a function call.

Fixes: d3c0d12f6474 ("nvmem: layouts: onie-tlv: Add new layout driver")
Signed-off-by: Chali Anis <chalianis1@gmail.com>
---
 drivers/nvmem/layouts/onie-tlv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/nvmem/layouts/onie-tlv.c b/drivers/nvmem/layouts/onie-tlv.c
index 0967a32319a2..0242f64fe713 100644
--- a/drivers/nvmem/layouts/onie-tlv.c
+++ b/drivers/nvmem/layouts/onie-tlv.c
@@ -124,7 +124,7 @@ static int onie_tlv_add_cells(struct device *dev, struct nvmem_device *nvmem,
 		cell.offset = hdr_len + offset + sizeof(tlv.type) + sizeof(tlv.len);
 		cell.bytes = tlv.len;
 		cell.np = of_get_child_by_name(layout, cell.name);
-		cell.read_post_process = onie_tlv_read_cb(tlv.type, data + offset + sizeof(tlv));
+		cell.read_post_process = onie_tlv_read_cb;
 
 		ret = nvmem_add_one_cell(nvmem, &cell);
 		if (ret) {

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] nvmem: layouts: onie-tlv: fix read_post_process assignment
  2026-05-12  2:57 [PATCH] nvmem: layouts: onie-tlv: fix read_post_process assignment chalianis1
@ 2026-05-12  3:04 ` anis chali
  2026-05-12 18:15 ` kernel test robot
  2026-05-12 18:48 ` kernel test robot
  2 siblings, 0 replies; 4+ messages in thread
From: anis chali @ 2026-05-12  3:04 UTC (permalink / raw)
  To: miquel.raynal, srini, gregkh; +Cc: linux-kernel, stable

Please disregard this patch.

Le lun. 11 mai 2026 à 22:57, <chalianis1@gmail.com> a écrit :
>
> From: Chali Anis <chalianis1@gmail.com>
>
> Assign the onie_tlv_read_cb callback directly to
> read_post_process instead of calling it during assignment.
>
> The field expects a function pointer, not a function call.
>
> Fixes: d3c0d12f6474 ("nvmem: layouts: onie-tlv: Add new layout driver")
> Signed-off-by: Chali Anis <chalianis1@gmail.com>
> ---
>  drivers/nvmem/layouts/onie-tlv.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/nvmem/layouts/onie-tlv.c b/drivers/nvmem/layouts/onie-tlv.c
> index 0967a32319a2..0242f64fe713 100644
> --- a/drivers/nvmem/layouts/onie-tlv.c
> +++ b/drivers/nvmem/layouts/onie-tlv.c
> @@ -124,7 +124,7 @@ static int onie_tlv_add_cells(struct device *dev, struct nvmem_device *nvmem,
>                 cell.offset = hdr_len + offset + sizeof(tlv.type) + sizeof(tlv.len);
>                 cell.bytes = tlv.len;
>                 cell.np = of_get_child_by_name(layout, cell.name);
> -               cell.read_post_process = onie_tlv_read_cb(tlv.type, data + offset + sizeof(tlv));
> +               cell.read_post_process = onie_tlv_read_cb;
>
>                 ret = nvmem_add_one_cell(nvmem, &cell);
>                 if (ret) {

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] nvmem: layouts: onie-tlv: fix read_post_process assignment
  2026-05-12  2:57 [PATCH] nvmem: layouts: onie-tlv: fix read_post_process assignment chalianis1
  2026-05-12  3:04 ` anis chali
@ 2026-05-12 18:15 ` kernel test robot
  2026-05-12 18:48 ` kernel test robot
  2 siblings, 0 replies; 4+ messages in thread
From: kernel test robot @ 2026-05-12 18:15 UTC (permalink / raw)
  To: chalianis1, miquel.raynal, srini, gregkh
  Cc: oe-kbuild-all, linux-kernel, stable, Chali Anis

Hi,

kernel test robot noticed the following build errors:

[auto build test ERROR on char-misc/char-misc-testing]
[also build test ERROR on char-misc/char-misc-next char-misc/char-misc-linus linus/master v7.1-rc3 next-20260508]
[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/chalianis1-gmail-com/nvmem-layouts-onie-tlv-fix-read_post_process-assignment/20260512-213659
base:   char-misc/char-misc-testing
patch link:    https://lore.kernel.org/r/20260512025715.50645-1-chalianis1%40gmail.com
patch subject: [PATCH] nvmem: layouts: onie-tlv: fix read_post_process assignment
config: nios2-allmodconfig (https://download.01.org/0day-ci/archive/20260513/202605130229.IIa8Bfjl-lkp@intel.com/config)
compiler: nios2-linux-gcc (GCC) 11.5.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260513/202605130229.IIa8Bfjl-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/202605130229.IIa8Bfjl-lkp@intel.com/

All errors (new ones prefixed by >>):

   drivers/nvmem/layouts/onie-tlv.c: In function 'onie_tlv_add_cells':
>> drivers/nvmem/layouts/onie-tlv.c:127:40: error: assignment to 'nvmem_cell_post_process_t' {aka 'int (*)(void *, const char *, int,  unsigned int,  void *, unsigned int)'} from incompatible pointer type 'int (* (*)(u8,  u8 *))(void *, const char *, int,  unsigned int,  void *, size_t)' {aka 'int (* (*)(unsigned char,  unsigned char *))(void *, const char *, int,  unsigned int,  void *, unsigned int)'} [-Werror=incompatible-pointer-types]
     127 |                 cell.read_post_process = onie_tlv_read_cb;
         |                                        ^
   cc1: some warnings being treated as errors


vim +127 drivers/nvmem/layouts/onie-tlv.c

    97	
    98	static int onie_tlv_add_cells(struct device *dev, struct nvmem_device *nvmem,
    99				      size_t data_len, u8 *data)
   100	{
   101		struct nvmem_cell_info cell = {};
   102		struct device_node *layout;
   103		struct onie_tlv tlv;
   104		unsigned int hdr_len = sizeof(struct onie_tlv_hdr);
   105		unsigned int offset = 0;
   106		int ret;
   107	
   108		layout = of_nvmem_layout_get_container(nvmem);
   109		if (!layout)
   110			return -ENOENT;
   111	
   112		while (offset < data_len) {
   113			memcpy(&tlv, data + offset, sizeof(tlv));
   114			if (offset + tlv.len >= data_len) {
   115				dev_err(dev, "Out of bounds field (0x%x bytes at 0x%x)\n",
   116					tlv.len, hdr_len + offset);
   117				break;
   118			}
   119	
   120			cell.name = onie_tlv_cell_name(tlv.type);
   121			if (!cell.name)
   122				continue;
   123	
   124			cell.offset = hdr_len + offset + sizeof(tlv.type) + sizeof(tlv.len);
   125			cell.bytes = tlv.len;
   126			cell.np = of_get_child_by_name(layout, cell.name);
 > 127			cell.read_post_process = onie_tlv_read_cb;
   128	
   129			ret = nvmem_add_one_cell(nvmem, &cell);
   130			if (ret) {
   131				of_node_put(layout);
   132				return ret;
   133			}
   134	
   135			offset += sizeof(tlv) + tlv.len;
   136		}
   137	
   138		of_node_put(layout);
   139	
   140		return 0;
   141	}
   142	

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] nvmem: layouts: onie-tlv: fix read_post_process assignment
  2026-05-12  2:57 [PATCH] nvmem: layouts: onie-tlv: fix read_post_process assignment chalianis1
  2026-05-12  3:04 ` anis chali
  2026-05-12 18:15 ` kernel test robot
@ 2026-05-12 18:48 ` kernel test robot
  2 siblings, 0 replies; 4+ messages in thread
From: kernel test robot @ 2026-05-12 18:48 UTC (permalink / raw)
  To: chalianis1, miquel.raynal, srini, gregkh
  Cc: oe-kbuild-all, linux-kernel, stable, Chali Anis

Hi,

kernel test robot noticed the following build errors:

[auto build test ERROR on char-misc/char-misc-testing]
[also build test ERROR on char-misc/char-misc-next char-misc/char-misc-linus linus/master v7.1-rc3 next-20260508]
[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/chalianis1-gmail-com/nvmem-layouts-onie-tlv-fix-read_post_process-assignment/20260512-213659
base:   char-misc/char-misc-testing
patch link:    https://lore.kernel.org/r/20260512025715.50645-1-chalianis1%40gmail.com
patch subject: [PATCH] nvmem: layouts: onie-tlv: fix read_post_process assignment
config: s390-randconfig-r073-20260513 (https://download.01.org/0day-ci/archive/20260513/202605130223.sNRxfA5D-lkp@intel.com/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
smatch: v0.5.0-9065-ge9cc34fd
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260513/202605130223.sNRxfA5D-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/202605130223.sNRxfA5D-lkp@intel.com/

All errors (new ones prefixed by >>):

>> drivers/nvmem/layouts/onie-tlv.c:127:26: error: incompatible function pointer types assigning to 'nvmem_cell_post_process_t' (aka 'int (*)(void *, const char *, int, unsigned int, void *, unsigned long)') from 'nvmem_cell_post_process_t (u8, u8 *)' (aka 'int (*(unsigned char, unsigned char *))(void *, const char *, int, unsigned int, void *, unsigned long)') [-Wincompatible-function-pointer-types]
     127 |                 cell.read_post_process = onie_tlv_read_cb;
         |                                        ^ ~~~~~~~~~~~~~~~~
   1 error generated.


vim +127 drivers/nvmem/layouts/onie-tlv.c

    97	
    98	static int onie_tlv_add_cells(struct device *dev, struct nvmem_device *nvmem,
    99				      size_t data_len, u8 *data)
   100	{
   101		struct nvmem_cell_info cell = {};
   102		struct device_node *layout;
   103		struct onie_tlv tlv;
   104		unsigned int hdr_len = sizeof(struct onie_tlv_hdr);
   105		unsigned int offset = 0;
   106		int ret;
   107	
   108		layout = of_nvmem_layout_get_container(nvmem);
   109		if (!layout)
   110			return -ENOENT;
   111	
   112		while (offset < data_len) {
   113			memcpy(&tlv, data + offset, sizeof(tlv));
   114			if (offset + tlv.len >= data_len) {
   115				dev_err(dev, "Out of bounds field (0x%x bytes at 0x%x)\n",
   116					tlv.len, hdr_len + offset);
   117				break;
   118			}
   119	
   120			cell.name = onie_tlv_cell_name(tlv.type);
   121			if (!cell.name)
   122				continue;
   123	
   124			cell.offset = hdr_len + offset + sizeof(tlv.type) + sizeof(tlv.len);
   125			cell.bytes = tlv.len;
   126			cell.np = of_get_child_by_name(layout, cell.name);
 > 127			cell.read_post_process = onie_tlv_read_cb;
   128	
   129			ret = nvmem_add_one_cell(nvmem, &cell);
   130			if (ret) {
   131				of_node_put(layout);
   132				return ret;
   133			}
   134	
   135			offset += sizeof(tlv) + tlv.len;
   136		}
   137	
   138		of_node_put(layout);
   139	
   140		return 0;
   141	}
   142	

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-05-12 18:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-12  2:57 [PATCH] nvmem: layouts: onie-tlv: fix read_post_process assignment chalianis1
2026-05-12  3:04 ` anis chali
2026-05-12 18:15 ` kernel test robot
2026-05-12 18:48 ` kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox