From 07fe9d554f96391f83bd136d243e060ccdcd1887 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Tue, 29 Oct 2024 11:51:34 -0500 Subject: [PATCH] Minor cleanups. --- toys/other/devmem.c | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/toys/other/devmem.c b/toys/other/devmem.c index e3727fd5..90c25060 100644 --- a/toys/other/devmem.c +++ b/toys/other/devmem.c @@ -42,42 +42,40 @@ unsigned long xatolu(char *str, int bytes) void devmem_main(void) { - int writing = toys.optc > 2, page_size = sysconf(_SC_PAGESIZE), bytes = 4, fd, - flags; - unsigned long data = 0, map_off, map_len, + int ii, writing = toys.optc > 2, bytes = 4, fd; + unsigned long data QUIET, map_len QUIET, addr = xatolu(*toys.optargs, sizeof(long)); - char *sizes = sizeof(long)==8 ? "1248" : "124"; - void *map, *p; + void *map QUIET, *p QUIET; // WIDTH? if (toys.optc>1) { - int i; + char *sizes = sizeof(long)==8 ? "1248" : "124"; - if ((i=stridx(sizes, *toys.optargs[1]))==-1 || toys.optargs[1][1]) + if ((ii = stridx(sizes, *toys.optargs[1]))==-1 || toys.optargs[1][1]) error_exit("bad width: %s", toys.optargs[1]); - bytes = 1<