summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Jones <davej@redhat.com>2011-02-22 01:22:42 -0500
committerDave Jones <davej@redhat.com>2011-02-22 01:22:42 -0500
commitad08ec55fbdd3171580317230bf7a0fafb19db81 (patch)
treee592e316e5624aaff15b8ff7755f9180903ca1dd
parent164e79522d7eeae9478f2537b6f6cf5832a8b6e1 (diff)
eradicate bogus 'silent' flag that wasn't even used
-rw-r--r--cpuid.c8
-rw-r--r--identify.c3
-rw-r--r--rdmsr.c6
-rw-r--r--x86info.c35
-rw-r--r--x86info.h1
5 files changed, 19 insertions, 34 deletions
diff --git a/cpuid.c b/cpuid.c
index 8fb6499..749bd48 100644
--- a/cpuid.c
+++ b/cpuid.c
@@ -134,13 +134,11 @@ void cpuid(unsigned int CPU_number, unsigned long long idx,
} else {
/* Something went wrong, just do UP and hope for the best. */
nodriver = 1;
- if (!silent && nrCPUs != 1)
+ if (nrCPUs != 1)
perror(cpuname);
- if (native_cpuid(CPU_number, idx, eax,ebx,ecx,edx)) {
+ if (native_cpuid(CPU_number, idx, eax,ebx,ecx,edx))
printf("%s", NATIVE_CPUID_FAILED_MSG);
- used_UP = 1;
- }
- used_UP = 1;
+ used_UP = 1;
return;
}
diff --git a/identify.c b/identify.c
index 76dc685..aefc896 100644
--- a/identify.c
+++ b/identify.c
@@ -95,9 +95,6 @@ void identify(struct cpudata *cpu)
void show_info(struct cpudata *cpu)
{
- if (silent)
- return;
-
printf("EFamily: %u EModel: %u Family: %u Model: %u Stepping: %u\n",
cpu->efamily, cpu->emodel, cpu->family,
model(cpu), cpu->stepping);
diff --git a/rdmsr.c b/rdmsr.c
index 0b2e3d5..15b813f 100644
--- a/rdmsr.c
+++ b/rdmsr.c
@@ -40,8 +40,7 @@ int read_msr(int cpu, unsigned int idx, unsigned long long *val)
fh = open(cpuname, O_RDONLY);
if (fh==-1) {
- if (!silent)
- perror(cpuname);
+ perror(cpuname);
nodriver=1;
return 0;
}
@@ -82,8 +81,7 @@ int read_msr(int cpu, unsigned int idx, unsigned long long *val)
fh = open(cpuname, O_RDONLY);
if (fh==-1) {
- if (!silent)
- perror(cpuname);
+ perror(cpuname);
nodriver=1;
return 0;
}
diff --git a/x86info.c b/x86info.c
index d4abd28..e6a6488 100644
--- a/x86info.c
+++ b/x86info.c
@@ -40,7 +40,6 @@ static int num_sockets = 0;
int debug = 0;
int verbose = 0;
-int silent = 0;
int used_UP = 0;
int user_is_root = 1;
static int need_root = 0;
@@ -321,10 +320,9 @@ int main (int argc, char **argv)
struct cpudata *cpu=NULL, *head=NULL, *tmp;
parse_command_line(argc, argv);
- if (!silent) {
- printf("x86info v1.28beta. Dave Jones 2001-2011\n");
- printf("Feedback to <davej@redhat.com>.\n\n");
- }
+
+ printf("x86info v1.28beta. Dave Jones 2001-2011\n");
+ printf("Feedback to <davej@redhat.com>.\n\n");
if ((HaveCPUID()) == 0) {
printf("No CPUID instruction available.\n");
@@ -340,20 +338,18 @@ int main (int argc, char **argv)
nrCPUs = sysconf(_SC_NPROCESSORS_ONLN);
- if (!silent) {
- printf("Found %u CPU", nrCPUs);
- if (nrCPUs > 1)
- printf("s");
+ printf("Found %u CPU", nrCPUs);
+ if (nrCPUs > 1)
+ printf("s");
- /* Check mptable if present. This way we get number of CPUs
- on SMP systems that have booted UP kernels. */
- if (user_is_root) {
- nrSMPCPUs = enumerate_cpus();
- if (nrSMPCPUs > nrCPUs)
- printf(", but found %ud CPUs in MPTable.", nrSMPCPUs);
- }
- printf("\n");
+ /* Check mptable if present. This way we get number of CPUs
+ on SMP systems that have booted UP kernels. */
+ if (user_is_root) {
+ nrSMPCPUs = enumerate_cpus();
+ if (nrSMPCPUs > nrCPUs)
+ printf(", but found %ud CPUs in MPTable.", nrSMPCPUs);
}
+ printf("\n");
/*
* can't have less than 1 CPU, or more than
@@ -391,7 +387,7 @@ int main (int argc, char **argv)
cpu->number = i;
- if (!silent && nrCPUs != 1)
+ if (nrCPUs != 1)
printf("CPU #%u\n", i+1);
bind_cpu(cpu);
@@ -443,10 +439,7 @@ int main (int argc, char **argv)
if (user_is_root) {
if (show_mtrr)
dump_mtrrs(cpu);
- }
- /* Info that requires root access */
- if (user_is_root) {
if (show_apic)
dump_apics(cpu);
}
diff --git a/x86info.h b/x86info.h
index d50e726..56721ec 100644
--- a/x86info.h
+++ b/x86info.h
@@ -195,7 +195,6 @@ extern unsigned int all_cpus;
extern struct cpudata *firstcpu;
extern int used_UP;
-extern int silent;
extern int user_is_root;
#define X86_FEATURE_MTRR 1<<12