Re: [PATCH] nvmem: layouts: onie-tlv: fix read_post_process assignment
From: kernel test robot
Date: Tue May 12 2026 - 14:17:53 EST
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@xxxxxxxxx/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@xxxxxxxxx/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@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202605130229.IIa8Bfjl-lkp@xxxxxxxxx/
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