Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 7 Jan 2011 18:52:09 +0000 (UTC)
From:      Stanislav Sedov <stas@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r217119 - head/usr.sbin/cpucontrol
Message-ID:  <201101071852.p07Iq92H062149@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: stas
Date: Fri Jan  7 18:52:08 2011
New Revision: 217119
URL: http://svn.freebsd.org/changeset/base/217119

Log:
  - Save some space relying on the fact that all ioctl commands
    prefixes are the same.
  
  Suggested by:	"Carlos A. M. dos Santos" <unixmania@gmail.com>

Modified:
  head/usr.sbin/cpucontrol/cpucontrol.c

Modified: head/usr.sbin/cpucontrol/cpucontrol.c
==============================================================================
--- head/usr.sbin/cpucontrol/cpucontrol.c	Fri Jan  7 18:41:59 2011	(r217118)
+++ head/usr.sbin/cpucontrol/cpucontrol.c	Fri Jan  7 18:52:08 2011	(r217119)
@@ -246,19 +246,19 @@ do_msr(const char *cmdarg, const char *d
 	switch (op) {
 	case OP_READ:
 		command = CPUCTL_RDMSR;
-		command_name = "CPUCTL_RDMSR";
+		command_name = "RDMSR";
 		break;
 	case OP_WRITE:
 		command = CPUCTL_WRMSR;
-		command_name = "CPUCTL_WRMSR";
+		command_name = "WRMSR";
 		break;
 	case OP_OR:
 		command = CPUCTL_MSRSBIT;
-		command_name = "CPUCTL_MSRSBIT";
+		command_name = "MSRSBIT";
 		break;
 	case OP_AND:
 		command = CPUCTL_MSRCBIT;
-		command_name = "CPUCTL_MSRCBIT";
+		command_name = "MSRCBIT";
 		break;
 	default:
 		abort();
@@ -271,7 +271,7 @@ do_msr(const char *cmdarg, const char *d
 	}
 	error = ioctl(fd, command, &args);
 	if (error < 0) {
-		WARN(0, "ioctl(%s, %s (%lu))", dev, command_name, command);
+		WARN(0, "ioctl(%s, CPUCTL_%s (%lu))", dev, command_name, command);
 		close(fd);
 		return (1);
 	}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201101071852.p07Iq92H062149>