projects
/
platform
/
kernel
/
u-boot.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
99eaf1f
)
pinctrl: Avoid coverity warning when checking width
author
Simon Glass
<sjg@chromium.org>
Fri, 14 May 2021 01:39:28 +0000
(19:39 -0600)
committer
Tom Rini
<trini@konsulko.com>
Thu, 15 Jul 2021 22:42:05 +0000
(18:42 -0400)
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)
drivers/pinctrl/pinctrl-single.c
patch
|
blob
|
history
diff --git
a/drivers/pinctrl/pinctrl-single.c
b/drivers/pinctrl/pinctrl-single.c
index
7af6c5f
..
cf9ad36
100644
(file)
--- 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) {