staging: rtl8192u: clean up comparsions to NULL
Clean up comparsions to NULL reported by checkpatch. if (x == NULL) -> if (!x) if (x != NULL) -> if (x) Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20200919150823.16923-3-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
e7a9c7b516
commit
d6628e8cbe
@ -250,7 +250,7 @@ static int rtl8180_wx_get_range(struct net_device *dev,
|
|||||||
/* range->old_num_channels; */
|
/* range->old_num_channels; */
|
||||||
/* range->old_num_frequency; */
|
/* range->old_num_frequency; */
|
||||||
/* range->old_freq[6]; */ /* Filler to keep "version" at the same offset */
|
/* range->old_freq[6]; */ /* Filler to keep "version" at the same offset */
|
||||||
if (priv->rf_set_sens != NULL)
|
if (priv->rf_set_sens)
|
||||||
range->sensitivity = priv->max_sens; /* signal level threshold range */
|
range->sensitivity = priv->max_sens; /* signal level threshold range */
|
||||||
|
|
||||||
range->max_qual.qual = 100;
|
range->max_qual.qual = 100;
|
||||||
@ -666,7 +666,7 @@ static int r8192_wx_get_sens(struct net_device *dev,
|
|||||||
{
|
{
|
||||||
struct r8192_priv *priv = ieee80211_priv(dev);
|
struct r8192_priv *priv = ieee80211_priv(dev);
|
||||||
|
|
||||||
if (priv->rf_set_sens == NULL)
|
if (!priv->rf_set_sens)
|
||||||
return -1; /* we have not this support for this radio */
|
return -1; /* we have not this support for this radio */
|
||||||
wrqu->sens.value = priv->sens;
|
wrqu->sens.value = priv->sens;
|
||||||
return 0;
|
return 0;
|
||||||
@ -680,7 +680,7 @@ static int r8192_wx_set_sens(struct net_device *dev,
|
|||||||
short err = 0;
|
short err = 0;
|
||||||
|
|
||||||
mutex_lock(&priv->wx_mutex);
|
mutex_lock(&priv->wx_mutex);
|
||||||
if (priv->rf_set_sens == NULL) {
|
if (!priv->rf_set_sens) {
|
||||||
err = -1; /* we have not this support for this radio */
|
err = -1; /* we have not this support for this radio */
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
|
@ -430,7 +430,7 @@ static void cmpk_handle_tx_rate_history(struct net_device *dev, u8 *pmsg)
|
|||||||
|
|
||||||
ptxrate = (cmpk_tx_rahis_t *)pmsg;
|
ptxrate = (cmpk_tx_rahis_t *)pmsg;
|
||||||
|
|
||||||
if (ptxrate == NULL)
|
if (!ptxrate)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
for (i = 0; i < 16; i++) {
|
for (i = 0; i < 16; i++) {
|
||||||
@ -479,7 +479,7 @@ u32 cmpk_message_handle_rx(struct net_device *dev,
|
|||||||
/* 0. Check inpt arguments. It is a command queue message or
|
/* 0. Check inpt arguments. It is a command queue message or
|
||||||
* pointer is null.
|
* pointer is null.
|
||||||
*/
|
*/
|
||||||
if (pstats == NULL)
|
if (!pstats)
|
||||||
return 0; /* This is not a command packet. */
|
return 0; /* This is not a command packet. */
|
||||||
|
|
||||||
/* 1. Read received command packet message length from RFD. */
|
/* 1. Read received command packet message length from RFD. */
|
||||||
|
@ -1150,7 +1150,7 @@ static u8 rtl8192_phy_SetSwChnlCmdArray(struct sw_chnl_cmd *CmdTable, u32 CmdTab
|
|||||||
{
|
{
|
||||||
struct sw_chnl_cmd *pCmd;
|
struct sw_chnl_cmd *pCmd;
|
||||||
|
|
||||||
if (CmdTable == NULL) {
|
if (!CmdTable) {
|
||||||
RT_TRACE(COMP_ERR, "%s(): CmdTable cannot be NULL\n", __func__);
|
RT_TRACE(COMP_ERR, "%s(): CmdTable cannot be NULL\n", __func__);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user