/* Write a meaningful log entry to the kernel log in the event of an APM error. Note that this also handles (negative) kernel errors.  */
static void apm_error(char *str, int err)
/* Write a meaningful log entry to the kernel log in the event of an APM error. Note that this also handles (negative) kernel errors.  */
static void apm_error(char *str, int err)
{
	int i;
	for (i = 0; i < ERROR_COUNT; i++)
		if (error_table[i].key == err)
			break;
	if (i < ERROR_COUNT)
		printk(KERN_NOTICE "apm: %s: %s\n", str, error_table[i].msg);
	else if (err < 0)
		printk(KERN_NOTICE "apm: %s: linux error code %i\n", str, err);
	else
		printk(KERN_NOTICE "apm: %s: unknown error code %#2.2x\n",
		       str, err);
}