All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] iwlwifi: avoid warning by using result of iwl_send_cmd_pdu in iwl_sta_init_lq
@ 2010-04-08 19:48 John W. Linville
  2010-04-08 20:24 ` reinette chatre
  0 siblings, 1 reply; 3+ messages in thread
From: John W. Linville @ 2010-04-08 19:48 UTC (permalink / raw)
  To: linux-wireless; +Cc: reinette.chatre, John W. Linville

  CC [M]  drivers/net/wireless/iwlwifi/iwl-sta.o
drivers/net/wireless/iwlwifi/iwl-sta.c: In function ‘iwl_sta_init_lq’:
drivers/net/wireless/iwlwifi/iwl-sta.c:461: warning: ignoring return value of ‘iwl_send_cmd_pdu’, declared with attribute warn_unused_result

Signed-off-by: John W. Linville <linville@tuxdriver.com>
---
 drivers/net/wireless/iwlwifi/iwl-sta.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-sta.c b/drivers/net/wireless/iwlwifi/iwl-sta.c
index e34ac03..91aaf11 100644
--- a/drivers/net/wireless/iwlwifi/iwl-sta.c
+++ b/drivers/net/wireless/iwlwifi/iwl-sta.c
@@ -458,8 +458,9 @@ static void iwl_sta_init_lq(struct iwl_priv *priv, const u8 *addr, bool is_ap)
 	/* Update the rate scaling for control frame Tx to AP */
 	link_cmd.sta_id = is_ap ? IWL_AP_ID : priv->hw_params.bcast_sta_id;
 
-	iwl_send_cmd_pdu(priv, REPLY_TX_LINK_QUALITY_CMD,
-			       sizeof(link_cmd), &link_cmd);
+	if (!iwl_send_cmd_pdu(priv, REPLY_TX_LINK_QUALITY_CMD,
+			       sizeof(link_cmd), &link_cmd))
+		IWL_WARN(priv, "Tx link quality reply failed\n");
 }
 
 /*
-- 
1.6.2.5


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] iwlwifi: avoid warning by using result of iwl_send_cmd_pdu in iwl_sta_init_lq
  2010-04-08 19:48 [PATCH] iwlwifi: avoid warning by using result of iwl_send_cmd_pdu in iwl_sta_init_lq John W. Linville
@ 2010-04-08 20:24 ` reinette chatre
  2010-04-08 20:41   ` John W. Linville
  0 siblings, 1 reply; 3+ messages in thread
From: reinette chatre @ 2010-04-08 20:24 UTC (permalink / raw)
  To: John W. Linville; +Cc: linux-wireless

Hi John,

On Thu, 2010-04-08 at 12:48 -0700, John W. Linville wrote:
> CC [M]  drivers/net/wireless/iwlwifi/iwl-sta.o
> drivers/net/wireless/iwlwifi/iwl-sta.c: In function ‘iwl_sta_init_lq’:
> drivers/net/wireless/iwlwifi/iwl-sta.c:461: warning: ignoring return value of ‘iwl_send_cmd_pdu’, declared with attribute warn_unused_result
> 
> Signed-off-by: John W. Linville <linville@tuxdriver.com>
> ---
>  drivers/net/wireless/iwlwifi/iwl-sta.c |    5 +++--
>  1 files changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/wireless/iwlwifi/iwl-sta.c b/drivers/net/wireless/iwlwifi/iwl-sta.c
> index e34ac03..91aaf11 100644
> --- a/drivers/net/wireless/iwlwifi/iwl-sta.c
> +++ b/drivers/net/wireless/iwlwifi/iwl-sta.c
> @@ -458,8 +458,9 @@ static void iwl_sta_init_lq(struct iwl_priv *priv, const u8 *addr, bool is_ap)
>  	/* Update the rate scaling for control frame Tx to AP */
>  	link_cmd.sta_id = is_ap ? IWL_AP_ID : priv->hw_params.bcast_sta_id;
>  
> -	iwl_send_cmd_pdu(priv, REPLY_TX_LINK_QUALITY_CMD,
> -			       sizeof(link_cmd), &link_cmd);
> +	if (!iwl_send_cmd_pdu(priv, REPLY_TX_LINK_QUALITY_CMD,
> +			       sizeof(link_cmd), &link_cmd))
> +		IWL_WARN(priv, "Tx link quality reply failed\n");
>  }
>  
>  /*

I made a mistake here somewhere since this is fixed in iwlwifi-2.6 but
did not propagate to wireless-next-2.6.

Wouldn't the above print the warning on success though?

In iwlwifi-2.6 the code looks like (whitespace broken copy&pasted) ...
it would be nice to have the return code available in error message:

        ret = iwl_send_cmd_pdu(priv, REPLY_TX_LINK_QUALITY_CMD,
                               sizeof(link_cmd), &link_cmd);
        if (ret)
                IWL_ERR(priv, "REPLY_TX_LINK_QUALITY_CMD failed (%d)\n", ret);

If you want I can just fix my merging mistake.

Reinette



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] iwlwifi: avoid warning by using result of iwl_send_cmd_pdu in iwl_sta_init_lq
  2010-04-08 20:24 ` reinette chatre
@ 2010-04-08 20:41   ` John W. Linville
  0 siblings, 0 replies; 3+ messages in thread
From: John W. Linville @ 2010-04-08 20:41 UTC (permalink / raw)
  To: reinette chatre; +Cc: linux-wireless

On Thu, Apr 08, 2010 at 01:24:33PM -0700, reinette chatre wrote:
> Hi John,
> 
> On Thu, 2010-04-08 at 12:48 -0700, John W. Linville wrote:
> > CC [M]  drivers/net/wireless/iwlwifi/iwl-sta.o
> > drivers/net/wireless/iwlwifi/iwl-sta.c: In function ‘iwl_sta_init_lq’:
> > drivers/net/wireless/iwlwifi/iwl-sta.c:461: warning: ignoring return value of ‘iwl_send_cmd_pdu’, declared with attribute warn_unused_result
> > 
> > Signed-off-by: John W. Linville <linville@tuxdriver.com>
> > ---
> >  drivers/net/wireless/iwlwifi/iwl-sta.c |    5 +++--
> >  1 files changed, 3 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/net/wireless/iwlwifi/iwl-sta.c b/drivers/net/wireless/iwlwifi/iwl-sta.c
> > index e34ac03..91aaf11 100644
> > --- a/drivers/net/wireless/iwlwifi/iwl-sta.c
> > +++ b/drivers/net/wireless/iwlwifi/iwl-sta.c
> > @@ -458,8 +458,9 @@ static void iwl_sta_init_lq(struct iwl_priv *priv, const u8 *addr, bool is_ap)
> >  	/* Update the rate scaling for control frame Tx to AP */
> >  	link_cmd.sta_id = is_ap ? IWL_AP_ID : priv->hw_params.bcast_sta_id;
> >  
> > -	iwl_send_cmd_pdu(priv, REPLY_TX_LINK_QUALITY_CMD,
> > -			       sizeof(link_cmd), &link_cmd);
> > +	if (!iwl_send_cmd_pdu(priv, REPLY_TX_LINK_QUALITY_CMD,
> > +			       sizeof(link_cmd), &link_cmd))
> > +		IWL_WARN(priv, "Tx link quality reply failed\n");
> >  }
> >  
> >  /*
> 
> I made a mistake here somewhere since this is fixed in iwlwifi-2.6 but
> did not propagate to wireless-next-2.6.
> 
> Wouldn't the above print the warning on success though?

Ha, yes...

> In iwlwifi-2.6 the code looks like (whitespace broken copy&pasted) ...
> it would be nice to have the return code available in error message:
> 
>         ret = iwl_send_cmd_pdu(priv, REPLY_TX_LINK_QUALITY_CMD,
>                                sizeof(link_cmd), &link_cmd);
>         if (ret)
>                 IWL_ERR(priv, "REPLY_TX_LINK_QUALITY_CMD failed (%d)\n", ret);
> 
> If you want I can just fix my merging mistake.

Works for me!

John
-- 
John W. Linville		Someday the world will need a hero, and you
linville@tuxdriver.com			might be all we have.  Be ready.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-04-08 20:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-08 19:48 [PATCH] iwlwifi: avoid warning by using result of iwl_send_cmd_pdu in iwl_sta_init_lq John W. Linville
2010-04-08 20:24 ` reinette chatre
2010-04-08 20:41   ` John W. Linville

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.