mirror of https://gitee.com/openkylin/linux.git
staging: rtl8712: rtl8712_cmd.c: fixed comparison to null
This patch fixes multiple "comparison to NULL" checkpatch.pl issues: CHECK: Comparison to NULL could be written "!pcmd" + if (pcmd == NULL) Signed-off-by: Juliana Rodrigues <juliana.orod@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
4dadfb97b7
commit
7fcf92c0a4
|
@ -135,7 +135,7 @@ static u8 read_macreg_hdl(struct _adapter *padapter, u8 *pbuf)
|
|||
|
||||
/* invoke cmd->callback function */
|
||||
pcmd_callback = cmd_callback[pcmd->cmdcode].callback;
|
||||
if (pcmd_callback == NULL)
|
||||
if (!pcmd_callback)
|
||||
r8712_free_cmd_obj(pcmd);
|
||||
else
|
||||
pcmd_callback(padapter, pcmd);
|
||||
|
@ -149,7 +149,7 @@ static u8 write_macreg_hdl(struct _adapter *padapter, u8 *pbuf)
|
|||
|
||||
/* invoke cmd->callback function */
|
||||
pcmd_callback = cmd_callback[pcmd->cmdcode].callback;
|
||||
if (pcmd_callback == NULL)
|
||||
if (!pcmd_callback)
|
||||
r8712_free_cmd_obj(pcmd);
|
||||
else
|
||||
pcmd_callback(padapter, pcmd);
|
||||
|
@ -165,7 +165,7 @@ static u8 read_bbreg_hdl(struct _adapter *padapter, u8 *pbuf)
|
|||
if (pcmd->rsp && pcmd->rspsz > 0)
|
||||
memcpy(pcmd->rsp, (u8 *)&val, pcmd->rspsz);
|
||||
pcmd_callback = cmd_callback[pcmd->cmdcode].callback;
|
||||
if (pcmd_callback == NULL)
|
||||
if (!pcmd_callback)
|
||||
r8712_free_cmd_obj(pcmd);
|
||||
else
|
||||
pcmd_callback(padapter, pcmd);
|
||||
|
@ -178,7 +178,7 @@ static u8 write_bbreg_hdl(struct _adapter *padapter, u8 *pbuf)
|
|||
struct cmd_obj *pcmd = (struct cmd_obj *)pbuf;
|
||||
|
||||
pcmd_callback = cmd_callback[pcmd->cmdcode].callback;
|
||||
if (pcmd_callback == NULL)
|
||||
if (!pcmd_callback)
|
||||
r8712_free_cmd_obj(pcmd);
|
||||
else
|
||||
pcmd_callback(padapter, pcmd);
|
||||
|
@ -194,7 +194,7 @@ static u8 read_rfreg_hdl(struct _adapter *padapter, u8 *pbuf)
|
|||
if (pcmd->rsp && pcmd->rspsz > 0)
|
||||
memcpy(pcmd->rsp, (u8 *)&val, pcmd->rspsz);
|
||||
pcmd_callback = cmd_callback[pcmd->cmdcode].callback;
|
||||
if (pcmd_callback == NULL)
|
||||
if (!pcmd_callback)
|
||||
r8712_free_cmd_obj(pcmd);
|
||||
else
|
||||
pcmd_callback(padapter, pcmd);
|
||||
|
@ -207,7 +207,7 @@ static u8 write_rfreg_hdl(struct _adapter *padapter, u8 *pbuf)
|
|||
struct cmd_obj *pcmd = (struct cmd_obj *)pbuf;
|
||||
|
||||
pcmd_callback = cmd_callback[pcmd->cmdcode].callback;
|
||||
if (pcmd_callback == NULL)
|
||||
if (!pcmd_callback)
|
||||
r8712_free_cmd_obj(pcmd);
|
||||
else
|
||||
pcmd_callback(padapter, pcmd);
|
||||
|
@ -227,7 +227,7 @@ static struct cmd_obj *cmd_hdl_filter(struct _adapter *padapter,
|
|||
{
|
||||
struct cmd_obj *pcmd_r;
|
||||
|
||||
if (pcmd == NULL)
|
||||
if (!pcmd)
|
||||
return pcmd;
|
||||
pcmd_r = NULL;
|
||||
|
||||
|
@ -416,7 +416,7 @@ int r8712_cmd_thread(void *context)
|
|||
/* free all cmd_obj resources */
|
||||
do {
|
||||
pcmd = r8712_dequeue_cmd(&(pcmdpriv->cmd_queue));
|
||||
if (pcmd == NULL)
|
||||
if (!pcmd)
|
||||
break;
|
||||
r8712_free_cmd_obj(pcmd);
|
||||
} while (1);
|
||||
|
@ -431,7 +431,7 @@ void r8712_event_handle(struct _adapter *padapter, uint *peventbuf)
|
|||
void (*event_callback)(struct _adapter *dev, u8 *pbuf);
|
||||
struct evt_priv *pevt_priv = &(padapter->evtpriv);
|
||||
|
||||
if (peventbuf == NULL)
|
||||
if (!peventbuf)
|
||||
goto _abort_event_;
|
||||
evt_sz = (u16)(le32_to_cpu(*peventbuf) & 0xffff);
|
||||
evt_seq = (u8)((le32_to_cpu(*peventbuf) >> 24) & 0x7f);
|
||||
|
|
Loading…
Reference in New Issue