Re: [PATCH 2/2] reset: canaan: Add reset driver for Kendryte K230

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

 



Hi Junhui,

kernel test robot noticed the following build warnings:

[auto build test WARNING on abf2050f51fdca0fd146388f83cddd95a57a008d]

url:    https://github.com/intel-lab-lkp/linux/commits/Junhui-Liu/dt-bindings-reset-Add-support-for-canaan-k230-rst/20240924-140732
base:   abf2050f51fdca0fd146388f83cddd95a57a008d
patch link:    https://lore.kernel.org/r/20240924-k230-reset-v1-2-d0cdc11989eb%40outlook.com
patch subject: [PATCH 2/2] reset: canaan: Add reset driver for Kendryte K230
config: hexagon-allmodconfig (https://download.01.org/0day-ci/archive/20240925/202409250201.ZlZsYfH8-lkp@xxxxxxxxx/config)
compiler: clang version 20.0.0git (https://github.com/llvm/llvm-project 8663a75fa2f31299ab8d1d90288d9df92aadee88)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240925/202409250201.ZlZsYfH8-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/202409250201.ZlZsYfH8-lkp@xxxxxxxxx/

All warnings (new ones prefixed by >>):

   In file included from drivers/reset/reset-k230.c:8:
   In file included from include/linux/io.h:14:
   In file included from arch/hexagon/include/asm/io.h:328:
   include/asm-generic/io.h:548:31: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     548 |         val = __raw_readb(PCI_IOBASE + addr);
         |                           ~~~~~~~~~~ ^
   include/asm-generic/io.h:561:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     561 |         val = __le16_to_cpu((__le16 __force)__raw_readw(PCI_IOBASE + addr));
         |                                                         ~~~~~~~~~~ ^
   include/uapi/linux/byteorder/little_endian.h:37:51: note: expanded from macro '__le16_to_cpu'
      37 | #define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
         |                                                   ^
   In file included from drivers/reset/reset-k230.c:8:
   In file included from include/linux/io.h:14:
   In file included from arch/hexagon/include/asm/io.h:328:
   include/asm-generic/io.h:574:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     574 |         val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr));
         |                                                         ~~~~~~~~~~ ^
   include/uapi/linux/byteorder/little_endian.h:35:51: note: expanded from macro '__le32_to_cpu'
      35 | #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
         |                                                   ^
   In file included from drivers/reset/reset-k230.c:8:
   In file included from include/linux/io.h:14:
   In file included from arch/hexagon/include/asm/io.h:328:
   include/asm-generic/io.h:585:33: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     585 |         __raw_writeb(value, PCI_IOBASE + addr);
         |                             ~~~~~~~~~~ ^
   include/asm-generic/io.h:595:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     595 |         __raw_writew((u16 __force)cpu_to_le16(value), PCI_IOBASE + addr);
         |                                                       ~~~~~~~~~~ ^
   include/asm-generic/io.h:605:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     605 |         __raw_writel((u32 __force)cpu_to_le32(value), PCI_IOBASE + addr);
         |                                                       ~~~~~~~~~~ ^
>> drivers/reset/reset-k230.c:223:7: warning: variable 'ret' is used uninitialized whenever switch case is taken [-Wsometimes-uninitialized]
     223 |         case RST_TYPE_SW_DONE:
         |              ^~~~~~~~~~~~~~~~
   drivers/reset/reset-k230.c:231:9: note: uninitialized use occurs here
     231 |         return ret;
         |                ^~~
   drivers/reset/reset-k230.c:214:7: warning: variable 'ret' is used uninitialized whenever switch case is taken [-Wsometimes-uninitialized]
     214 |         case RST_TYPE_CPU1:
         |              ^~~~~~~~~~~~~
   drivers/reset/reset-k230.c:231:9: note: uninitialized use occurs here
     231 |         return ret;
         |                ^~~
   drivers/reset/reset-k230.c:215:7: warning: variable 'ret' is used uninitialized whenever switch case is taken [-Wsometimes-uninitialized]
     215 |         case RST_TYPE_FLUSH:
         |              ^~~~~~~~~~~~~~
   drivers/reset/reset-k230.c:231:9: note: uninitialized use occurs here
     231 |         return ret;
         |                ^~~
   drivers/reset/reset-k230.c:206:9: note: initialize the variable 'ret' to silence this warning
     206 |         int ret;
         |                ^
         |                 = 0
   drivers/reset/reset-k230.c:250:7: warning: variable 'ret' is used uninitialized whenever switch case is taken [-Wsometimes-uninitialized]
     250 |         case RST_TYPE_SW_DONE:
         |              ^~~~~~~~~~~~~~~~
   drivers/reset/reset-k230.c:258:9: note: uninitialized use occurs here
     258 |         return ret;
         |                ^~~
   drivers/reset/reset-k230.c:247:7: warning: variable 'ret' is used uninitialized whenever switch case is taken [-Wsometimes-uninitialized]
     247 |         case RST_TYPE_FLUSH:
         |              ^~~~~~~~~~~~~~
   drivers/reset/reset-k230.c:258:9: note: uninitialized use occurs here
     258 |         return ret;
         |                ^~~
   drivers/reset/reset-k230.c:248:7: warning: variable 'ret' is used uninitialized whenever switch case is taken [-Wsometimes-uninitialized]
     248 |         case RST_TYPE_HW_DONE:
         |              ^~~~~~~~~~~~~~~~
   drivers/reset/reset-k230.c:258:9: note: uninitialized use occurs here
     258 |         return ret;
         |                ^~~
   drivers/reset/reset-k230.c:241:7: warning: variable 'ret' is used uninitialized whenever switch case is taken [-Wsometimes-uninitialized]
     241 |         case RST_TYPE_CPU0:
         |              ^~~~~~~~~~~~~
   drivers/reset/reset-k230.c:258:9: note: uninitialized use occurs here
     258 |         return ret;
         |                ^~~
   drivers/reset/reset-k230.c:238:9: note: initialize the variable 'ret' to silence this warning
     238 |         int ret;
         |                ^
         |                 = 0
   13 warnings generated.

Kconfig warnings: (for reference only)
   WARNING: unmet direct dependencies detected for GET_FREE_REGION
   Depends on [n]: SPARSEMEM [=n]
   Selected by [m]:
   - RESOURCE_KUNIT_TEST [=m] && RUNTIME_TESTING_MENU [=y] && KUNIT [=m]


vim +/ret +223 drivers/reset/reset-k230.c

   201	
   202	static int k230_rst_assert(struct reset_controller_dev *rcdev, unsigned long id)
   203	{
   204		struct k230_rst *rstc = to_k230_rst(rcdev);
   205		const struct k230_rst_map *rmap = &k230_resets[id];
   206		int ret;
   207	
   208		switch (rmap->type) {
   209		case RST_TYPE_CPU0:
   210			k230_rst_clear_done(rstc, id, true);
   211			k230_rst_update(rstc, id, true, true, false);
   212			ret = k230_rst_wait_and_clear_done(rstc, id, true);
   213			break;
   214		case RST_TYPE_CPU1:
   215		case RST_TYPE_FLUSH:
   216			k230_rst_update(rstc, id, true, true, false);
   217			break;
   218		case RST_TYPE_HW_DONE:
   219			k230_rst_clear_done(rstc, id, false);
   220			k230_rst_update(rstc, id, true, false, false);
   221			ret = k230_rst_wait_and_clear_done(rstc, id, false);
   222			break;
 > 223		case RST_TYPE_SW_DONE:
   224			k230_rst_update(rstc, id, true, false,
   225					id == RST_SPI2AXI ? false : true);
   226			break;
   227		default:
   228			return -EINVAL;
   229		}
   230	
   231		return ret;
   232	}
   233	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki




[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux