Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

fpga: altera-pr-ip: fix unsigned comparison with less than zero

Fix the "comparison with less than zero" warning reported by
cppcheck for the unsigned (size_t) parameter count of the
alt_pr_fpga_write() function.

Fixes: d201cc17a8a3 ("fpga pr ip: Core driver support for Altera Partial Reconfiguration IP")
Reviewed-by: Tom Rix <trix@redhat.com>
Acked-by: Xu Yilun <yilun.xu@intel.com>
Signed-off-by: Marco Pagani <marpagan@redhat.com>
Link: https://lore.kernel.org/r/20220609140520.42662-1-marpagan@redhat.com
Signed-off-by: Xu Yilun <yilun.xu@intel.com>

authored by

Marco Pagani and committed by
Xu Yilun
2df84a75 a5e3d775

+1 -1
+1 -1
drivers/fpga/altera-pr-ip-core.c
··· 108 108 u32 *buffer_32 = (u32 *)buf; 109 109 size_t i = 0; 110 110 111 - if (count <= 0) 111 + if (!count) 112 112 return -EINVAL; 113 113 114 114 /* Write out the complete 32-bit chunks */