All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: "larry.lai" <larry.lai@yunjingtech.com>,
	lee@kernel.org, andriy.shevchenko@linux.intel.com,
	linus.walleij@linaro.org, pavel@ucw.cz, krzk@kernel.org
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
	linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org,
	linux-leds@vger.kernel.org, GaryWang@aaeon.com.tw,
	musa.lin@yunjingtech.com, jack.chang@yunjingtech.com,
	noah.hung@yunjingtech.com,
	"larry.lai" <larry.lai@yunjingtech.com>
Subject: Re: [PATCH V8 2/3] pinctrl: Add support pin control for UP board CPLD/FPGA
Date: Fri, 29 Dec 2023 16:52:56 +0800	[thread overview]
Message-ID: <202312291646.wfn6dxdH-lkp@intel.com> (raw)
In-Reply-To: <20231228151544.14408-3-larry.lai@yunjingtech.com>

Hi larry.lai,

kernel test robot noticed the following build warnings:

[auto build test WARNING on 4fe89d07dcc2804c8b562f6c7896a45643d34b2f]

url:    https://github.com/intel-lab-lkp/linux/commits/larry-lai/mfd-Add-support-for-UP-board-CPLD-FPGA/20231228-231750
base:   4fe89d07dcc2804c8b562f6c7896a45643d34b2f
patch link:    https://lore.kernel.org/r/20231228151544.14408-3-larry.lai%40yunjingtech.com
patch subject: [PATCH V8 2/3] pinctrl: Add support pin control for UP board CPLD/FPGA
config: i386-allyesconfig (https://download.01.org/0day-ci/archive/20231229/202312291646.wfn6dxdH-lkp@intel.com/config)
compiler: ClangBuiltLinux clang version 17.0.6 (https://github.com/llvm/llvm-project 6009708b4367171ccdbf4b5905cb6a803753fe18)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231229/202312291646.wfn6dxdH-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/202312291646.wfn6dxdH-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> drivers/pinctrl/pinctrl-upboard.c:709:13: warning: variable length array used [-Wvla]
     709 |         int offset[pctrl->pctldesc->npins];
         |                    ^~~~~~~~~~~~~~~~~~~~~~
   drivers/pinctrl/pinctrl-upboard.c:1089:12: error: incompatible integer to pointer conversion initializing 'const char *' with an expression of type 'int' [-Wint-conversion]
    1089 |                 .ident = BOARD_UP_APL01,
         |                          ^~~~~~~~~~~~~~
   drivers/pinctrl/pinctrl-upboard.c:46:27: note: expanded from macro 'BOARD_UP_APL01'
      46 | #define BOARD_UP_APL01                          1
         |                                                 ^
   drivers/pinctrl/pinctrl-upboard.c:1096:12: error: incompatible integer to pointer conversion initializing 'const char *' with an expression of type 'int' [-Wint-conversion]
    1096 |                 .ident = BOARD_UP_APL01,
         |                          ^~~~~~~~~~~~~~
   drivers/pinctrl/pinctrl-upboard.c:46:27: note: expanded from macro 'BOARD_UP_APL01'
      46 | #define BOARD_UP_APL01                          1
         |                                                 ^
   drivers/pinctrl/pinctrl-upboard.c:1103:12: error: incompatible integer to pointer conversion initializing 'const char *' with an expression of type 'int' [-Wint-conversion]
    1103 |                 .ident = BOARD_UP_APL03,
         |                          ^~~~~~~~~~~~~~
   drivers/pinctrl/pinctrl-upboard.c:53:27: note: expanded from macro 'BOARD_UP_APL03'
      53 | #define BOARD_UP_APL03                          9
         |                                                 ^
   drivers/pinctrl/pinctrl-upboard.c:1110:12: error: incompatible integer to pointer conversion initializing 'const char *' with an expression of type 'int' [-Wint-conversion]
    1110 |                 .ident = BOARD_UP_WHL01,
         |                          ^~~~~~~~~~~~~~
   drivers/pinctrl/pinctrl-upboard.c:50:27: note: expanded from macro 'BOARD_UP_WHL01'
      50 | #define BOARD_UP_WHL01                          5
         |                                                 ^
   drivers/pinctrl/pinctrl-upboard.c:1117:12: error: incompatible integer to pointer conversion initializing 'const char *' with an expression of type 'int' [-Wint-conversion]
    1117 |                 .ident = BOARD_UPX_TGL,
         |                          ^~~~~~~~~~~~~
   drivers/pinctrl/pinctrl-upboard.c:55:26: note: expanded from macro 'BOARD_UPX_TGL'
      55 | #define BOARD_UPX_TGL                           11
         |                                                 ^~
   drivers/pinctrl/pinctrl-upboard.c:1124:12: error: incompatible integer to pointer conversion initializing 'const char *' with an expression of type 'int' [-Wint-conversion]
    1124 |                 .ident = BOARD_UPN_EHL01,
         |                          ^~~~~~~~~~~~~~~
   drivers/pinctrl/pinctrl-upboard.c:57:28: note: expanded from macro 'BOARD_UPN_EHL01'
      57 | #define BOARD_UPN_EHL01                         13
         |                                                 ^~
   drivers/pinctrl/pinctrl-upboard.c:1131:12: error: incompatible integer to pointer conversion initializing 'const char *' with an expression of type 'int' [-Wint-conversion]
    1131 |                 .ident = BOARD_UPS_EHL01,
         |                          ^~~~~~~~~~~~~~~
   drivers/pinctrl/pinctrl-upboard.c:58:28: note: expanded from macro 'BOARD_UPS_EHL01'
      58 | #define BOARD_UPS_EHL01                         BOARD_UPN_EHL01
         |                                                 ^~~~~~~~~~~~~~~
   drivers/pinctrl/pinctrl-upboard.c:57:28: note: expanded from macro 'BOARD_UPN_EHL01'
      57 | #define BOARD_UPN_EHL01                         13
         |                                                 ^~
   drivers/pinctrl/pinctrl-upboard.c:1138:12: error: incompatible integer to pointer conversion initializing 'const char *' with an expression of type 'int' [-Wint-conversion]
    1138 |                 .ident = BOARD_UPX_ADLP01,
         |                          ^~~~~~~~~~~~~~~~
   drivers/pinctrl/pinctrl-upboard.c:59:28: note: expanded from macro 'BOARD_UPX_ADLP01'
      59 | #define BOARD_UPX_ADLP01                        15
         |                                                 ^~
   drivers/pinctrl/pinctrl-upboard.c:1145:12: error: incompatible integer to pointer conversion initializing 'const char *' with an expression of type 'int' [-Wint-conversion]
    1145 |                 .ident = BOARD_UPN_ADLN01,
         |                          ^~~~~~~~~~~~~~~~
   drivers/pinctrl/pinctrl-upboard.c:60:28: note: expanded from macro 'BOARD_UPN_ADLN01'
      60 | #define BOARD_UPN_ADLN01                        16
         |                                                 ^~
   drivers/pinctrl/pinctrl-upboard.c:1152:12: error: incompatible integer to pointer conversion initializing 'const char *' with an expression of type 'int' [-Wint-conversion]
    1152 |                 .ident = BOARD_UPS_ADLP01,
         |                          ^~~~~~~~~~~~~~~~
   drivers/pinctrl/pinctrl-upboard.c:61:28: note: expanded from macro 'BOARD_UPS_ADLP01'
      61 | #define BOARD_UPS_ADLP01                        BOARD_UPX_ADLP01
         |                                                 ^~~~~~~~~~~~~~~~
   drivers/pinctrl/pinctrl-upboard.c:59:28: note: expanded from macro 'BOARD_UPX_ADLP01'
      59 | #define BOARD_UPX_ADLP01                        15
         |                                                 ^~
   drivers/pinctrl/pinctrl-upboard.c:1159:12: error: incompatible integer to pointer conversion initializing 'const char *' with an expression of type 'int' [-Wint-conversion]
    1159 |                 .ident = BOARD_UP_ADLN01,
         |                          ^~~~~~~~~~~~~~~
   drivers/pinctrl/pinctrl-upboard.c:62:28: note: expanded from macro 'BOARD_UP_ADLN01'
      62 | #define BOARD_UP_ADLN01                         18
         |                                                 ^~
   drivers/pinctrl/pinctrl-upboard.c:1185:12: error: incompatible pointer to integer conversion assigning to 'int' from 'const char *const' [-Wint-conversion]
    1185 |                 board_id = system_id->ident;
         |                          ^ ~~~~~~~~~~~~~~~~
   1 warning and 12 errors generated.


vim +709 drivers/pinctrl/pinctrl-upboard.c

   705	
   706	static void upboard_alt_func_enable(struct gpio_chip *gc, const char *name, int id)
   707	{
   708		struct upboard_pinctrl *pctrl = container_of(gc, struct upboard_pinctrl, chip);
 > 709		int offset[pctrl->pctldesc->npins];
   710		int i, cnt;
   711		bool input;
   712		int mode;
   713		unsigned int val;
   714	
   715		/* find all pins */
   716		for (i = 0, cnt = 0; i < pctrl->pctldesc->npins; i++) {
   717			if (strstr(pctrl->pctldesc->pins[i].name, name))
   718				offset[cnt++] = i;
   719		}
   720	
   721		/* change to alternate function */
   722		for (i = 0; i < cnt; i++) {
   723			if (pctrl->pins[offset[i]].regs == NULL)
   724				continue;
   725			input = false;
   726			mode = 0; /* default GPIO */
   727			val = readl(pctrl->pins[offset[i]].regs);
   728	
   729			if (strstr(pctrl->pctldesc->pins[offset[i]].name, "I2C") ||
   730			    strstr(pctrl->pctldesc->pins[offset[i]].name, "PINMUX")) {
   731				mode = 1;
   732				switch (id) {
   733				case BOARD_UPN_ADLN01:
   734				case BOARD_UPX_ADLP01:
   735					mode = 2;
   736					break;
   737				default:
   738					break;
   739				}
   740	
   741				val |= mode<<PADCFG0_PMODE_SHIFT;
   742				writel(val, pctrl->pins[offset[i]].regs);
   743				upboard_fpga_request_free(pctrl->pctldev, offset[i]);
   744				continue;
   745			}
   746	
   747			if (strstr(pctrl->pctldesc->pins[offset[i]].name, "UART")) {
   748				mode = 1;
   749				switch (id) {
   750				case BOARD_UPN_EHL01:
   751					mode = 4;
   752					break;
   753				case BOARD_UP_ADLN01:
   754				case BOARD_UPN_ADLN01:
   755				case BOARD_UPX_ADLP01:
   756					mode = 2;
   757					break;
   758				default:
   759					break;
   760				}
   761			}
   762	
   763			if (strstr(pctrl->pctldesc->pins[offset[i]].name, "SPI")) {
   764				mode = 1;
   765				switch (id) {
   766				case BOARD_UP_WHL01:
   767					mode = 3;
   768					break;
   769				case BOARD_UP_ADLN01:
   770				case BOARD_UPN_ADLN01:
   771				case BOARD_UPX_ADLP01:
   772					mode = 7;
   773					if (strstr(pctrl->pctldesc->pins[offset[i]].name, "MOSI")) {
   774						val &= ~PADCFG0_GPIOTXDIS;
   775						val |= PADCFG0_GPIORXDIS;
   776					}
   777	
   778					if (strstr(pctrl->pctldesc->pins[offset[i]].name, "MISO"))
   779						val |= PADCFG0_GPIORXDIS;
   780	
   781					if (strstr(pctrl->pctldesc->pins[offset[i]].name, "CLK")) {
   782						val &= ~PADCFG0_GPIOTXDIS;
   783						val |= PADCFG0_GPIORXDIS;
   784					}
   785					if (strstr(pctrl->pctldesc->pins[offset[i]].name, "CS0"))
   786						val |= PADCFG0_GPIORXDIS;
   787	
   788					if (strstr(pctrl->pctldesc->pins[offset[i]].name, "CS1"))
   789						continue;
   790					break;
   791				default:
   792					break;
   793				}
   794			}
   795	
   796			if (strstr(pctrl->pctldesc->pins[offset[i]].name, "I2S")) {
   797				mode = 1;
   798				switch (id) {
   799				case BOARD_UPX_ADLP01:
   800					mode = 4;
   801					break;
   802				default:
   803					break;
   804				}
   805			}
   806	
   807			val |= mode<<PADCFG0_PMODE_SHIFT;
   808			writel(val, pctrl->pins[offset[i]].regs);
   809	
   810			/* input pins */
   811			if (strstr(pctrl->pctldesc->pins[offset[i]].name, "RX"))
   812				input = true;
   813	
   814			if (strstr(pctrl->pctldesc->pins[offset[i]].name, "CTS"))
   815				input = true;
   816	
   817			if (strstr(pctrl->pctldesc->pins[offset[i]].name, "ADC")) {
   818				input = true;
   819				if (id == BOARD_UP_APL01)
   820					upboard_fpga_request_enable(pctrl->pctldev, NULL, offset[i]);
   821				else
   822					upboard_fpga_request_free(pctrl->pctldev, offset[i]);
   823			}
   824	
   825			if (strstr(pctrl->pctldesc->pins[offset[i]].name, "MISO"))
   826				input = true;
   827	
   828			if (strstr(pctrl->pctldesc->pins[offset[i]].name, "DIN"))
   829				input = true;
   830	
   831			if (strstr(pctrl->pctldesc->pins[offset[i]].name, "SDI"))
   832				input = true;
   833	
   834			upboard_fpga_set_direction(pctrl->pctldev, NULL, offset[i], input);
   835		}
   836	}
   837	

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

  parent reply	other threads:[~2023-12-29  8:53 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-28 15:15 [PATCH V8 0/3] Add support control UP board CPLD/FPGA pin control larry.lai
2023-12-28 15:15 ` [PATCH V8 1/3] mfd: Add support for UP board CPLD/FPGA larry.lai
2023-12-28 15:27   ` Krzysztof Kozlowski
2023-12-28 15:31   ` Krzysztof Kozlowski
2023-12-29  9:18     ` Jack Chang
2023-12-28 15:15 ` [PATCH V8 2/3] pinctrl: Add support pin control " larry.lai
2023-12-28 15:28   ` Krzysztof Kozlowski
2023-12-29  9:18     ` Jack Chang
2023-12-30 14:09       ` Krzysztof Kozlowski
2023-12-29  8:52   ` kernel test robot [this message]
2023-12-29  8:52   ` kernel test robot
2023-12-29 11:56   ` kernel test robot
2023-12-28 15:15 ` [PATCH V8 3/3] leds: Add support for UP board CPLD onboard LEDS larry.lai
2023-12-28 15:29   ` Krzysztof Kozlowski
2023-12-29  9:18     ` Jack Chang
2023-12-28 15:25 ` [PATCH V8 0/3] Add support control UP board CPLD/FPGA pin control Krzysztof Kozlowski

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=202312291646.wfn6dxdH-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=GaryWang@aaeon.com.tw \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=jack.chang@yunjingtech.com \
    --cc=krzk@kernel.org \
    --cc=larry.lai@yunjingtech.com \
    --cc=lee@kernel.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=musa.lin@yunjingtech.com \
    --cc=noah.hung@yunjingtech.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=pavel@ucw.cz \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.