} if (copy_from_user(&val, argp, sizeof(int))) { 
 if (copy_from_user(&val, argp, sizeof(int))) 
static int i8k_ioctl(struct inode *ip, struct file *fp, unsigned int cmd,		     unsigned long arg){	int val = 0;	int speed;	unsigned char buff[16];	int __user *argp = (int __user *)arg;	if (!argp)		return -EINVAL;	switch (cmd) {	case I8K_BIOS_VERSION:		val = i8k_get_bios_version();		break;	case I8K_MACHINE_ID:		memset(buff, 0, 16);		strlcpy(buff, i8k_get_dmi_data(DMI_PRODUCT_SERIAL), sizeof(buff));		break;	case I8K_FN_STATUS:		val = i8k_get_fn_status();		break;	case I8K_POWER_STATUS:		val = i8k_get_power_status();		break;	case I8K_GET_TEMP:		val = i8k_get_cpu_temp();		break;	case I8K_GET_SPEED:		if (copy_from_user(&val, argp, sizeof(int))) {			return -EFAULT;		}		val = i8k_get_fan_speed(val);		break;	case I8K_GET_FAN:		if (copy_from_user(&val, argp, sizeof(int))) {			return -EFAULT;		}		val = i8k_get_fan_status(val);		break;	case I8K_SET_FAN:		if (restricted && !capable(CAP_SYS_ADMIN)) {			return -EPERM;		}		if (copy_from_user(&val, argp, sizeof(int))) {			return -EFAULT;		}		if (copy_from_user(&speed, argp + 1, sizeof(int))) {			return -EFAULT;		}		val = i8k_set_fan(val, speed);		break;	default:		return -EINVAL;	}	if (val < 0) {		return val;	}	switch (cmd) {	case I8K_BIOS_VERSION:		if (copy_to_user(argp, &val, 4)) {			return -EFAULT;		}		break;	case I8K_MACHINE_ID:		if (copy_to_user(argp, buff, 16)) {			return -EFAULT;		}		break;	default:		if (copy_to_user(argp, &val, sizeof(int))) {			return -EFAULT;		}		break;	}	return 0;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/8378b92405dd606c6f3a0b1e303b67c8f8c9f743/i8k.c/clean/drivers/char/i8k.c