Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752112AbbKVJ3G (ORCPT ); Sun, 22 Nov 2015 04:29:06 -0500 Received: from mail-lb0-f176.google.com ([209.85.217.176]:33629 "EHLO mail-lb0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751939AbbKVJ3B (ORCPT ); Sun, 22 Nov 2015 04:29:01 -0500 From: Egor Uleyskiy X-Google-Original-From: Egor Uleyskiy < egor.ulieiskii@gmail.com > To: Greg Kroah-Hartman Cc: Egor Uleyskiy , Manohar Vanga , Martyn Welch , Trivial Patch Monkey , linux-kernel@vger.kernel.org Subject: [PATCH 5/6] drivers: staging: vme: Fixed checking NULL and 0 code style Date: Sun, 22 Nov 2015 11:27:56 +0200 Message-Id: <1448184477-24767-5-git-send-email-egor.ulieiskii@gmail.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1448184477-24767-1-git-send-email-egor.ulieiskii@gmail.com> References: <1448184477-24767-1-git-send-email-egor.ulieiskii@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3438 Lines: 101 From: Egor Uleyskiy Signed-off-by: Egor Uleyskiy --- drivers/staging/vme/devices/vme_pio2_core.c | 2 +- drivers/staging/vme/devices/vme_pio2_gpio.c | 2 +- drivers/staging/vme/devices/vme_user.c | 12 ++++++------ 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/staging/vme/devices/vme_pio2_core.c b/drivers/staging/vme/devices/vme_pio2_core.c index 296551f..30712da 100644 --- a/drivers/staging/vme/devices/vme_pio2_core.c +++ b/drivers/staging/vme/devices/vme_pio2_core.c @@ -230,7 +230,7 @@ static int pio2_probe(struct vme_dev *vdev) 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; diff --git a/drivers/staging/vme/devices/vme_pio2_gpio.c b/drivers/staging/vme/devices/vme_pio2_gpio.c index 65fdb56..df992c3 100644 --- a/drivers/staging/vme/devices/vme_pio2_gpio.c +++ b/drivers/staging/vme/devices/vme_pio2_gpio.c @@ -190,7 +190,7 @@ int pio2_gpio_init(struct pio2_card *card) label = kasprintf(GFP_KERNEL, "%s@%s", driver_name, dev_name(&card->vdev->dev)); - if (label == NULL) + if (!label) return -ENOMEM; card->gc.label = label; diff --git a/drivers/staging/vme/devices/vme_user.c b/drivers/staging/vme/devices/vme_user.c index a05a065..b95883b 100644 --- a/drivers/staging/vme/devices/vme_user.c +++ b/drivers/staging/vme/devices/vme_user.c @@ -309,7 +309,7 @@ static int vme_user_ioctl(struct inode *inode, struct file *file, 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; } @@ -335,7 +335,7 @@ static int vme_user_ioctl(struct inode *inode, struct file *file, copied = copy_to_user(argp, &master, sizeof(master)); - if (copied != 0) { + if (copied) { pr_warn("Partial copy to userspace\n"); return -EFAULT; } @@ -350,7 +350,7 @@ static int vme_user_ioctl(struct inode *inode, struct file *file, } copied = copy_from_user(&master, argp, sizeof(master)); - if (copied != 0) { + if (copied) { pr_warn("Partial copy from userspace\n"); return -EFAULT; } @@ -380,7 +380,7 @@ static int vme_user_ioctl(struct inode *inode, struct file *file, copied = copy_to_user(argp, &slave, sizeof(slave)); - if (copied != 0) { + if (copied) { pr_warn("Partial copy to userspace\n"); return -EFAULT; } @@ -390,7 +390,7 @@ static int vme_user_ioctl(struct inode *inode, struct file *file, 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; } @@ -757,7 +757,7 @@ static int __init vme_user_init(void) * 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; -- 2.5.0 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/