From: Shreeya Patel <shreeya.patel23498@gmail.com>
To: gregkh@linuxfoundation.org, devel@driverdev.osuosl.org,
linux-kernel@vger.kernel.org
Cc: Shreeya Patel <shreeya.patel23498@gmail.com>
Subject: [PATCH v4 4/4] Staging: rtl8723bs: Use !x instead of NULL comparison
Date: Wed, 24 Jan 2018 05:43:02 +0530 [thread overview]
Message-ID: <99315a25b008ec1e53bd98dd3230143f9d5e9b04.1516751432.git.shreeya.patel23498@gmail.com> (raw)
In-Reply-To: <cover.1516751432.git.shreeya.patel23498@gmail.com>
If "x" is compared to NULL, use "!x" instead of it, so as
to follow the kernel coding style.
Signed-off-by: Shreeya Patel <shreeya.patel23498@gmail.com>
---
drivers/staging/rtl8723bs/hal/sdio_ops.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/staging/rtl8723bs/hal/sdio_ops.c b/drivers/staging/rtl8723bs/hal/sdio_ops.c
index cc51969..ab2ff53 100644
--- a/drivers/staging/rtl8723bs/hal/sdio_ops.c
+++ b/drivers/staging/rtl8723bs/hal/sdio_ops.c
@@ -215,7 +215,7 @@ static u32 sdio_read32(struct intf_hdl *intfhdl, u32 addr)
u8 *tmpbuf;
tmpbuf = rtw_malloc(8);
- if (NULL == tmpbuf) {
+ if (!tmpbuf) {
DBG_8192C(KERN_ERR "%s: Allocate memory FAIL!(size =8) addr = 0x%x\n", __func__, addr);
return SDIO_ERR_VAL32;
}
@@ -264,7 +264,7 @@ static s32 sdio_readN(struct intf_hdl *intfhdl, u32 addr, u32 cnt, u8 *buf)
ftaddr &= ~(u16)0x3;
n = cnt + shift;
tmpbuf = rtw_malloc(n);
- if (NULL == tmpbuf)
+ if (!tmpbuf)
return -1;
err = sd_read(intfhdl, ftaddr, n, tmpbuf);
@@ -367,7 +367,7 @@ static s32 sdio_writeN(struct intf_hdl *intfhdl, u32 addr, u32 cnt, u8 *buf)
ftaddr &= ~(u16)0x3;
n = cnt + shift;
tmpbuf = rtw_malloc(n);
- if (NULL == tmpbuf)
+ if (!tmpbuf)
return -1;
err = sd_read(intfhdl, ftaddr, 4, tmpbuf);
if (err) {
@@ -730,7 +730,7 @@ static s32 ReadInterrupt8723BSdio(struct adapter *adapter, u32 *phisr)
u8 val8, hisr_len;
- if (phisr == NULL)
+ if (!phisr)
return false;
himr = GET_HAL_DATA(adapter)->sdio_himr;
@@ -954,13 +954,13 @@ static struct recv_buf *sd_recv_rxfifo(struct adapter *adapter, u32 size)
/* 3 1. alloc recvbuf */
recv_priv = &adapter->recvpriv;
recvbuf = rtw_dequeue_recvbuf(&recv_priv->free_recv_buf_queue);
- if (recvbuf == NULL) {
+ if (!recvbuf) {
DBG_871X_LEVEL(_drv_err_, "%s: alloc recvbuf FAIL!\n", __func__);
return NULL;
}
/* 3 2. alloc skb */
- if (recvbuf->pskb == NULL) {
+ if (!recvbuf->pskb) {
SIZE_PTR tmpaddr = 0;
SIZE_PTR alignment = 0;
@@ -974,7 +974,7 @@ static struct recv_buf *sd_recv_rxfifo(struct adapter *adapter, u32 size)
skb_reserve(recvbuf->pskb, (RECVBUFF_ALIGN_SZ - alignment));
}
- if (recvbuf->pskb == NULL) {
+ if (!recvbuf->pskb) {
DBG_871X("%s: alloc_skb fail! read =%d\n", __func__, readsize);
return NULL;
}
@@ -1232,7 +1232,7 @@ u8 RecvOnePkt(struct adapter *adapter, u32 size)
DBG_871X("+%s: size: %d+\n", __func__, size);
- if (adapter == NULL) {
+ if (!adapter) {
DBG_871X(KERN_ERR "%s: adapter is NULL!\n", __func__);
return false;
}
--
2.7.4
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
prev parent reply other threads:[~2018-01-24 0:13 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-24 0:06 [PATCH v4 0/4] Remove checkpatch warnings Shreeya Patel
2018-01-24 0:08 ` [PATCH v4 1/4] Staging: rtl8723bs: Replace true with x and false with !x Shreeya Patel
2018-01-24 0:09 ` [PATCH v4 2/4] Staging: rtl8723bs: Change names to conform to the kernel code Shreeya Patel
2018-01-24 0:11 ` [PATCH v4 3/4] Staging: rtl8723bs: Remove dead code Shreeya Patel
2018-01-24 0:13 ` Shreeya Patel [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=99315a25b008ec1e53bd98dd3230143f9d5e9b04.1516751432.git.shreeya.patel23498@gmail.com \
--to=shreeya.patel23498@gmail.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).