From: kernel test robot <lkp@intel.com>
To: Prathamesh Shete <pshete@nvidia.com>
Cc: oe-kbuild-all@lists.linux.dev, linux-gpio@vger.kernel.org,
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Subject: [brgl:gpio/for-current 1/1] drivers/gpio/gpio-tegra186.c:189:14: warning: 'or' of unmatched not-equal tests is always 1
Date: Mon, 22 Apr 2024 23:49:13 +0800 [thread overview]
Message-ID: <202404222357.2CCvEJdY-lkp@intel.com> (raw)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux.git gpio/for-current
head: 62326f7cefc21b4a7e8a1b413bf1e8bc07df1115
commit: 62326f7cefc21b4a7e8a1b413bf1e8bc07df1115 [1/1] gpio: tegra186: Fix tegra186_gpio_is_accessible() check
config: arm64-defconfig (https://download.01.org/0day-ci/archive/20240422/202404222357.2CCvEJdY-lkp@intel.com/config)
compiler: aarch64-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240422/202404222357.2CCvEJdY-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202404222357.2CCvEJdY-lkp@intel.com/
All warnings (new ones prefixed by >>):
drivers/gpio/gpio-tegra186.c: In function 'tegra186_gpio_is_accessible':
>> drivers/gpio/gpio-tegra186.c:189:14: warning: 'or' of unmatched not-equal tests is always 1
189 | (value & TEGRA186_GPIO_WRITE_ACCESS)))
| ^
>> drivers/gpio/gpio-tegra186.c:189:14: warning: 'or' of unmatched not-equal tests is always 1
vim +/or +189 drivers/gpio/gpio-tegra186.c
162
163 static inline bool tegra186_gpio_is_accessible(struct tegra_gpio *gpio, unsigned int pin)
164 {
165 void __iomem *secure;
166 u32 value;
167
168 secure = tegra186_gpio_get_secure_base(gpio, pin);
169
170 if (gpio->soc->has_vm_support) {
171 value = readl(secure + TEGRA186_GPIO_VM);
172 if ((value & TEGRA186_GPIO_VM_RW_MASK) != TEGRA186_GPIO_VM_RW_MASK)
173 return false;
174 }
175
176 value = __raw_readl(secure + TEGRA186_GPIO_SCR);
177
178 /*
179 * When SCR_SEC_[R|W]EN is unset, then we have full read/write access to all the
180 * registers for given GPIO pin.
181 * When SCR_SEC[R|W]EN is set, then there is need to further check the accompanying
182 * SCR_SEC_G1[R|W] bit to determine read/write access to all the registers for given
183 * GPIO pin.
184 */
185
186 if (((value & TEGRA186_GPIO_SCR_SEC_REN) == 0 ||
187 (value & TEGRA186_GPIO_READ_ACCESS)) &&
188 ((value & TEGRA186_GPIO_SCR_SEC_WEN) == 0 ||
> 189 (value & TEGRA186_GPIO_WRITE_ACCESS)))
190 return true;
191
192 return false;
193 }
194
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
reply other threads:[~2024-04-22 15:49 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=202404222357.2CCvEJdY-lkp@intel.com \
--to=lkp@intel.com \
--cc=bartosz.golaszewski@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=pshete@nvidia.com \
/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 read-only IMAP folder(s) and NNTP newsgroup(s).