[PATCH v5] lib/firmware_table: Provide buffer length argument to cdat_table_parse()

From: Robert Richter
Date: Sat Feb 17 2024 - 16:40:05 EST


On 17.02.24 18:43:37, kernel test robot wrote:
> Hi Robert,
>
> kernel test robot noticed the following build warnings:
>
> [auto build test WARNING on 6be99530c92c6b8ff7a01903edc42393575ad63b]
>
> url: https://github.com/intel-lab-lkp/linux/commits/Robert-Richter/cxl-pci-Rename-DOE-mailbox-handle-to-doe_mb/20240217-000206
> base: 6be99530c92c6b8ff7a01903edc42393575ad63b
> patch link: https://lore.kernel.org/r/20240216155844.406996-4-rrichter%40amd.com
> patch subject: [PATCH v4 3/3] lib/firmware_table: Provide buffer length argument to cdat_table_parse()
> config: arc-allyesconfig (https://download.01.org/0day-ci/archive/20240217/202402171817.i0WShbft-lkp@xxxxxxxxx/config)
> compiler: arceb-elf-gcc (GCC) 13.2.0
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240217/202402171817.i0WShbft-lkp@xxxxxxxxx/reproduce)

> In file included from include/linux/device.h:15,
> from drivers/cxl/core/pci.c:5:
> drivers/cxl/core/pci.c: In function 'read_cdat_data':
> >> drivers/cxl/core/pci.c:672:31: warning: format '%lu' expects argument of type 'long unsigned int', but argument 3 has type 'size_t' {aka 'unsigned int'} [-Wformat=]
> 672 | dev_warn(dev, "Malformed CDAT table length (%lu:%lu), discarding trailing data\n",
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Fix below, it basically uses %zu for both format strings.

-Robert