nvmem: layouts: onie-tlv: fix read_post_process assignment
Subsystems (3)
PATCH 1/1 nvmem: layouts: onie-tlv: fix read_post_process assignment
From: Chali Anis <[email protected]>
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.
--- drivers/nvmem/layouts/onie-tlv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/nvmem/layouts/onie-tlv.c +1 -1
@@ -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) {
Please disregard this patch.
Quoted 27 lines · Le lun. 11 mai 2026 à 22:57, <[email protected]> a écrit :
From: Chali Anis <[email protected]>
Assign the
onie_tlv_read_cbcallback directly toread_post_processinstead 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 <[email protected]>--- drivers/nvmem/layouts/onie-tlv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/nvmem/layouts/onie-tlv.c +1
-1@@ -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) {
kernel test robot
build botkernel test robot noticed the following build errors:
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/[email protected]/config) compiler: nios2-linux-gcc (GCC) 11.5.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260513/[email protected]/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 <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
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
Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
kernel test robot
build botkernel test robot noticed the following build errors:
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/[email protected]/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/[email protected]/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 <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
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
Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki