Commit 0af192c7 authored by Sam Muhammed's avatar Sam Muhammed Committed by Greg Kroah-Hartman

Staging: kpc2000: kpc_dma: Remove comparison to NULL.

Comparison to NULL been used across the driver,
remove them and use (!var) instead.

Checkpatch.pl: CHECK:
Comparison to NULL could be written "!desc"... etc
Signed-off-by: default avatarSam Muhammed <jane.pnx9@gmail.com>
Link: https://lore.kernel.org/r/f344afba0a8bb0413941a63678688435f04a96b4.1585143581.git.jane.pnx9@gmail.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 904da296
...@@ -236,7 +236,7 @@ int count_descriptors_available(struct kpc_dma_device *eng) ...@@ -236,7 +236,7 @@ int count_descriptors_available(struct kpc_dma_device *eng)
struct kpc_dma_descriptor *cur = eng->desc_next; struct kpc_dma_descriptor *cur = eng->desc_next;
while (cur != eng->desc_completed) { while (cur != eng->desc_completed) {
BUG_ON(cur == NULL); BUG_ON(!cur);
count++; count++;
cur = cur->Next; cur = cur->Next;
} }
......
...@@ -124,7 +124,7 @@ static int kpc_dma_transfer(struct dev_private_data *priv, ...@@ -124,7 +124,7 @@ static int kpc_dma_transfer(struct dev_private_data *priv,
pcnt = count_parts_for_sge(sg); pcnt = count_parts_for_sge(sg);
for (p = 0 ; p < pcnt ; p++) { for (p = 0 ; p < pcnt ; p++) {
// Fill out the descriptor // Fill out the descriptor
BUG_ON(desc == NULL); BUG_ON(!desc);
clear_desc(desc); clear_desc(desc);
if (p != pcnt-1) { if (p != pcnt-1) {
desc->DescByteCount = 0x80000; desc->DescByteCount = 0x80000;
...@@ -203,11 +203,11 @@ void transfer_complete_cb(struct aio_cb_data *acd, size_t xfr_count, u32 flags) ...@@ -203,11 +203,11 @@ void transfer_complete_cb(struct aio_cb_data *acd, size_t xfr_count, u32 flags)
{ {
unsigned int i; unsigned int i;
BUG_ON(acd == NULL); BUG_ON(!acd);
BUG_ON(acd->user_pages == NULL); BUG_ON(!acd->user_pages);
BUG_ON(acd->sgt.sgl == NULL); BUG_ON(!acd->sgt.sgl);
BUG_ON(acd->ldev == NULL); BUG_ON(!acd->ldev);
BUG_ON(acd->ldev->pldev == NULL); BUG_ON(!acd->ldev->pldev);
for (i = 0 ; i < acd->page_count ; i++) { for (i = 0 ; i < acd->page_count ; i++) {
if (!PageReserved(acd->user_pages[i])) { if (!PageReserved(acd->user_pages[i])) {
......
...@@ -198,14 +198,14 @@ u32 GetEngineCompletePtr(struct kpc_dma_device *eng) ...@@ -198,14 +198,14 @@ u32 GetEngineCompletePtr(struct kpc_dma_device *eng)
static inline static inline
void lock_engine(struct kpc_dma_device *eng) void lock_engine(struct kpc_dma_device *eng)
{ {
BUG_ON(eng == NULL); BUG_ON(!eng);
mutex_lock(&eng->sem); mutex_lock(&eng->sem);
} }
static inline static inline
void unlock_engine(struct kpc_dma_device *eng) void unlock_engine(struct kpc_dma_device *eng)
{ {
BUG_ON(eng == NULL); BUG_ON(!eng);
mutex_unlock(&eng->sem); mutex_unlock(&eng->sem);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment