]> git.ipfire.org Git - thirdparty/openwrt.git/commit
kernel: mtk_bmt: counteracting calloc-transposed-args compiler warning 18701/head
authorMieczyslaw Nalewaj <namiltd@yahoo.com>
Sun, 4 May 2025 09:32:57 +0000 (11:32 +0200)
committerRobert Marko <robimarko@gmail.com>
Tue, 13 May 2025 20:07:11 +0000 (22:07 +0200)
commit4d18c41a6c5da4ead0f5d69a630b935fb24434a0
treee157d54a5dd77e6c84c45a14f9c0107c59c8a181
parent8cf0c810fb168d0bdb33715caf0fc05ef10cb3f0
kernel: mtk_bmt: counteracting calloc-transposed-args compiler warning

For kernel 6.12 there is a warning causing an error:
drivers/mtd/nand/mtk_bmt_v2.c: In function 'mtk_bmt_get_mapping_mask':
drivers/mtd/nand/mtk_bmt_v2.c:307:31: error: 'kmalloc_array_noprof' sizes specified with 'sizeof' in the earlier argument and not in the later argument [-Werror=calloc-transposed-args]
  307 |         used = kcalloc(sizeof(unsigned long), BIT_WORD(bmtd.bmt_blk_idx) + 1, GFP_KERNEL);
      |                               ^~~~~~~~

Swapping the arguments solves the problem.

Signed-off-by: Mieczyslaw Nalewaj <namiltd@yahoo.com>
Link: https://github.com/openwrt/openwrt/pull/18701
Signed-off-by: Robert Marko <robimarko@gmail.com>
target/linux/generic/files/drivers/mtd/nand/mtk_bmt_v2.c