aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/vc04_services/interface
diff options
context:
space:
mode:
authorGargi Sharma <gs051095@gmail.com>2017-02-24 01:58:18 +0530
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-03-06 09:17:02 +0100
commit47db0f6c9a2210dc5a7c45551d63d7d69b5600a6 (patch)
tree47389bdc6bac6217f480a05cff584453c9d0bdb4 /drivers/staging/vc04_services/interface
parentstaging: vc04_services: Fixed "space prohibited after that open/close parenthesis" erros. (diff)
downloadlinux-dev-47db0f6c9a2210dc5a7c45551d63d7d69b5600a6.tar.xz
linux-dev-47db0f6c9a2210dc5a7c45551d63d7d69b5600a6.zip
staging: vc04_services: Remove explicit NULL comparison
Replace explicit NULL comparison with ! operator to simplify code. Found with Coccinelle script: @@ expression ptr; position p; statement s0, s1; @@ ptr@p = \(kmalloc\|devm_kzalloc\|kmalloc_array\|devm_ioremap\|usb_alloc_urb\| alloc_netdev\|dev_alloc_skb\)(...) ... when != ptr if ( ( + ! ptr - == NULL ) ) s0 else s1 Signed-off-by: Gargi Sharma <gs051095@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/vc04_services/interface')
-rw-r--r--drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
index dc4569e3f578..cc4cb168f483 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
@@ -1590,7 +1590,7 @@ dump_phys_mem(void *virt_addr, u32 num_bytes)
num_pages = DIV_ROUND_UP(offset + num_bytes, PAGE_SIZE);
pages = kmalloc(sizeof(struct page *) * num_pages, GFP_KERNEL);
- if (pages == NULL) {
+ if (!pages) {
vchiq_log_error(vchiq_arm_log_level,
"Unable to allocation memory for %d pages\n",
num_pages);