Re: [PATCH rdma-rc] RDMA/cma: Fix truncation compilation warning in make_cma_ports

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 11 Sep 2023 15:18:06 +0300, Leon Romanovsky wrote:
> The following compilation error is false alarm as RDMA devices don't
> have such large amount of ports to actually cause to format truncation.
> 
> drivers/infiniband/core/cma_configfs.c: In function ‘make_cma_ports’:
> drivers/infiniband/core/cma_configfs.c:223:57: error: ‘snprintf’ output may be truncated before the last format character [-Werror=format-truncation=]
>   223 |                 snprintf(port_str, sizeof(port_str), "%u", i + 1);
>       |                                                         ^
> drivers/infiniband/core/cma_configfs.c:223:17: note: ‘snprintf’ output between 2 and 11 bytes into a destination of size 10
>   223 |                 snprintf(port_str, sizeof(port_str), "%u", i + 1);
>       |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> cc1: all warnings being treated as errors
> make[5]: *** [scripts/Makefile.build:243: drivers/infiniband/core/cma_configfs.o] Error 1
> 
> [...]

Applied, thanks!

[1/1] RDMA/cma: Fix truncation compilation warning in make_cma_ports
      https://git.kernel.org/rdma/rdma/c/0c6836da373dfb

Best regards,
-- 
Leon Romanovsky <leon@xxxxxxxxxx>



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux