Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.sbin/cpuctl convert getcpuid() to take char* not char**



details:   https://anonhg.NetBSD.org/src/rev/dbf3b624d240
branches:  trunk
changeset: 341657:dbf3b624d240
user:      mrg <mrg%NetBSD.org@localhost>
date:      Mon Nov 16 02:04:32 2015 +0000

description:
convert getcpuid() to take char* not char**

diffstat:

 usr.sbin/cpuctl/cpuctl.c |  20 ++++++++++----------
 1 files changed, 10 insertions(+), 10 deletions(-)

diffs (88 lines):

diff -r 6a19bd70a766 -r dbf3b624d240 usr.sbin/cpuctl/cpuctl.c
--- a/usr.sbin/cpuctl/cpuctl.c  Mon Nov 16 02:02:41 2015 +0000
+++ b/usr.sbin/cpuctl/cpuctl.c  Mon Nov 16 02:04:32 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cpuctl.c,v 1.26 2015/11/16 02:02:41 mrg Exp $  */
+/*     $NetBSD: cpuctl.c,v 1.27 2015/11/16 02:04:32 mrg Exp $  */
 
 /*-
  * Copyright (c) 2007, 2008, 2009, 2012 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #ifndef lint
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: cpuctl.c,v 1.26 2015/11/16 02:02:41 mrg Exp $");
+__RCSID("$NetBSD: cpuctl.c,v 1.27 2015/11/16 02:04:32 mrg Exp $");
 #endif /* not lint */
 
 #include <sys/param.h>
@@ -55,7 +55,7 @@
 
 #include "cpuctl.h"
 
-static u_int   getcpuid(char **);
+static u_int   getcpuid(char *);
 __dead static void     usage(void);
 
 static void    cpu_identify(char **);
@@ -148,7 +148,7 @@
 {
        cpustate_t cs;
 
-       cs.cs_id = getcpuid(argv);
+       cs.cs_id = getcpuid(*argv);
        if (ioctl(fd, IOC_CPU_GETSTATE, &cs) < 0)
                err(EXIT_FAILURE, "IOC_CPU_GETSTATE");
        cs.cs_online = true;
@@ -161,7 +161,7 @@
 {
        cpustate_t cs;
 
-       cs.cs_id = getcpuid(argv);
+       cs.cs_id = getcpuid(*argv);
        if (ioctl(fd, IOC_CPU_GETSTATE, &cs) < 0)
                err(EXIT_FAILURE, "IOC_CPU_GETSTATE");
        cs.cs_online = false;
@@ -174,7 +174,7 @@
 {
        cpustate_t cs;
 
-       cs.cs_id = getcpuid(argv);
+       cs.cs_id = getcpuid(*argv);
        if (ioctl(fd, IOC_CPU_GETSTATE, &cs) < 0)
                err(EXIT_FAILURE, "IOC_CPU_GETSTATE");
        cs.cs_intr = true;
@@ -187,7 +187,7 @@
 {
        cpustate_t cs;
 
-       cs.cs_id = getcpuid(argv);
+       cs.cs_id = getcpuid(*argv);
        if (ioctl(fd, IOC_CPU_GETSTATE, &cs) < 0)
                err(EXIT_FAILURE, "IOC_CPU_GETSTATE");
        cs.cs_intr = false;
@@ -255,7 +255,7 @@
        cpuset_t *cpuset;
 
        np = sysconf(_SC_NPROCESSORS_CONF);
-       id = getcpuid(argv);
+       id = getcpuid(*argv);
        snprintf(name, sizeof(name), "cpu%u", id);
 
        if (np != 1) {
@@ -279,13 +279,13 @@
 }
 
 static u_int
-getcpuid(char **argv)
+getcpuid(char *arg)
 {
        char *argp;
        u_int id;
        long np;
 
-       id = (u_int)strtoul(argv[0], &argp, 0);
+       id = (u_int)strtoul(arg, &argp, 0);
        if (*argp != '\0')
                usage();
 



Home | Main Index | Thread Index | Old Index