* [PATCH]: staging: wlan-ng: Remove unnecessary NULL check before returning error.
@ 2016-02-20 4:49 Sandhya
2016-02-20 13:31 ` [Outreachy kernel] " Julia Lawall
0 siblings, 1 reply; 2+ messages in thread
From: Sandhya @ 2016-02-20 4:49 UTC (permalink / raw)
To: outreachy-kernel
Remove unnecessary NULL check before returning error.
Signed-off-by: Sandhya <bankarsandhya512@gmail.com>
---
drivers/staging/wlan-ng/cfg80211.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/wlan-ng/cfg80211.c b/drivers/staging/wlan-ng/cfg80211.c
index 8c1e3f0..c59dd33 100644
--- a/drivers/staging/wlan-ng/cfg80211.c
+++ b/drivers/staging/wlan-ng/cfg80211.c
@@ -303,7 +303,7 @@ static int prism2_get_station(struct wiphy *wiphy, struct net_device *dev,
memset(sinfo, 0, sizeof(*sinfo));
- if ((wlandev == NULL) || (wlandev->msdstate != WLAN_MSD_RUNNING))
+ if (!wlandev || (wlandev->msdstate != WLAN_MSD_RUNNING))
return -EOPNOTSUPP;
/* build request message */
@@ -312,7 +312,7 @@ static int prism2_get_station(struct wiphy *wiphy, struct net_device *dev,
quality.dbm.status = P80211ENUM_msgitem_status_data_ok;
/* send message to nsd */
- if (wlandev->mlmerequest == NULL)
+ if (!wlandev->mlmerequest)
return -EOPNOTSUPP;
result = wlandev->mlmerequest(wlandev, (struct p80211msg *) &quality);
--
1.8.3.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Outreachy kernel] [PATCH]: staging: wlan-ng: Remove unnecessary NULL check before returning error.
2016-02-20 4:49 [PATCH]: staging: wlan-ng: Remove unnecessary NULL check before returning error Sandhya
@ 2016-02-20 13:31 ` Julia Lawall
0 siblings, 0 replies; 2+ messages in thread
From: Julia Lawall @ 2016-02-20 13:31 UTC (permalink / raw)
To: Sandhya; +Cc: outreachy-kernel
On Sat, 20 Feb 2016, Sandhya wrote:
> Remove unnecessary NULL check before returning error.
The commit message is very misleading. You are not removing the check,
you are writing it in a different way. The fact that an error is returned
is also not relevant to what you are doing.
julia
>
> Signed-off-by: Sandhya <bankarsandhya512@gmail.com>
> ---
> drivers/staging/wlan-ng/cfg80211.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/staging/wlan-ng/cfg80211.c b/drivers/staging/wlan-ng/cfg80211.c
> index 8c1e3f0..c59dd33 100644
> --- a/drivers/staging/wlan-ng/cfg80211.c
> +++ b/drivers/staging/wlan-ng/cfg80211.c
> @@ -303,7 +303,7 @@ static int prism2_get_station(struct wiphy *wiphy, struct net_device *dev,
>
> memset(sinfo, 0, sizeof(*sinfo));
>
> - if ((wlandev == NULL) || (wlandev->msdstate != WLAN_MSD_RUNNING))
> + if (!wlandev || (wlandev->msdstate != WLAN_MSD_RUNNING))
> return -EOPNOTSUPP;
>
> /* build request message */
> @@ -312,7 +312,7 @@ static int prism2_get_station(struct wiphy *wiphy, struct net_device *dev,
> quality.dbm.status = P80211ENUM_msgitem_status_data_ok;
>
> /* send message to nsd */
> - if (wlandev->mlmerequest == NULL)
> + if (!wlandev->mlmerequest)
> return -EOPNOTSUPP;
>
> result = wlandev->mlmerequest(wlandev, (struct p80211msg *) &quality);
> --
> 1.8.3.4
>
> --
> You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20160220044933.GA10427%40sandhya.
> For more options, visit https://groups.google.com/d/optout.
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-02-20 13:31 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-20 4:49 [PATCH]: staging: wlan-ng: Remove unnecessary NULL check before returning error Sandhya
2016-02-20 13:31 ` [Outreachy kernel] " Julia Lawall
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.