From 4d159b6f84abeaacb346cfd14a3b0c6fb86f43f9 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Thu, 13 May 2021 19:39:28 -0600 Subject: [PATCH] pinctrl: Avoid coverity warning when checking width The width is set up in single_of_to_plat() and can only have three values, all of which result in a non-zero divisor. Add a comment. Signed-off-by: Simon Glass Reported-by: Coverity (CID: 331154) --- drivers/pinctrl/pinctrl-single.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/pinctrl/pinctrl-single.c b/drivers/pinctrl/pinctrl-single.c index 7af6c5f0b0..cf9ad3670f 100644 --- a/drivers/pinctrl/pinctrl-single.c +++ b/drivers/pinctrl/pinctrl-single.c @@ -471,6 +471,7 @@ static int single_probe(struct udevice *dev) return -ENOMEM; #endif + /* looks like a possible divide by 0, but data->width avoids this */ priv->npins = size / (pdata->width / BITS_PER_BYTE); if (pdata->bits_per_mux) { if (!pdata->mask) { -- 2.39.5