linux/drivers/soc
Tim Gardner 818a76a55d soc: fsl: dpio: Unsigned compared against 0 in qbman_swp_set_irq_coalescing()
Coverity complains of unsigned compare against 0. There are 2 cases in
this function:

1821        itp = (irq_holdoff * 1000) / p->desc->qman_256_cycles_per_ns;

CID 121131 (#1 of 1): Unsigned compared against 0 (NO_EFFECT)
unsigned_compare: This less-than-zero comparison of an unsigned value is never true. itp < 0U.
1822        if (itp < 0 || itp > 4096) {
1823                max_holdoff = (p->desc->qman_256_cycles_per_ns * 4096) / 1000;
1824                pr_err("irq_holdoff must be between 0..%dus\n", max_holdoff);
1825                return -EINVAL;
1826        }
1827
    	unsigned_compare: This less-than-zero comparison of an unsigned value is never true. irq_threshold < 0U.
1828        if (irq_threshold >= p->dqrr.dqrr_size || irq_threshold < 0) {
1829                pr_err("irq_threshold must be between 0..%d\n",
1830                       p->dqrr.dqrr_size - 1);
1831                return -EINVAL;
1832        }

Fix this by removing the comparisons altogether as they are incorrect. Zero is
a possible value in either case. Also fix a minor comment typo and update the
2 pr_err() calls to use %u formatting as well as be more precise regarding
the exact error.

Fixes: ed1d2143fe ("soc: fsl: dpio: add support for irq coalescing per software portal")
Cc: Ioana Ciornei <ioana.ciornei@nxp.com>
Cc: Roy Pledge <Roy.Pledge@nxp.com>
Cc: Li Yang <leoyang.li@nxp.com>
Cc: linux-kernel@vger.kernel.org
Cc: linuxppc-dev@lists.ozlabs.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: netdev@vger.kernel.org
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Tested-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Reviewed-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2021-10-20 14:21:31 +01:00
..
actions soc: actions: include header to fix missing prototype 2020-09-22 12:45:16 +05:30
amlogic ARM: Drivers for 5.14 2021-07-10 09:46:20 -07:00
aspeed soc: aspeed-lpc-ctrl: Fix clock cleanup in error path 2021-08-26 11:31:22 +02:00
atmel drivers: soc: atmel: fix type for same7 2021-02-04 21:54:31 +01:00
bcm ARM: Drivers for 5.14 2021-07-10 09:46:20 -07:00
canaan clk: Add RISC-V Canaan Kendryte K210 clock driver 2021-02-22 17:51:04 -08:00
dove
fsl soc: fsl: dpio: Unsigned compared against 0 in qbman_swp_set_irq_coalescing() 2021-10-20 14:21:31 +01:00
gemini
imx Revert "soc: imx8m: change to use platform driver" 2021-07-15 19:02:44 +08:00
ixp4xx soc: ixp4xx/qmgr: fix invalid __iomem access 2021-08-03 10:16:34 +02:00
lantiq soc: lantiq: convert to devm_platform_ioremap_resource 2020-01-10 11:44:52 -08:00
litex drivers/soc/litex: remove 8-bit subregister option 2021-06-11 04:35:40 +09:00
mediatek soc: mediatek: mmsys: Fix missing UFOE component in mt8173 table routing 2021-08-06 16:43:23 +02:00
qcom soc: qcom: mdt_loader: Drop PT_LOAD check on hash segment 2021-09-19 19:55:20 -05:00
renesas soc: renesas: Prefer memcpy() over strcpy() 2021-08-12 12:36:57 +02:00
rockchip soc: rockchip: io-domain: Remove unneeded semicolon 2021-08-19 23:56:38 +02:00
samsung soc: samsung: pm_domains: Convert to regular platform driver 2021-01-15 20:50:34 +01:00
sifive RISC-V: sifive_l2_cache: Update L2 cache driver to support SiFive FU740 2021-01-07 17:28:27 -08:00
sunxi ARM: SoC drivers for v5.12 2021-02-20 18:42:28 -08:00
tegra ARM: SoC drivers for 5.15 2021-09-01 15:25:28 -07:00
ti soc: ti: omap-prm: Fix external abort for am335x pruss 2021-09-30 11:30:03 +03:00
ux500 soc: ux500: Use custom soc attribute group instead of device_create_file 2020-07-06 09:48:06 +01:00
versatile soc: integrator: Drop pointless static qualifier in integrator_soc_init() 2020-08-20 08:57:05 +02:00
xilinx clk: xilinx: move xlnx_vcu clock driver from soc 2021-02-08 18:31:25 -08:00
Kconfig RISC-V Patches for the 5.12 Merge Window 2021-02-26 10:28:35 -08:00
Makefile ARM: ixp4xx: fix compile-testing soc drivers 2021-08-02 14:31:15 +02:00