Thread (29 messages) 29 messages, 4 authors, 2019-05-28
STALE2558d

[PATCH 04/16] powerpc/xmon: use new match_string() helper/macro

From: Alexandru Ardelean <hidden>
Date: 2019-05-08 11:33:54
Also in: alsa-devel, cgroups, dri-devel, intel-gfx, kvm, linux-arm-kernel, linux-clk, linux-fbdev, linux-gpio, linux-ide, linux-integrity, linux-mm, linux-mmc, linux-omap, linux-pci, linux-pm, linux-rockchip, linux-tegra, linux-usb, linux-wireless, linuxppc-dev, lkml, netdev
Subsystem: linux for powerpc (32-bit and 64-bit), the rest · Maintainers: Madhavan Srinivasan, Michael Ellerman, Linus Torvalds

The change is purely cosmetic at this point in time, but it does highlight
the change done in lib/string.c for match_string().

Particularly for this change, if a regname is removed (replaced with NULL)
in the list, the match_string() helper will continue until the end of the
array and ignore the NULL.
This would technically allow for "reserved" regs, though here it's not the
case.

Signed-off-by: Alexandru Ardelean <redacted>
---
 arch/powerpc/xmon/xmon.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c
index efca104ac0cb..b84a7fc1112b 100644
--- a/arch/powerpc/xmon/xmon.c
+++ b/arch/powerpc/xmon/xmon.c
@@ -3231,7 +3231,7 @@ scanhex(unsigned long *vp)
 			regname[i] = c;
 		}
 		regname[i] = 0;
-		i = __match_string(regnames, N_PTREGS, regname);
+		i = match_string(regnames, regname);
 		if (i < 0) {
 			printf("invalid register name '%%%s'\n", regname);
 			return 0;
-- 
2.17.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help