card->vdev = vdev;
for (i = 0; i < PIO2_VARIANT_LENGTH; i++) {
- if (isdigit(card->variant[i]) == 0) {
+ if (!isdigit(card->variant[i])) {
dev_err(&card->vdev->dev, "Variant invalid\n");
retval = -EINVAL;
goto err_variant;
case VME_IRQ_GEN:
copied = copy_from_user(&irq_req, argp,
sizeof(irq_req));
- if (copied != 0) {
+ if (copied) {
pr_warn("Partial copy from userspace\n");
return -EFAULT;
}
copied = copy_to_user(argp, &master,
sizeof(master));
- if (copied != 0) {
+ if (copied) {
pr_warn("Partial copy to userspace\n");
return -EFAULT;
}
}
copied = copy_from_user(&master, argp, sizeof(master));
- if (copied != 0) {
+ if (copied) {
pr_warn("Partial copy from userspace\n");
return -EFAULT;
}
copied = copy_to_user(argp, &slave,
sizeof(slave));
- if (copied != 0) {
+ if (copied) {
pr_warn("Partial copy to userspace\n");
return -EFAULT;
}
case VME_SET_SLAVE:
copied = copy_from_user(&slave, argp, sizeof(slave));
- if (copied != 0) {
+ if (copied) {
pr_warn("Partial copy from userspace\n");
return -EFAULT;
}
* we just change the code in vme_user_match().
*/
retval = vme_register_driver(&vme_user_driver, VME_MAX_SLOTS);
- if (retval != 0)
+ if (retval)
goto err_reg;
return retval;