Fix error messages to print line number

And don't use err() when no errno

Signed-off-by: Andi Kleen <ak@linux.intel.com>
diff --git a/mce-inject.c b/mce-inject.c
index 57b39ec..9bfd2ef 100644
--- a/mce-inject.c
+++ b/mce-inject.c
@@ -89,7 +89,7 @@
 	fclose(f);
 
 	if (!cpu_num)
-		err("getting cpu ids from /proc/cpuinfo");
+		fprintf(stderr, "cannot get cpu ids from /proc/cpuinfo\n");
 }
 
 void init_inject(void)
@@ -110,7 +110,7 @@
 	for (i = 0; i < cpu_num; i++)
 		if (cpu_map[i] == id)
 			return i;
-	err("invalid cpu id");
+	yyerror("cpu %d not online\n", id);
 	return -1;
 }
 
@@ -118,7 +118,7 @@
 {
 	cpu_id_to_index(m->extcpu);
 	if (m->bank > max_bank()) { 
-		fprintf(stderr, "larger machine check bank %d than supported on this cpu (%d)\n",
+		yyerror("larger machine check bank %d than supported on this cpu (%d)\n",
 			(int)m->bank, max_bank());	
 		exit(1);
 	}