diff mbox series

ath10k: remove an unnecessary NULL check

Message ID 20181129103214.5tudci6izlfaasqx@kili.mountain (mailing list archive)
State New, archived
Headers show
Series ath10k: remove an unnecessary NULL check | expand

Commit Message

Dan Carpenter Nov. 29, 2018, 10:32 a.m. UTC
The "survey" pointer is the address of an array element.  We know that
it can't be NULL so this check can be removed.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 drivers/net/wireless/ath/ath10k/wmi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Kalle Valo Nov. 29, 2018, 1:51 p.m. UTC | #1
Dan Carpenter <dan.carpenter@oracle.com> writes:

> The "survey" pointer is the address of an array element.  We know that
> it can't be NULL so this check can be removed.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
>  drivers/net/wireless/ath/ath10k/wmi.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c
> index 659513bf4ddc..6a04727b63ce 100644
> --- a/drivers/net/wireless/ath/ath10k/wmi.c
> +++ b/drivers/net/wireless/ath/ath10k/wmi.c
> @@ -2578,7 +2578,7 @@ static void ath10k_wmi_event_chan_info_unpaired(struct ath10k *ar,
>  
>  	survey = &ar->survey[idx];
>  
> -	if (!params->mac_clk_mhz || !survey)
> +	if (!params->mac_clk_mhz)
>  		return;

Can you please CC linux-wireless so that patchwork sees this?
Dan Carpenter Nov. 29, 2018, 2:21 p.m. UTC | #2
On Thu, Nov 29, 2018 at 03:51:24PM +0200, Kalle Valo wrote:
> Dan Carpenter <dan.carpenter@oracle.com> writes:
> 
> > The "survey" pointer is the address of an array element.  We know that
> > it can't be NULL so this check can be removed.
> >
> > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> > ---
> >  drivers/net/wireless/ath/ath10k/wmi.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c
> > index 659513bf4ddc..6a04727b63ce 100644
> > --- a/drivers/net/wireless/ath/ath10k/wmi.c
> > +++ b/drivers/net/wireless/ath/ath10k/wmi.c
> > @@ -2578,7 +2578,7 @@ static void ath10k_wmi_event_chan_info_unpaired(struct ath10k *ar,
> >  
> >  	survey = &ar->survey[idx];
> >  
> > -	if (!params->mac_clk_mhz || !survey)
> > +	if (!params->mac_clk_mhz)
> >  		return;
> 
> Can you please CC linux-wireless so that patchwork sees this?
> 

Sure.  I can resend.

regards,
dan carpenter
diff mbox series

Patch

diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c
index 659513bf4ddc..6a04727b63ce 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.c
+++ b/drivers/net/wireless/ath/ath10k/wmi.c
@@ -2578,7 +2578,7 @@  static void ath10k_wmi_event_chan_info_unpaired(struct ath10k *ar,
 
 	survey = &ar->survey[idx];
 
-	if (!params->mac_clk_mhz || !survey)
+	if (!params->mac_clk_mhz)
 		return;
 
 	memset(survey, 0, sizeof(*survey));