lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202312291634.yn0gCqZI-lkp@intel.com>
Date: Fri, 29 Dec 2023 16:52:57 +0800
From: kernel test robot <lkp@...el.com>
To: "larry.lai" <larry.lai@...jingtech.com>, lee@...nel.org,
	andriy.shevchenko@...ux.intel.com, linus.walleij@...aro.org,
	pavel@....cz, krzk@...nel.org
Cc: oe-kbuild-all@...ts.linux.dev, linux-kernel@...r.kernel.org,
	linux-gpio@...r.kernel.org, linux-leds@...r.kernel.org,
	GaryWang@...on.com.tw, musa.lin@...jingtech.com,
	jack.chang@...jingtech.com, noah.hung@...jingtech.com,
	"larry.lai" <larry.lai@...jingtech.com>
Subject: Re: [PATCH V8 2/3] pinctrl: Add support pin control for UP board
 CPLD/FPGA

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: m68k-allmodconfig (https://download.01.org/0day-ci/archive/20231229/202312291634.yn0gCqZI-lkp@intel.com/config)
compiler: m68k-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231229/202312291634.yn0gCqZI-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@...el.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202312291634.yn0gCqZI-lkp@intel.com/

All warnings (new ones prefixed by >>):

   drivers/pinctrl/pinctrl-upboard.c: In function 'upboard_alt_func_enable':
>> drivers/pinctrl/pinctrl-upboard.c:709:9: warning: ISO C90 forbids variable length array 'offset' [-Wvla]
     709 |         int offset[pctrl->pctldesc->npins];
         |         ^~~
   drivers/pinctrl/pinctrl-upboard.c: At top level:
>> drivers/pinctrl/pinctrl-upboard.c:46:49: warning: initialization of 'const char *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
      46 | #define BOARD_UP_APL01                          1
         |                                                 ^
   drivers/pinctrl/pinctrl-upboard.c:1089:26: note: in expansion of macro 'BOARD_UP_APL01'
    1089 |                 .ident = BOARD_UP_APL01,
         |                          ^~~~~~~~~~~~~~
   drivers/pinctrl/pinctrl-upboard.c:46:49: note: (near initialization for 'upboard_dmi_table[0].ident')
      46 | #define BOARD_UP_APL01                          1
         |                                                 ^
   drivers/pinctrl/pinctrl-upboard.c:1089:26: note: in expansion of macro 'BOARD_UP_APL01'
    1089 |                 .ident = BOARD_UP_APL01,
         |                          ^~~~~~~~~~~~~~
>> drivers/pinctrl/pinctrl-upboard.c:46:49: warning: initialization of 'const char *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
      46 | #define BOARD_UP_APL01                          1
         |                                                 ^
   drivers/pinctrl/pinctrl-upboard.c:1096:26: note: in expansion of macro 'BOARD_UP_APL01'
    1096 |                 .ident = BOARD_UP_APL01,
         |                          ^~~~~~~~~~~~~~
   drivers/pinctrl/pinctrl-upboard.c:46:49: note: (near initialization for 'upboard_dmi_table[1].ident')
      46 | #define BOARD_UP_APL01                          1
         |                                                 ^
   drivers/pinctrl/pinctrl-upboard.c:1096:26: note: in expansion of macro 'BOARD_UP_APL01'
    1096 |                 .ident = BOARD_UP_APL01,
         |                          ^~~~~~~~~~~~~~
   drivers/pinctrl/pinctrl-upboard.c:53:49: warning: initialization of 'const char *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
      53 | #define BOARD_UP_APL03                          9
         |                                                 ^
   drivers/pinctrl/pinctrl-upboard.c:1103:26: note: in expansion of macro 'BOARD_UP_APL03'
    1103 |                 .ident = BOARD_UP_APL03,
         |                          ^~~~~~~~~~~~~~
   drivers/pinctrl/pinctrl-upboard.c:53:49: note: (near initialization for 'upboard_dmi_table[2].ident')
      53 | #define BOARD_UP_APL03                          9
         |                                                 ^
   drivers/pinctrl/pinctrl-upboard.c:1103:26: note: in expansion of macro 'BOARD_UP_APL03'
    1103 |                 .ident = BOARD_UP_APL03,
         |                          ^~~~~~~~~~~~~~
   drivers/pinctrl/pinctrl-upboard.c:50:49: warning: initialization of 'const char *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
      50 | #define BOARD_UP_WHL01                          5
         |                                                 ^
   drivers/pinctrl/pinctrl-upboard.c:1110:26: note: in expansion of macro 'BOARD_UP_WHL01'
    1110 |                 .ident = BOARD_UP_WHL01,
         |                          ^~~~~~~~~~~~~~
   drivers/pinctrl/pinctrl-upboard.c:50:49: note: (near initialization for 'upboard_dmi_table[3].ident')
      50 | #define BOARD_UP_WHL01                          5
         |                                                 ^
   drivers/pinctrl/pinctrl-upboard.c:1110:26: note: in expansion of macro 'BOARD_UP_WHL01'
    1110 |                 .ident = BOARD_UP_WHL01,
         |                          ^~~~~~~~~~~~~~
   drivers/pinctrl/pinctrl-upboard.c:55:49: warning: initialization of 'const char *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
      55 | #define BOARD_UPX_TGL                           11
         |                                                 ^~
   drivers/pinctrl/pinctrl-upboard.c:1117:26: note: in expansion of macro 'BOARD_UPX_TGL'
    1117 |                 .ident = BOARD_UPX_TGL,
         |                          ^~~~~~~~~~~~~
   drivers/pinctrl/pinctrl-upboard.c:55:49: note: (near initialization for 'upboard_dmi_table[4].ident')
      55 | #define BOARD_UPX_TGL                           11
         |                                                 ^~
   drivers/pinctrl/pinctrl-upboard.c:1117:26: note: in expansion of macro 'BOARD_UPX_TGL'
    1117 |                 .ident = BOARD_UPX_TGL,
         |                          ^~~~~~~~~~~~~
   drivers/pinctrl/pinctrl-upboard.c:57:49: warning: initialization of 'const char *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
      57 | #define BOARD_UPN_EHL01                         13
         |                                                 ^~
   drivers/pinctrl/pinctrl-upboard.c:1124:26: note: in expansion of macro 'BOARD_UPN_EHL01'
    1124 |                 .ident = BOARD_UPN_EHL01,
         |                          ^~~~~~~~~~~~~~~
   drivers/pinctrl/pinctrl-upboard.c:57:49: note: (near initialization for 'upboard_dmi_table[5].ident')
      57 | #define BOARD_UPN_EHL01                         13
         |                                                 ^~
   drivers/pinctrl/pinctrl-upboard.c:1124:26: note: in expansion of macro 'BOARD_UPN_EHL01'
    1124 |                 .ident = BOARD_UPN_EHL01,
         |                          ^~~~~~~~~~~~~~~
   drivers/pinctrl/pinctrl-upboard.c:57:49: warning: initialization of 'const char *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
      57 | #define BOARD_UPN_EHL01                         13
         |                                                 ^~
   drivers/pinctrl/pinctrl-upboard.c:58:49: note: in expansion of macro 'BOARD_UPN_EHL01'
      58 | #define BOARD_UPS_EHL01                         BOARD_UPN_EHL01
         |                                                 ^~~~~~~~~~~~~~~
   drivers/pinctrl/pinctrl-upboard.c:1131:26: note: in expansion of macro 'BOARD_UPS_EHL01'
    1131 |                 .ident = BOARD_UPS_EHL01,
         |                          ^~~~~~~~~~~~~~~
   drivers/pinctrl/pinctrl-upboard.c:57:49: note: (near initialization for 'upboard_dmi_table[6].ident')
      57 | #define BOARD_UPN_EHL01                         13
         |                                                 ^~
   drivers/pinctrl/pinctrl-upboard.c:58:49: note: in expansion of macro 'BOARD_UPN_EHL01'
      58 | #define BOARD_UPS_EHL01                         BOARD_UPN_EHL01
         |                                                 ^~~~~~~~~~~~~~~
   drivers/pinctrl/pinctrl-upboard.c:1131:26: note: in expansion of macro 'BOARD_UPS_EHL01'
    1131 |                 .ident = BOARD_UPS_EHL01,
         |                          ^~~~~~~~~~~~~~~
   drivers/pinctrl/pinctrl-upboard.c:59:49: warning: initialization of 'const char *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
      59 | #define BOARD_UPX_ADLP01                        15
         |                                                 ^~
   drivers/pinctrl/pinctrl-upboard.c:1138:26: note: in expansion of macro 'BOARD_UPX_ADLP01'
    1138 |                 .ident = BOARD_UPX_ADLP01,
         |                          ^~~~~~~~~~~~~~~~
   drivers/pinctrl/pinctrl-upboard.c:59:49: note: (near initialization for 'upboard_dmi_table[7].ident')
      59 | #define BOARD_UPX_ADLP01                        15
         |                                                 ^~
   drivers/pinctrl/pinctrl-upboard.c:1138:26: note: in expansion of macro 'BOARD_UPX_ADLP01'
    1138 |                 .ident = BOARD_UPX_ADLP01,
         |                          ^~~~~~~~~~~~~~~~
   drivers/pinctrl/pinctrl-upboard.c:60:49: warning: initialization of 'const char *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
      60 | #define BOARD_UPN_ADLN01                        16
         |                                                 ^~
   drivers/pinctrl/pinctrl-upboard.c:1145:26: note: in expansion of macro 'BOARD_UPN_ADLN01'
    1145 |                 .ident = BOARD_UPN_ADLN01,
         |                          ^~~~~~~~~~~~~~~~
   drivers/pinctrl/pinctrl-upboard.c:60:49: note: (near initialization for 'upboard_dmi_table[8].ident')
      60 | #define BOARD_UPN_ADLN01                        16
         |                                                 ^~
   drivers/pinctrl/pinctrl-upboard.c:1145:26: note: in expansion of macro 'BOARD_UPN_ADLN01'
    1145 |                 .ident = BOARD_UPN_ADLN01,
         |                          ^~~~~~~~~~~~~~~~
   drivers/pinctrl/pinctrl-upboard.c:59:49: warning: initialization of 'const char *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
      59 | #define BOARD_UPX_ADLP01                        15
         |                                                 ^~
   drivers/pinctrl/pinctrl-upboard.c:61:49: note: in expansion of macro 'BOARD_UPX_ADLP01'
      61 | #define BOARD_UPS_ADLP01                        BOARD_UPX_ADLP01
         |                                                 ^~~~~~~~~~~~~~~~
   drivers/pinctrl/pinctrl-upboard.c:1152:26: note: in expansion of macro 'BOARD_UPS_ADLP01'
    1152 |                 .ident = BOARD_UPS_ADLP01,
         |                          ^~~~~~~~~~~~~~~~
   drivers/pinctrl/pinctrl-upboard.c:59:49: note: (near initialization for 'upboard_dmi_table[9].ident')
      59 | #define BOARD_UPX_ADLP01                        15
         |                                                 ^~
   drivers/pinctrl/pinctrl-upboard.c:61:49: note: in expansion of macro 'BOARD_UPX_ADLP01'
      61 | #define BOARD_UPS_ADLP01                        BOARD_UPX_ADLP01
         |                                                 ^~~~~~~~~~~~~~~~
   drivers/pinctrl/pinctrl-upboard.c:1152:26: note: in expansion of macro 'BOARD_UPS_ADLP01'
    1152 |                 .ident = BOARD_UPS_ADLP01,
         |                          ^~~~~~~~~~~~~~~~
   drivers/pinctrl/pinctrl-upboard.c:62:49: warning: initialization of 'const char *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
      62 | #define BOARD_UP_ADLN01                         18
         |                                                 ^~
   drivers/pinctrl/pinctrl-upboard.c:1159:26: note: in expansion of macro 'BOARD_UP_ADLN01'
    1159 |                 .ident = BOARD_UP_ADLN01,
         |                          ^~~~~~~~~~~~~~~
   drivers/pinctrl/pinctrl-upboard.c:62:49: note: (near initialization for 'upboard_dmi_table[10].ident')
      62 | #define BOARD_UP_ADLN01                         18
         |                                                 ^~
   drivers/pinctrl/pinctrl-upboard.c:1159:26: note: in expansion of macro 'BOARD_UP_ADLN01'
    1159 |                 .ident = BOARD_UP_ADLN01,
         |                          ^~~~~~~~~~~~~~~
   drivers/pinctrl/pinctrl-upboard.c: In function 'upboard_pinctrl_probe':
>> drivers/pinctrl/pinctrl-upboard.c:1185:26: warning: assignment to 'int' from 'const char *' makes integer from pointer without a cast [-Wint-conversion]
    1185 |                 board_id = system_id->ident;
         |                          ^


vim +/offset +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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ