Historical ath9k-devel archives
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: ath9k-devel@lists.ath9k.org
Subject: [ath9k-devel] ath9k_htc: Support for AR9271 chipset.
Date: Wed, 12 Aug 2015 00:43:24 +0300	[thread overview]
Message-ID: <20150811214324.GA30816@mwanda> (raw)

Hello Sujith,

The patch fb9987d0f748: "ath9k_htc: Support for AR9271 chipset." from
Mar 17, 2010, leads to the following static checker warning:

	drivers/net/wireless/ath/ath9k/htc_drv_main.c:850 ath9k_htc_ani_work()
	warn: 'common->ani.caldone' can be either negative or positive

drivers/net/wireless/ath/ath9k/htc_drv_main.c
   830                  /* Perform calibration if necessary */
   831                  if (longcal || shortcal)
   832                          common->ani.caldone =
   833                                  ath9k_hw_calibrate(ah, ah->curchan,
   834                                                     ah->rxchainmask, longcal);

ath9k_hw_calibrate() returns true/false/-ETIMEOUT.


   835  
   836                  ath9k_htc_ps_restore(priv);
   837          }
   838  
   839  set_timer:
   840          /*
   841          * Set timer interval based on previous results.
   842          * The interval must be the shortest necessary to satisfy ANI,
   843          * short calibration and long calibration.
   844          */
   845          cal_interval = ATH_LONG_CALINTERVAL;
   846          cal_interval = min(cal_interval, (u32)ATH_ANI_POLLINTERVAL);
   847          if (!common->ani.caldone)

But we don't test for negative here.

   848                  cal_interval = min(cal_interval, (u32)short_cal_interval);
   849  
   850          ieee80211_queue_delayed_work(common->hw, &priv->ani_work,
   851                                       msecs_to_jiffies(cal_interval));
   852  }

regards,
dan carpenter

             reply	other threads:[~2015-08-11 21:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-11 21:43 Dan Carpenter [this message]
2015-08-13 18:21 ` [ath9k-devel] [PATCH] ath9k_htc: do ani shortcalibratio if we got -ETIMEDOUT Oleksij Rempel
2015-08-14  5:10   ` Oleksij Rempel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150811214324.GA30816@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=ath9k-devel@lists.ath9k.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox