Skip to content

Commit a50d99d

Browse files
gurkagregkh
authored andcommitted
staging: kpc2000: simplify comparison to NULL in dma.c
Fixes checkpatch warning "Comparison to NULL could be written [...]". Signed-off-by: Simon Sandström <simon@nikanor.nu> Link: https://lore.kernel.org/r/20190704060811.10330-3-simon@nikanor.nu Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 209ff93 commit a50d99d

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

  • drivers/staging/kpc2000/kpc_dma

‎drivers/staging/kpc2000/kpc_dma/dma.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ int setup_dma_engine(struct kpc_dma_device *eng, u32 desc_cnt)
119119
cur = eng->desc_pool_first;
120120
for (i = 1 ; i < eng->desc_pool_cnt ; i++) {
121121
next = dma_pool_alloc(eng->desc_pool, GFP_KERNEL | GFP_DMA, &next_handle);
122-
if (next == NULL)
122+
if (!next)
123123
goto done_alloc;
124124

125125
clear_desc(next);
@@ -245,7 +245,7 @@ int count_descriptors_available(struct kpc_dma_device *eng)
245245

246246
void clear_desc(struct kpc_dma_descriptor *desc)
247247
{
248-
if (desc == NULL)
248+
if (!desc)
249249
return;
250250
desc->DescByteCount = 0;
251251
desc->DescStatusErrorFlags = 0;

0 commit comments

Comments
 (0)