Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/fdt Adjust residual calculation in "find index by na...
details: https://anonhg.NetBSD.org/src/rev/fb1a5efd9719
branches: trunk
changeset: 839600:fb1a5efd9719
user: jakllsch <jakllsch%NetBSD.org@localhost>
date: Wed Feb 27 16:30:40 2019 +0000
description:
Adjust residual calculation in "find index by name" idioms to take into
account the trailing NUL on each name. Some other similar instances of
this idiom already account for this.
(In preparation to factor out this idiom into its own function.)
diffstat:
sys/dev/fdt/fdt_clock.c | 6 +++---
sys/dev/fdt/fdt_dma.c | 6 +++---
sys/dev/fdt/fdt_phy.c | 6 +++---
sys/dev/fdt/fdt_reset.c | 6 +++---
sys/dev/fdt/fdt_subr.c | 6 +++---
5 files changed, 15 insertions(+), 15 deletions(-)
diffs (135 lines):
diff -r 62e1adc773f2 -r fb1a5efd9719 sys/dev/fdt/fdt_clock.c
--- a/sys/dev/fdt/fdt_clock.c Wed Feb 27 15:32:11 2019 +0000
+++ b/sys/dev/fdt/fdt_clock.c Wed Feb 27 16:30:40 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: fdt_clock.c,v 1.6 2018/09/09 07:21:18 aymeric Exp $ */
+/* $NetBSD: fdt_clock.c,v 1.7 2019/02/27 16:30:40 jakllsch Exp $ */
/*-
* Copyright (c) 2015 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fdt_clock.c,v 1.6 2018/09/09 07:21:18 aymeric Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fdt_clock.c,v 1.7 2019/02/27 16:30:40 jakllsch Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@@ -137,7 +137,7 @@
clk = fdtbus_clock_get_index(phandle, index);
break;
}
- resid -= strlen(p);
+ resid -= strlen(p) + 1;
p += strlen(p) + 1;
}
diff -r 62e1adc773f2 -r fb1a5efd9719 sys/dev/fdt/fdt_dma.c
--- a/sys/dev/fdt/fdt_dma.c Wed Feb 27 15:32:11 2019 +0000
+++ b/sys/dev/fdt/fdt_dma.c Wed Feb 27 16:30:40 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: fdt_dma.c,v 1.2 2018/06/30 20:34:43 jmcneill Exp $ */
+/* $NetBSD: fdt_dma.c,v 1.3 2019/02/27 16:30:40 jakllsch Exp $ */
/*-
* Copyright (c) 2015 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fdt_dma.c,v 1.2 2018/06/30 20:34:43 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fdt_dma.c,v 1.3 2019/02/27 16:30:40 jakllsch Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@@ -154,7 +154,7 @@
dma = fdtbus_dma_get_index(phandle, index, cb, cbarg);
break;
}
- resid -= strlen(p);
+ resid -= strlen(p) + 1;
p += strlen(p) + 1;
}
diff -r 62e1adc773f2 -r fb1a5efd9719 sys/dev/fdt/fdt_phy.c
--- a/sys/dev/fdt/fdt_phy.c Wed Feb 27 15:32:11 2019 +0000
+++ b/sys/dev/fdt/fdt_phy.c Wed Feb 27 16:30:40 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: fdt_phy.c,v 1.3 2019/01/30 01:24:00 jmcneill Exp $ */
+/* $NetBSD: fdt_phy.c,v 1.4 2019/02/27 16:30:40 jakllsch Exp $ */
/*-
* Copyright (c) 2015-2017 Jared McNeill <jmcneill%invisible.ca@localhost>
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fdt_phy.c,v 1.3 2019/01/30 01:24:00 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fdt_phy.c,v 1.4 2019/02/27 16:30:40 jakllsch Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@@ -153,7 +153,7 @@
phy = fdtbus_phy_get_index(phandle, index);
break;
}
- resid -= strlen(p);
+ resid -= strlen(p) + 1;
p += strlen(p) + 1;
}
diff -r 62e1adc773f2 -r fb1a5efd9719 sys/dev/fdt/fdt_reset.c
--- a/sys/dev/fdt/fdt_reset.c Wed Feb 27 15:32:11 2019 +0000
+++ b/sys/dev/fdt/fdt_reset.c Wed Feb 27 16:30:40 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: fdt_reset.c,v 1.2 2018/06/30 20:34:43 jmcneill Exp $ */
+/* $NetBSD: fdt_reset.c,v 1.3 2019/02/27 16:30:40 jakllsch Exp $ */
/*-
* Copyright (c) 2015 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fdt_reset.c,v 1.2 2018/06/30 20:34:43 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fdt_reset.c,v 1.3 2019/02/27 16:30:40 jakllsch Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@@ -153,7 +153,7 @@
rst = fdtbus_reset_get_index(phandle, index);
break;
}
- resid -= strlen(p);
+ resid -= strlen(p) + 1;
p += strlen(p) + 1;
}
diff -r 62e1adc773f2 -r fb1a5efd9719 sys/dev/fdt/fdt_subr.c
--- a/sys/dev/fdt/fdt_subr.c Wed Feb 27 15:32:11 2019 +0000
+++ b/sys/dev/fdt/fdt_subr.c Wed Feb 27 16:30:40 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: fdt_subr.c,v 1.27 2019/01/30 00:56:47 jmcneill Exp $ */
+/* $NetBSD: fdt_subr.c,v 1.28 2019/02/27 16:30:40 jakllsch Exp $ */
/*-
* Copyright (c) 2015 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fdt_subr.c,v 1.27 2019/01/30 00:56:47 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fdt_subr.c,v 1.28 2019/02/27 16:30:40 jakllsch Exp $");
#include "opt_fdt.h"
@@ -230,7 +230,7 @@
error = fdtbus_get_reg(phandle, index, paddr, psize);
break;
}
- resid -= strlen(p);
+ resid -= strlen(p) + 1;
p += strlen(p) + 1;
}
Home |
Main Index |
Thread Index |
Old Index