mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-03 23:58:05 +00:00
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>
This commit is contained in:
parent
1ee6491241
commit
47db0f6c9a
1 changed files with 1 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue