mirror of https://gitee.com/openkylin/linux.git
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: Sam Muhammed <jane.pnx9@gmail.com> Link: https://lore.kernel.org/r/f344afba0a8bb0413941a63678688435f04a96b4.1585143581.git.jane.pnx9@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
904da296a5
commit
0af192c755
|
@ -236,7 +236,7 @@ int count_descriptors_available(struct kpc_dma_device *eng)
|
|||
struct kpc_dma_descriptor *cur = eng->desc_next;
|
||||
|
||||
while (cur != eng->desc_completed) {
|
||||
BUG_ON(cur == NULL);
|
||||
BUG_ON(!cur);
|
||||
count++;
|
||||
cur = cur->Next;
|
||||
}
|
||||
|
|
|
@ -124,7 +124,7 @@ static int kpc_dma_transfer(struct dev_private_data *priv,
|
|||
pcnt = count_parts_for_sge(sg);
|
||||
for (p = 0 ; p < pcnt ; p++) {
|
||||
// Fill out the descriptor
|
||||
BUG_ON(desc == NULL);
|
||||
BUG_ON(!desc);
|
||||
clear_desc(desc);
|
||||
if (p != pcnt-1) {
|
||||
desc->DescByteCount = 0x80000;
|
||||
|
@ -203,11 +203,11 @@ void transfer_complete_cb(struct aio_cb_data *acd, size_t xfr_count, u32 flags)
|
|||
{
|
||||
unsigned int i;
|
||||
|
||||
BUG_ON(acd == NULL);
|
||||
BUG_ON(acd->user_pages == NULL);
|
||||
BUG_ON(acd->sgt.sgl == NULL);
|
||||
BUG_ON(acd->ldev == NULL);
|
||||
BUG_ON(acd->ldev->pldev == NULL);
|
||||
BUG_ON(!acd);
|
||||
BUG_ON(!acd->user_pages);
|
||||
BUG_ON(!acd->sgt.sgl);
|
||||
BUG_ON(!acd->ldev);
|
||||
BUG_ON(!acd->ldev->pldev);
|
||||
|
||||
for (i = 0 ; i < acd->page_count ; i++) {
|
||||
if (!PageReserved(acd->user_pages[i])) {
|
||||
|
|
|
@ -198,14 +198,14 @@ u32 GetEngineCompletePtr(struct kpc_dma_device *eng)
|
|||
static inline
|
||||
void lock_engine(struct kpc_dma_device *eng)
|
||||
{
|
||||
BUG_ON(eng == NULL);
|
||||
BUG_ON(!eng);
|
||||
mutex_lock(&eng->sem);
|
||||
}
|
||||
|
||||
static inline
|
||||
void unlock_engine(struct kpc_dma_device *eng)
|
||||
{
|
||||
BUG_ON(eng == NULL);
|
||||
BUG_ON(!eng);
|
||||
mutex_unlock(&eng->sem);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue