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 <sjg@chromium.org>
Reported-by: Coverity (CID: 331154)
This commit is contained in:
Simon Glass 2021-05-13 19:39:28 -06:00 committed by Tom Rini
parent 99eaf1fcaa
commit 4d159b6f84

View file

@ -471,6 +471,7 @@ static int single_probe(struct udevice *dev)
return -ENOMEM; return -ENOMEM;
#endif #endif
/* looks like a possible divide by 0, but data->width avoids this */
priv->npins = size / (pdata->width / BITS_PER_BYTE); priv->npins = size / (pdata->width / BITS_PER_BYTE);
if (pdata->bits_per_mux) { if (pdata->bits_per_mux) {
if (!pdata->mask) { if (!pdata->mask) {