[brgl:gpio/for-current 1/1] drivers/gpio/gpio-tegra186.c:189:14: warning: 'or' of unmatched not-equal tests is always 1

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx/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@xxxxxxxxx/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@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202404222357.2CCvEJdY-lkp@xxxxxxxxx/

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




[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux