Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drivers: staging: vme: Fixed checking NULL and 0 code style

Signed-off-by: Egor Uleyskiy <egor.ulieiskii@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Egor Uleyskiy and committed by
Greg Kroah-Hartman
59a04f11 48a42206

+8 -8
+1 -1
drivers/staging/vme/devices/vme_pio2_core.c
··· 230 230 card->vdev = vdev; 231 231 232 232 for (i = 0; i < PIO2_VARIANT_LENGTH; i++) { 233 - if (isdigit(card->variant[i]) == 0) { 233 + if (!isdigit(card->variant[i])) { 234 234 dev_err(&card->vdev->dev, "Variant invalid\n"); 235 235 retval = -EINVAL; 236 236 goto err_variant;
+1 -1
drivers/staging/vme/devices/vme_pio2_gpio.c
··· 190 190 191 191 label = kasprintf(GFP_KERNEL, 192 192 "%s@%s", driver_name, dev_name(&card->vdev->dev)); 193 - if (label == NULL) 193 + if (!label) 194 194 return -ENOMEM; 195 195 196 196 card->gc.label = label;
+6 -6
drivers/staging/vme/devices/vme_user.c
··· 309 309 case VME_IRQ_GEN: 310 310 copied = copy_from_user(&irq_req, argp, 311 311 sizeof(irq_req)); 312 - if (copied != 0) { 312 + if (copied) { 313 313 pr_warn("Partial copy from userspace\n"); 314 314 return -EFAULT; 315 315 } ··· 335 335 336 336 copied = copy_to_user(argp, &master, 337 337 sizeof(master)); 338 - if (copied != 0) { 338 + if (copied) { 339 339 pr_warn("Partial copy to userspace\n"); 340 340 return -EFAULT; 341 341 } ··· 350 350 } 351 351 352 352 copied = copy_from_user(&master, argp, sizeof(master)); 353 - if (copied != 0) { 353 + if (copied) { 354 354 pr_warn("Partial copy from userspace\n"); 355 355 return -EFAULT; 356 356 } ··· 380 380 381 381 copied = copy_to_user(argp, &slave, 382 382 sizeof(slave)); 383 - if (copied != 0) { 383 + if (copied) { 384 384 pr_warn("Partial copy to userspace\n"); 385 385 return -EFAULT; 386 386 } ··· 390 390 case VME_SET_SLAVE: 391 391 392 392 copied = copy_from_user(&slave, argp, sizeof(slave)); 393 - if (copied != 0) { 393 + if (copied) { 394 394 pr_warn("Partial copy from userspace\n"); 395 395 return -EFAULT; 396 396 } ··· 757 757 * we just change the code in vme_user_match(). 758 758 */ 759 759 retval = vme_register_driver(&vme_user_driver, VME_MAX_SLOTS); 760 - if (retval != 0) 760 + if (retval) 761 761 goto err_reg; 762 762 763 763 return retval;