ath10k.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Carl Huang <cjhuang@codeaurora.org>
Cc: Abhishek Kumar <kuabhs@chromium.org>,
	kbuild-all@lists.01.org, Brian Norris <briannorris@chromium.org>,
	ath10k@lists.infradead.org, clang-built-linux@googlegroups.com,
	Kalle Valo <kvalo@codeaurora.org>
Subject: [ath6kl:pending 8/14] drivers/net/wireless/ath/ath10k/mac.c:3010:39: warning: address of array 'sar->sub_specs' will always evaluate to 'true'
Date: Tue, 9 Feb 2021 14:57:05 +0800	[thread overview]
Message-ID: <202102091459.2Zh9kk1e-lkp@intel.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 5847 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git pending
head:   5c94a82422585f88765f58e0f8b4b84c1fabbb31
commit: b98c50fdd3bfa201487ef7fe3b9b41d76c7802d2 [8/14] ath10k: allow dynamic SAR power limits via common API
config: x86_64-randconfig-a011-20210209 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project c9439ca36342fb6013187d0a69aef92736951476)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install x86_64 cross compiling tool for clang build
        # apt-get install binutils-x86-64-linux-gnu
        # https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git/commit/?id=b98c50fdd3bfa201487ef7fe3b9b41d76c7802d2
        git remote add ath6kl https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git
        git fetch --no-tags ath6kl pending
        git checkout b98c50fdd3bfa201487ef7fe3b9b41d76c7802d2
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

>> drivers/net/wireless/ath/ath10k/mac.c:3010:39: warning: address of array 'sar->sub_specs' will always evaluate to 'true' [-Wpointer-bool-conversion]
               sar->num_sub_specs == 0 || !sar->sub_specs) {
                                          ~~~~~~^~~~~~~~~
   drivers/net/wireless/ath/ath10k/mac.c:8635:7: warning: format specifies type 'unsigned short' but the argument has type 'u32' (aka 'unsigned int') [-Wformat]
                              vifs[i].old_ctx->def.chan->center_freq,
                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/net/wireless/ath/ath10k/debug.h:285:37: note: expanded from macro 'ath10k_dbg'
                   __ath10k_dbg(ar, dbg_mask, fmt, ##__VA_ARGS__); \
                                              ~~~    ^~~~~~~~~~~
   drivers/net/wireless/ath/ath10k/mac.c:8636:7: warning: format specifies type 'unsigned short' but the argument has type 'u32' (aka 'unsigned int') [-Wformat]
                              vifs[i].new_ctx->def.chan->center_freq,
                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/net/wireless/ath/ath10k/debug.h:285:37: note: expanded from macro 'ath10k_dbg'
                   __ath10k_dbg(ar, dbg_mask, fmt, ##__VA_ARGS__); \
                                              ~~~    ^~~~~~~~~~~
   drivers/net/wireless/ath/ath10k/mac.c:8708:6: warning: format specifies type 'unsigned short' but the argument has type 'u32' (aka 'unsigned int') [-Wformat]
                      ctx->def.chan->center_freq, ctx->def.width, ctx);
                      ^~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/net/wireless/ath/ath10k/debug.h:285:37: note: expanded from macro 'ath10k_dbg'
                   __ath10k_dbg(ar, dbg_mask, fmt, ##__VA_ARGS__); \
                                              ~~~    ^~~~~~~~~~~
   drivers/net/wireless/ath/ath10k/mac.c:8732:6: warning: format specifies type 'unsigned short' but the argument has type 'u32' (aka 'unsigned int') [-Wformat]
                      ctx->def.chan->center_freq, ctx->def.width, ctx);
                      ^~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/net/wireless/ath/ath10k/debug.h:285:37: note: expanded from macro 'ath10k_dbg'
                   __ath10k_dbg(ar, dbg_mask, fmt, ##__VA_ARGS__); \
                                              ~~~    ^~~~~~~~~~~
   drivers/net/wireless/ath/ath10k/mac.c:8797:6: warning: format specifies type 'unsigned short' but the argument has type 'u32' (aka 'unsigned int') [-Wformat]
                      ctx->def.chan->center_freq, ctx->def.width, ctx, changed);
                      ^~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/net/wireless/ath/ath10k/debug.h:285:37: note: expanded from macro 'ath10k_dbg'
                   __ath10k_dbg(ar, dbg_mask, fmt, ##__VA_ARGS__); \
                                              ~~~    ^~~~~~~~~~~
   6 warnings generated.


vim +3010 drivers/net/wireless/ath/ath10k/mac.c

  2993	
  2994	static int ath10k_mac_set_sar_specs(struct ieee80211_hw *hw,
  2995					    const struct cfg80211_sar_specs *sar)
  2996	{
  2997		const struct cfg80211_sar_sub_specs *sub_specs;
  2998		struct ath10k *ar = hw->priv;
  2999		u32 i;
  3000		int ret;
  3001	
  3002		mutex_lock(&ar->conf_mutex);
  3003	
  3004		if (!ar->hw_params.dynamic_sar_support) {
  3005			ret = -EOPNOTSUPP;
  3006			goto err;
  3007		}
  3008	
  3009		if (!sar || sar->type != NL80211_SAR_TYPE_POWER ||
> 3010		    sar->num_sub_specs == 0 || !sar->sub_specs) {
  3011			ret = -EINVAL;
  3012			goto err;
  3013		}
  3014	
  3015		sub_specs = sar->sub_specs;
  3016	
  3017		/* 0dbm is not a practical value for ath10k, so use 0
  3018		 * as no SAR limitation on it.
  3019		 */
  3020		ar->tx_power_2g_limit = 0;
  3021		ar->tx_power_5g_limit = 0;
  3022	
  3023		/* note the power is in 0.25dbm unit, while ath10k uses
  3024		 * 0.5dbm unit.
  3025		 */
  3026		for (i = 0; i < sar->num_sub_specs; i++) {
  3027			if (sub_specs->freq_range_index == 0)
  3028				ar->tx_power_2g_limit = sub_specs->power / 2;
  3029			else if (sub_specs->freq_range_index == 1)
  3030				ar->tx_power_5g_limit = sub_specs->power / 2;
  3031	
  3032			sub_specs++;
  3033		}
  3034	
  3035		ret = ath10k_mac_set_sar_power(ar);
  3036		if (ret) {
  3037			ath10k_warn(ar, "failed to set sar power: %d", ret);
  3038			goto err;
  3039		}
  3040	
  3041	err:
  3042		mutex_unlock(&ar->conf_mutex);
  3043		return ret;
  3044	}
  3045	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 42415 bytes --]

[-- Attachment #3: Type: text/plain, Size: 146 bytes --]

_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k

                 reply	other threads:[~2021-02-09  6:58 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=202102091459.2Zh9kk1e-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=ath10k@lists.infradead.org \
    --cc=briannorris@chromium.org \
    --cc=cjhuang@codeaurora.org \
    --cc=clang-built-linux@googlegroups.com \
    --cc=kbuild-all@lists.01.org \
    --cc=kuabhs@chromium.org \
    --cc=kvalo@codeaurora.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;
as well as URLs for NNTP newsgroup(s).