aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/vnic
diff options
context:
space:
mode:
authorOleksandr Tymoshenko <gonzo@FreeBSD.org>2018-03-20 00:03:49 +0000
committerOleksandr Tymoshenko <gonzo@FreeBSD.org>2018-03-20 00:03:49 +0000
commit108117cc22335234f817584a42704258209ca78c (patch)
tree35821278566f932eed35ee949df3ea3e14a796a3 /sys/dev/vnic
parent5f5baf0e9697eea27a5a8e77fbdb639397f7f388 (diff)
downloadsrc-108117cc22335234f817584a42704258209ca78c.tar.gz
src-108117cc22335234f817584a42704258209ca78c.zip
[ofw] fix errneous checks for OF_finddevice(9) return value
OF_finddevices returns ((phandle_t)-1) in case of failure. Some code in existing drivers checked return value to be equal to 0 or less/equal to 0 which is also wrong because phandle_t is unsigned type. Most of these checks were for negative cases that were never triggered so trhere was no impact on functionality. Reviewed by: nwhitehorn MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D14645
Notes
Notes: svn path=/head/; revision=331229
Diffstat (limited to 'sys/dev/vnic')
-rw-r--r--sys/dev/vnic/thunder_bgx_fdt.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/dev/vnic/thunder_bgx_fdt.c b/sys/dev/vnic/thunder_bgx_fdt.c
index 0998e0ec6685..380d7f90697e 100644
--- a/sys/dev/vnic/thunder_bgx_fdt.c
+++ b/sys/dev/vnic/thunder_bgx_fdt.c
@@ -336,7 +336,7 @@ bgx_fdt_find_node(struct bgx *bgx)
snprintf(bgx_sel, len + 1, "/"BGX_NODE_NAME"%d", bgx->bgx_id);
/* First try the root node */
node = OF_finddevice(bgx_sel);
- if ((int)node > 0) {
+ if (node != -1) {
/* Found relevant node */
goto out;
}