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: <202210180748.mgKr0jZ7-lkp@intel.com>
Date:   Tue, 18 Oct 2022 07:35:36 +0800
From:   kernel test robot <lkp@...el.com>
To:     Eddie James <eajames@...ux.ibm.com>, joel@....id.au
Cc:     kbuild-all@...ts.01.org, broonie@...nel.org, jk@...abs.org,
        alistair@...ple.id.au, linux-kernel@...r.kernel.org,
        linux-fsi@...ts.ozlabs.org, eajames@...ux.ibm.com
Subject: Re: [PATCH 5/5] drivers: fsi: occ and sbefifo refactor

Hi Eddie,

I love your patch! Yet something to improve:

[auto build test ERROR on linus/master]
[also build test ERROR on v6.1-rc1 next-20221017]
[cannot apply to broonie-regmap/for-next]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Eddie-James/fsi-Add-regmap-and-refactor-sbefifo/20221017-114633
patch link:    https://lore.kernel.org/r/20221014220540.55570-6-eajames%40linux.ibm.com
patch subject: [PATCH 5/5] drivers: fsi: occ and sbefifo refactor
config: arm-defconfig
compiler: arm-linux-gnueabi-gcc (GCC) 12.1.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/intel-lab-lkp/linux/commit/49dc2362239ea2e0f174255d6915f637a72670c8
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Eddie-James/fsi-Add-regmap-and-refactor-sbefifo/20221017-114633
        git checkout 49dc2362239ea2e0f174255d6915f637a72670c8
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=arm SHELL=/bin/bash drivers/fsi/

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@...el.com>

All error/warnings (new ones prefixed by >>):

   In file included from drivers/fsi/occ.c:14:
   drivers/fsi/occ.h:66:43: warning: 'enum versions' declared inside parameter list will not be visible outside of this definition or declaration
      66 |                                      enum versions v)
         |                                           ^~~~~~~~
   drivers/fsi/occ.h:66:52: error: parameter 3 ('v') has incomplete type
      66 |                                      enum versions v)
         |                                      ~~~~~~~~~~~~~~^
   drivers/fsi/occ.h:64:27: error: function declaration isn't a prototype [-Werror=strict-prototypes]
      64 | static inline struct occ *occ_create(struct sbefifo *sbefifo,
         |                           ^~~~~~~~~~
>> drivers/fsi/occ.c:33:17: error: 'OCC_RESP_DATA_BYTES' undeclared here (not in a function); did you mean 'OCC_RESP_DATA_INVAL'?
      33 |         u8 data[OCC_RESP_DATA_BYTES];
         |                 ^~~~~~~~~~~~~~~~~~~
         |                 OCC_RESP_DATA_INVAL
>> drivers/fsi/occ.c:37:31: warning: 'struct occ_pending' declared inside parameter list will not be visible outside of this definition or declaration
      37 | void occ_pending_alloc(struct occ_pending *pending, size_t size)
         |                               ^~~~~~~~~~~
>> drivers/fsi/occ.c:37:6: warning: no previous prototype for 'occ_pending_alloc' [-Wmissing-prototypes]
      37 | void occ_pending_alloc(struct occ_pending *pending, size_t size)
         |      ^~~~~~~~~~~~~~~~~
   drivers/fsi/occ.c: In function 'occ_pending_alloc':
>> drivers/fsi/occ.c:39:20: error: invalid use of undefined type 'struct occ_pending'
      39 |         if (pending->allocated) {
         |                    ^~
   drivers/fsi/occ.c:40:43: error: invalid use of undefined type 'struct occ_pending'
      40 |                 void *b = krealloc(pending->buffer, size, GFP_KERNEL);
         |                                           ^~
   drivers/fsi/occ.c:43:38: error: invalid use of undefined type 'struct occ_pending'
      43 |                         kfree(pending->buffer);
         |                                      ^~
   drivers/fsi/occ.c:45:24: error: invalid use of undefined type 'struct occ_pending'
      45 |                 pending->buffer = b;
         |                        ^~
   drivers/fsi/occ.c:47:24: error: invalid use of undefined type 'struct occ_pending'
      47 |                 pending->buffer = kmalloc(size, GFP_KERNEL);
         |                        ^~
   drivers/fsi/occ.c:48:24: error: invalid use of undefined type 'struct occ_pending'
      48 |                 pending->allocated = 1;
         |                        ^~
   drivers/fsi/occ.c:51:16: error: invalid use of undefined type 'struct occ_pending'
      51 |         pending->buffer_size = size;
         |                ^~
   drivers/fsi/occ.c: At top level:
   drivers/fsi/occ.c:54:60: warning: 'struct occ_pending' declared inside parameter list will not be visible outside of this definition or declaration
      54 | static int occ_store(const void *data, size_t size, struct occ_pending *pending)
         |                                                            ^~~~~~~~~~~
   drivers/fsi/occ.c: In function 'occ_store':
   drivers/fsi/occ.c:56:27: error: invalid use of undefined type 'struct occ_pending'
      56 |         if (size > pending->buffer_size) {
         |                           ^~
   drivers/fsi/occ.c:57:29: error: invalid use of undefined type 'struct occ_pending'
      57 |                 if (!pending->resizable)
         |                             ^~
>> drivers/fsi/occ.c:60:35: error: passing argument 1 of 'occ_pending_alloc' from incompatible pointer type [-Werror=incompatible-pointer-types]
      60 |                 occ_pending_alloc(pending, size);
         |                                   ^~~~~~~
         |                                   |
         |                                   struct occ_pending *
   drivers/fsi/occ.c:37:44: note: expected 'struct occ_pending *' but argument is of type 'struct occ_pending *'
      37 | void occ_pending_alloc(struct occ_pending *pending, size_t size)
         |                        ~~~~~~~~~~~~~~~~~~~~^~~~~~~
   drivers/fsi/occ.c:61:29: error: invalid use of undefined type 'struct occ_pending'
      61 |                 if (!pending->buffer)
         |                             ^~
   drivers/fsi/occ.c:65:23: error: invalid use of undefined type 'struct occ_pending'
      65 |         memcpy(pending->buffer, data, size);
         |                       ^~
   drivers/fsi/occ.c:66:16: error: invalid use of undefined type 'struct occ_pending'
      66 |         pending->data_size = size;
         |                ^~
   drivers/fsi/occ.c: At top level:
   drivers/fsi/occ.c:71:34: warning: 'struct occ_pending' declared inside parameter list will not be visible outside of this definition or declaration
      71 |                           struct occ_pending *pending)
         |                                  ^~~~~~~~~~~
   drivers/fsi/occ.c: In function 'occ_save_ffdc':
>> drivers/fsi/occ.c:78:43: error: passing argument 3 of 'occ_store' from incompatible pointer type [-Werror=incompatible-pointer-types]
      78 |                 occ_store(ffdc, ffdc_len, pending);
         |                                           ^~~~~~~
         |                                           |
         |                                           struct occ_pending *
   drivers/fsi/occ.c:54:73: note: expected 'struct occ_pending *' but argument is of type 'struct occ_pending *'
      54 | static int occ_store(const void *data, size_t size, struct occ_pending *pending)
         |                                                     ~~~~~~~~~~~~~~~~~~~~^~~~~~~
   In file included from include/linux/device.h:15,
                    from include/linux/fsi.h:10,
                    from drivers/fsi/occ.c:4:
   drivers/fsi/occ.c: In function 'occ_verify_checksum':
>> drivers/fsi/occ.c:98:29: error: invalid use of undefined type 'struct occ'
      98 |                 dev_err(&occ->dev, "Bad checksum: %04x!=%04x\n", checksum, checksum_resp);
         |                             ^~
   include/linux/dev_printk.h:110:25: note: in definition of macro 'dev_printk_index_wrap'
     110 |                 _p_func(dev, fmt, ##__VA_ARGS__);                       \
         |                         ^~~
   drivers/fsi/occ.c:98:17: note: in expansion of macro 'dev_err'
      98 |                 dev_err(&occ->dev, "Bad checksum: %04x!=%04x\n", checksum, checksum_resp);
         |                 ^~~~~~~
   drivers/fsi/occ.c: At top level:
   drivers/fsi/occ.c:105:73: warning: 'struct occ_pending' declared inside parameter list will not be visible outside of this definition or declaration
     105 | static int occ_getsram(struct occ *occ, u32 offset, ssize_t len, struct occ_pending *pending)
         |                                                                         ^~~~~~~~~~~
   drivers/fsi/occ.c: In function 'occ_getsram':
   drivers/fsi/occ.c:109:37: error: invalid use of undefined type 'struct occ'
     109 |         __be32 *resp = (__be32 *)occ->buffer;
         |                                     ^~
   drivers/fsi/occ.c:121:20: error: invalid use of undefined type 'struct occ'
     121 |         switch (occ->version) {
         |                    ^~
>> drivers/fsi/occ.c:123:14: error: 'occ_p9' undeclared (first use in this function)
     123 |         case occ_p9:
         |              ^~~~~~
   drivers/fsi/occ.c:123:14: note: each undeclared identifier is reported only once for each function it appears in
>> drivers/fsi/occ.c:128:14: error: 'occ_p10' undeclared (first use in this function)
     128 |         case occ_p10:
         |              ^~~~~~~
   drivers/fsi/occ.c:141:33: error: invalid use of undefined type 'struct occ'
     141 |         rc = sbefifo_submit(&occ->sbefifo->dev, cmd, cmd_len, resp, &resp_len);
         |                                 ^~
   drivers/fsi/occ.c:145:39: error: invalid use of undefined type 'struct occ'
     145 |         rc = sbefifo_parse_status(&occ->sbefifo->dev, SBEFIFO_CMD_GET_OCC_SRAM, resp, resp_len,
         |                                       ^~
   drivers/fsi/occ.c:148:29: error: invalid use of undefined type 'struct occ'
     148 |                 dev_err(&occ->dev, "SRAM read returned failure status: %08x\n", rc);
         |                             ^~
   include/linux/dev_printk.h:110:25: note: in definition of macro 'dev_printk_index_wrap'
     110 |                 _p_func(dev, fmt, ##__VA_ARGS__);                       \
         |                         ^~~
   drivers/fsi/occ.c:148:17: note: in expansion of macro 'dev_err'
     148 |                 dev_err(&occ->dev, "SRAM read returned failure status: %08x\n", rc);
         |                 ^~~~~~~
>> drivers/fsi/occ.c:149:64: error: passing argument 5 of 'occ_save_ffdc' from incompatible pointer type [-Werror=incompatible-pointer-types]
     149 |                 occ_save_ffdc(occ, resp, parsed_len, resp_len, pending);
         |                                                                ^~~~~~~
         |                                                                |
         |                                                                struct occ_pending *
   drivers/fsi/occ.c:71:47: note: expected 'struct occ_pending *' but argument is of type 'struct occ_pending *'
      71 |                           struct occ_pending *pending)
         |                           ~~~~~~~~~~~~~~~~~~~~^~~~~~~
   drivers/fsi/occ.c:157:29: error: invalid use of undefined type 'struct occ'
     157 |                 dev_err(&occ->dev, "SRAM read expected %d bytes got %zd\n", data_len,
         |                             ^~
   include/linux/dev_printk.h:110:25: note: in definition of macro 'dev_printk_index_wrap'
     110 |                 _p_func(dev, fmt, ##__VA_ARGS__);                       \
         |                         ^~~
   drivers/fsi/occ.c:157:17: note: in expansion of macro 'dev_err'
     157 |                 dev_err(&occ->dev, "SRAM read expected %d bytes got %zd\n", data_len,
         |                 ^~~~~~~
   drivers/fsi/occ.c: At top level:
   drivers/fsi/occ.c:166:31: warning: 'struct occ_pending' declared inside parameter list will not be visible outside of this definition or declaration
     166 |                        struct occ_pending *pending)
         |                               ^~~~~~~~~~~
   drivers/fsi/occ.c: In function 'occ_putsram':
   drivers/fsi/occ.c:170:36: error: invalid use of undefined type 'struct occ'
     170 |         __be32 *buf = (__be32 *)occ->buffer;
         |                                    ^~
   drivers/fsi/occ.c:178:23: error: invalid use of undefined type 'struct occ'
     178 |         cmd_len = (occ->version == occ_p10) ? 6 : 5;
         |                       ^~
   drivers/fsi/occ.c:178:36: error: 'occ_p10' undeclared (first use in this function)
     178 |         cmd_len = (occ->version == occ_p10) ? 6 : 5;
         |                                    ^~~~~~~
   drivers/fsi/occ.c:188:20: error: invalid use of undefined type 'struct occ'
     188 |         switch (occ->version) {
         |                    ^~
   drivers/fsi/occ.c:190:14: error: 'occ_p9' undeclared (first use in this function)
     190 |         case occ_p9:
         |              ^~~~~~
   drivers/fsi/occ.c:214:33: error: invalid use of undefined type 'struct occ'
     214 |         rc = sbefifo_submit(&occ->sbefifo->dev, buf, cmd_len, buf, &resp_len);
         |                                 ^~
   drivers/fsi/occ.c:218:39: error: invalid use of undefined type 'struct occ'
     218 |         rc = sbefifo_parse_status(&occ->sbefifo->dev, SBEFIFO_CMD_PUT_OCC_SRAM, buf, resp_len,
         |                                       ^~
   drivers/fsi/occ.c:221:29: error: invalid use of undefined type 'struct occ'
     221 |                 dev_err(&occ->dev, "SRAM write returned failure status: %08x\n", rc);
         |                             ^~
   include/linux/dev_printk.h:110:25: note: in definition of macro 'dev_printk_index_wrap'
     110 |                 _p_func(dev, fmt, ##__VA_ARGS__);                       \
         |                         ^~~
   drivers/fsi/occ.c:221:17: note: in expansion of macro 'dev_err'
     221 |                 dev_err(&occ->dev, "SRAM write returned failure status: %08x\n", rc);
         |                 ^~~~~~~
   drivers/fsi/occ.c:222:63: error: passing argument 5 of 'occ_save_ffdc' from incompatible pointer type [-Werror=incompatible-pointer-types]
     222 |                 occ_save_ffdc(occ, buf, parsed_len, resp_len, pending);
         |                                                               ^~~~~~~
         |                                                               |
         |                                                               struct occ_pending *
   drivers/fsi/occ.c:71:47: note: expected 'struct occ_pending *' but argument is of type 'struct occ_pending *'
      71 |                           struct occ_pending *pending)
         |                           ~~~~~~~~~~~~~~~~~~~~^~~~~~~
   drivers/fsi/occ.c:229:29: error: invalid use of undefined type 'struct occ'
     229 |                 dev_err(&occ->dev, "SRAM write response length invalid: %zd\n", parsed_len);
         |                             ^~
   include/linux/dev_printk.h:110:25: note: in definition of macro 'dev_printk_index_wrap'
     110 |                 _p_func(dev, fmt, ##__VA_ARGS__);                       \
         |                         ^~~
   drivers/fsi/occ.c:229:17: note: in expansion of macro 'dev_err'
     229 |                 dev_err(&occ->dev, "SRAM write response length invalid: %zd\n", parsed_len);
         |                 ^~~~~~~
   drivers/fsi/occ.c:234:37: error: invalid use of undefined type 'struct occ'
     234 |                         dev_err(&occ->dev, "SRAM write expected %d bytes got %zd\n", data_len,
         |                                     ^~
   include/linux/dev_printk.h:110:25: note: in definition of macro 'dev_printk_index_wrap'
     110 |                 _p_func(dev, fmt, ##__VA_ARGS__);                       \
         |                         ^~~
   drivers/fsi/occ.c:234:25: note: in expansion of macro 'dev_err'
     234 |                         dev_err(&occ->dev, "SRAM write expected %d bytes got %zd\n", data_len,
         |                         ^~~~~~~
   drivers/fsi/occ.c: At top level:
   drivers/fsi/occ.c:243:53: warning: 'struct occ_pending' declared inside parameter list will not be visible outside of this definition or declaration
     243 | static int occ_trigger_attn(struct occ *occ, struct occ_pending *pending)
         |                                                     ^~~~~~~~~~~
   drivers/fsi/occ.c: In function 'occ_trigger_attn':
   drivers/fsi/occ.c:246:36: error: invalid use of undefined type 'struct occ'
     246 |         __be32 *buf = (__be32 *)occ->buffer;
         |                                    ^~
   drivers/fsi/occ.c:253:20: error: invalid use of undefined type 'struct occ'
     253 |         switch (occ->version) {
         |                    ^~
   drivers/fsi/occ.c:255:14: error: 'occ_p9' undeclared (first use in this function)
     255 |         case occ_p9:
         |              ^~~~~~
   drivers/fsi/occ.c:260:14: error: 'occ_p10' undeclared (first use in this function)
     260 |         case occ_p10:
         |              ^~~~~~~
   drivers/fsi/occ.c:275:33: error: invalid use of undefined type 'struct occ'
     275 |         rc = sbefifo_submit(&occ->sbefifo->dev, buf, cmd_len, buf, &resp_len);
         |                                 ^~
   drivers/fsi/occ.c:279:39: error: invalid use of undefined type 'struct occ'
     279 |         rc = sbefifo_parse_status(&occ->sbefifo->dev, SBEFIFO_CMD_PUT_OCC_SRAM, buf, resp_len,
         |                                       ^~
   drivers/fsi/occ.c:282:29: error: invalid use of undefined type 'struct occ'
     282 |                 dev_err(&occ->dev, "SRAM attn returned failure status: %08x\n", rc);
         |                             ^~
   include/linux/dev_printk.h:110:25: note: in definition of macro 'dev_printk_index_wrap'
     110 |                 _p_func(dev, fmt, ##__VA_ARGS__);                       \
         |                         ^~~
   drivers/fsi/occ.c:282:17: note: in expansion of macro 'dev_err'
     282 |                 dev_err(&occ->dev, "SRAM attn returned failure status: %08x\n", rc);
         |                 ^~~~~~~
   drivers/fsi/occ.c:283:63: error: passing argument 5 of 'occ_save_ffdc' from incompatible pointer type [-Werror=incompatible-pointer-types]
     283 |                 occ_save_ffdc(occ, buf, parsed_len, resp_len, pending);
         |                                                               ^~~~~~~
         |                                                               |
         |                                                               struct occ_pending *
   drivers/fsi/occ.c:71:47: note: expected 'struct occ_pending *' but argument is of type 'struct occ_pending *'
      71 |                           struct occ_pending *pending)
         |                           ~~~~~~~~~~~~~~~~~~~~^~~~~~~
   drivers/fsi/occ.c:290:29: error: invalid use of undefined type 'struct occ'
     290 |                 dev_err(&occ->dev, "SRAM attn response length invalid: %zd\n", parsed_len);
         |                             ^~
   include/linux/dev_printk.h:110:25: note: in definition of macro 'dev_printk_index_wrap'
     110 |                 _p_func(dev, fmt, ##__VA_ARGS__);                       \
         |                         ^~~
   drivers/fsi/occ.c:290:17: note: in expansion of macro 'dev_err'
     290 |                 dev_err(&occ->dev, "SRAM attn response length invalid: %zd\n", parsed_len);
         |                 ^~~~~~~
   drivers/fsi/occ.c:295:37: error: invalid use of undefined type 'struct occ'
     295 |                         dev_err(&occ->dev, "SRAM attn expected 8 bytes got %zd\n", resp_data_len);
         |                                     ^~
   include/linux/dev_printk.h:110:25: note: in definition of macro 'dev_printk_index_wrap'
     110 |                 _p_func(dev, fmt, ##__VA_ARGS__);                       \
         |                         ^~~
   drivers/fsi/occ.c:295:25: note: in expansion of macro 'dev_err'
     295 |                         dev_err(&occ->dev, "SRAM attn expected 8 bytes got %zd\n", resp_data_len);
         |                         ^~~~~~~
   drivers/fsi/occ.c: At top level:
   drivers/fsi/occ.c:311:23: warning: 'struct occ_pending' declared inside parameter list will not be visible outside of this definition or declaration
     311 |                struct occ_pending *pending)
         |                       ^~~~~~~~~~~
>> drivers/fsi/occ.c:310:5: warning: no previous prototype for 'occ_submit' [-Wmissing-prototypes]
     310 | int occ_submit(struct occ *occ, const u8 *request, size_t request_size,
         |     ^~~~~~~~~~
   drivers/fsi/occ.c: In function 'occ_submit':
   drivers/fsi/occ.c:315:63: error: invalid use of undefined type 'struct occ'
     315 |         struct occ_response *resp = (struct occ_response *)occ->buffer;
         |                                                               ^~
   drivers/fsi/occ.c:324:16: error: invalid use of undefined type 'struct occ'
     324 |         if (occ->dead)
         |                ^~
   drivers/fsi/occ.c:330:43: error: invalid use of undefined type 'struct occ'
     330 |         rc = mutex_lock_interruptible(&occ->lock);
         |                                           ^~
   drivers/fsi/occ.c:342:21: error: invalid use of undefined type 'struct occ'
     342 |         seq_no = occ->sequence_number++;
         |                     ^~
   drivers/fsi/occ.c:343:17: error: invalid use of undefined type 'struct occ'
     343 |         if (!occ->sequence_number)
         |                 ^~
   drivers/fsi/occ.c:344:20: error: invalid use of undefined type 'struct occ'
     344 |                 occ->sequence_number = 1;
         |                    ^~
>> drivers/fsi/occ.c:347:72: error: passing argument 6 of 'occ_putsram' from incompatible pointer type [-Werror=incompatible-pointer-types]
     347 |         rc = occ_putsram(occ, request, request_size, seq_no, checksum, pending);
         |                                                                        ^~~~~~~
         |                                                                        |
         |                                                                        struct occ_pending *
   drivers/fsi/occ.c:166:44: note: expected 'struct occ_pending *' but argument is of type 'struct occ_pending *'
     166 |                        struct occ_pending *pending)
         |                        ~~~~~~~~~~~~~~~~~~~~^~~~~~~
>> drivers/fsi/occ.c:351:36: error: passing argument 2 of 'occ_trigger_attn' from incompatible pointer type [-Werror=incompatible-pointer-types]
     351 |         rc = occ_trigger_attn(occ, pending);
         |                                    ^~~~~~~
         |                                    |
         |                                    struct occ_pending *
   drivers/fsi/occ.c:243:66: note: expected 'struct occ_pending *' but argument is of type 'struct occ_pending *'
     243 | static int occ_trigger_attn(struct occ *occ, struct occ_pending *pending)
         |                                              ~~~~~~~~~~~~~~~~~~~~^~~~~~~
>> drivers/fsi/occ.c:358:45: error: passing argument 4 of 'occ_getsram' from incompatible pointer type [-Werror=incompatible-pointer-types]
     358 |                 rc = occ_getsram(occ, 0, 8, pending);
         |                                             ^~~~~~~
         |                                             |
         |                                             struct occ_pending *
   drivers/fsi/occ.c:105:86: note: expected 'struct occ_pending *' but argument is of type 'struct occ_pending *'
     105 | static int occ_getsram(struct occ *occ, u32 offset, ssize_t len, struct occ_pending *pending)
         |                                                                  ~~~~~~~~~~~~~~~~~~~~^~~~~~~
   drivers/fsi/occ.c:364:45: error: invalid use of undefined type 'struct occ'
     364 |                                 dev_err(&occ->dev,
         |                                             ^~
   include/linux/dev_printk.h:110:25: note: in definition of macro 'dev_printk_index_wrap'
     110 |                 _p_func(dev, fmt, ##__VA_ARGS__);                       \
         |                         ^~~
   drivers/fsi/occ.c:364:33: note: in expansion of macro 'dev_err'
     364 |                                 dev_err(&occ->dev,
         |                                 ^~~~~~~
   drivers/fsi/occ.c:382:64: error: invalid use of undefined type 'struct occ'
     382 |                         if ((resp_data_length + 7) > sizeof(occ->buffer)) {
         |                                                                ^~
   drivers/fsi/occ.c:392:80: error: passing argument 4 of 'occ_getsram' from incompatible pointer type [-Werror=incompatible-pointer-types]
     392 |                                 rc = occ_getsram(occ, 0, resp_data_length + 7, pending);
         |                                                                                ^~~~~~~
         |                                                                                |
         |                                                                                struct occ_pending *
   drivers/fsi/occ.c:105:86: note: expected 'struct occ_pending *' but argument is of type 'struct occ_pending *'
     105 | static int occ_getsram(struct occ *occ, u32 offset, ssize_t len, struct occ_pending *pending)
         |                                                                  ~~~~~~~~~~~~~~~~~~~~^~~~~~~
   drivers/fsi/occ.c:408:52: error: passing argument 3 of 'occ_store' from incompatible pointer type [-Werror=incompatible-pointer-types]
     408 |         rc = occ_store(resp, resp_data_length + 7, pending);
         |                                                    ^~~~~~~
         |                                                    |
         |                                                    struct occ_pending *
   drivers/fsi/occ.c:54:73: note: expected 'struct occ_pending *' but argument is of type 'struct occ_pending *'
      54 | static int occ_store(const void *data, size_t size, struct occ_pending *pending)
         |                                                     ~~~~~~~~~~~~~~~~~~~~^~~~~~~
   drivers/fsi/occ.c:411:26: error: invalid use of undefined type 'struct occ'
     411 |         mutex_unlock(&occ->lock);
         |                          ^~
   In file included from include/linux/bits.h:22,
                    from include/linux/ratelimit_types.h:5,
                    from include/linux/ratelimit.h:5,
                    from include/linux/dev_printk.h:16:
   drivers/fsi/occ.c: In function 'occ_free':
>> include/linux/container_of.h:19:54: error: invalid use of undefined type 'struct occ'
      19 |         static_assert(__same_type(*(ptr), ((type *)0)->member) ||       \
         |                                                      ^~
   include/linux/build_bug.h:78:56: note: in definition of macro '__static_assert'
      78 | #define __static_assert(expr, msg, ...) _Static_assert(expr, msg)
         |                                                        ^~~~
   include/linux/container_of.h:19:9: note: in expansion of macro 'static_assert'
      19 |         static_assert(__same_type(*(ptr), ((type *)0)->member) ||       \
         |         ^~~~~~~~~~~~~
   include/linux/container_of.h:19:23: note: in expansion of macro '__same_type'
      19 |         static_assert(__same_type(*(ptr), ((type *)0)->member) ||       \
         |                       ^~~~~~~~~~~
   drivers/fsi/occ.c:417:27: note: in expansion of macro 'container_of'
     417 |         struct occ *occ = container_of(dev, struct occ, dev);
         |                           ^~~~~~~~~~~~
   include/linux/compiler_types.h:298:27: error: expression in static assertion is not an integer
     298 | #define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b))
         |                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/build_bug.h:78:56: note: in definition of macro '__static_assert'
      78 | #define __static_assert(expr, msg, ...) _Static_assert(expr, msg)
         |                                                        ^~~~
   include/linux/container_of.h:19:9: note: in expansion of macro 'static_assert'
      19 |         static_assert(__same_type(*(ptr), ((type *)0)->member) ||       \
         |         ^~~~~~~~~~~~~
   include/linux/container_of.h:19:23: note: in expansion of macro '__same_type'
      19 |         static_assert(__same_type(*(ptr), ((type *)0)->member) ||       \
         |                       ^~~~~~~~~~~
   drivers/fsi/occ.c:417:27: note: in expansion of macro 'container_of'
     417 |         struct occ *occ = container_of(dev, struct occ, dev);
         |                           ^~~~~~~~~~~~
   In file included from include/uapi/linux/posix_types.h:5,
                    from include/uapi/linux/types.h:14,
                    from include/linux/types.h:6,
                    from include/linux/kasan-checks.h:5,
                    from include/asm-generic/rwonce.h:26,
                    from ./arch/arm/include/generated/asm/rwonce.h:1,
                    from include/linux/compiler.h:246,
                    from include/linux/dev_printk.h:14:
>> include/linux/stddef.h:16:33: error: invalid use of undefined type 'struct occ'
      16 | #define offsetof(TYPE, MEMBER)  __builtin_offsetof(TYPE, MEMBER)
         |                                 ^~~~~~~~~~~~~~~~~~
   include/linux/container_of.h:22:28: note: in expansion of macro 'offsetof'
      22 |         ((type *)(__mptr - offsetof(type, member))); })
         |                            ^~~~~~~~
   drivers/fsi/occ.c:417:27: note: in expansion of macro 'container_of'
     417 |         struct occ *occ = container_of(dev, struct occ, dev);
         |                           ^~~~~~~~~~~~
   drivers/fsi/occ.c: In function 'occ_register_hwmon':
   drivers/fsi/occ.c:431:31: error: invalid use of undefined type 'struct occ'
     431 |                 .parent = &occ->dev,
         |                               ^~
   drivers/fsi/occ.c:440:30: error: invalid use of undefined type 'struct occ'
     440 |                 dev_warn(&occ->dev, "Failed to create hwmon device: %ld.\n", PTR_ERR(hwmon_dev));
         |                              ^~
   include/linux/dev_printk.h:110:25: note: in definition of macro 'dev_printk_index_wrap'
     110 |                 _p_func(dev, fmt, ##__VA_ARGS__);                       \
         |                         ^~~
   drivers/fsi/occ.c:440:17: note: in expansion of macro 'dev_warn'
     440 |                 dev_warn(&occ->dev, "Failed to create hwmon device: %ld.\n", PTR_ERR(hwmon_dev));
         |                 ^~~~~~~~
   drivers/fsi/occ.c: At top level:
>> drivers/fsi/occ.c:453:84: warning: 'enum versions' declared inside parameter list will not be visible outside of this definition or declaration
     453 |                        int (*get_devt)(struct device *, int, dev_t *, int *), enum versions v)
         |                                                                                    ^~~~~~~~
>> drivers/fsi/occ.c:453:93: error: parameter 3 ('v') has incomplete type
     453 |                        int (*get_devt)(struct device *, int, dev_t *, int *), enum versions v)
         |                                                                               ~~~~~~~~~~~~~~^
>> drivers/fsi/occ.c:452:13: error: function declaration isn't a prototype [-Werror=strict-prototypes]
     452 | struct occ *occ_create(struct sbefifo *sbefifo,
         |             ^~~~~~~~~~
>> drivers/fsi/occ.c:452:13: error: redefinition of 'occ_create'
   drivers/fsi/occ.h:64:27: note: previous definition of 'occ_create' with type 'struct occ *()'
      64 | static inline struct occ *occ_create(struct sbefifo *sbefifo,
         |                           ^~~~~~~~~~
   drivers/fsi/occ.c: In function 'occ_create':
   drivers/fsi/occ.c:462:30: error: invalid application of 'sizeof' to incomplete type 'struct occ'
     462 |         occ = kvzalloc(sizeof(*occ), GFP_KERNEL);
         |                              ^
   drivers/fsi/occ.c:468:66: error: invalid use of undefined type 'struct occ'
     468 |         rc = get_devt(sbefifo->dev.parent, (int)fsi_dev_occ, &occ->dev.devt, &idx);
         |                                                                  ^~
   drivers/fsi/occ.c:475:12: error: invalid use of undefined type 'struct occ'
     475 |         occ->dev.type = &fsi_cdev_type;
         |            ^~
   drivers/fsi/occ.c:476:12: error: invalid use of undefined type 'struct occ'
     476 |         occ->dev.parent = &sbefifo->dev;
         |            ^~
   drivers/fsi/occ.c:477:12: error: invalid use of undefined type 'struct occ'
     477 |         occ->dev.release = occ_free;
         |            ^~
   drivers/fsi/occ.c:478:31: error: invalid use of undefined type 'struct occ'
     478 |         device_initialize(&occ->dev);
         |                               ^~
   drivers/fsi/occ.c:479:26: error: invalid use of undefined type 'struct occ'
     479 |         dev_set_name(&occ->dev, "occ%d", idx);
         |                          ^~
   drivers/fsi/occ.c:481:9: error: implicit declaration of function 'occ_cdev_init'; did you mean 'cdev_init'? [-Werror=implicit-function-declaration]
     481 |         occ_cdev_init(occ);
         |         ^~~~~~~~~~~~~
         |         cdev_init
   In file included from include/linux/rhashtable-types.h:14,
                    from include/linux/ipc.h:7,
                    from include/uapi/linux/sem.h:5,
                    from include/linux/sem.h:5,
                    from include/linux/sched.h:15,
                    from include/linux/ratelimit.h:6:
   drivers/fsi/occ.c:483:24: error: invalid use of undefined type 'struct occ'
     483 |         mutex_init(&occ->lock);
         |                        ^~
   include/linux/mutex.h:105:23: note: in definition of macro 'mutex_init'
     105 |         __mutex_init((mutex), #mutex, &__key);                          \
         |                       ^~~~~
   drivers/fsi/occ.c:484:12: error: invalid use of undefined type 'struct occ'
     484 |         occ->sbefifo = sbefifo;
         |            ^~
   drivers/fsi/occ.c:485:12: error: invalid use of undefined type 'struct occ'
     485 |         occ->version = v;
         |            ^~
   drivers/fsi/occ.c:490:12: error: invalid use of undefined type 'struct occ'
     490 |         occ->sequence_number = (u8)((jiffies % 0xff) + 1);
         |            ^~
   drivers/fsi/occ.c: At top level:
   drivers/fsi/occ.c:497:6: error: redefinition of 'occ_destroy'
     497 | void occ_destroy(struct occ *occ, void(*free_devt)(dev_t))
         |      ^~~~~~~~~~~
   drivers/fsi/occ.h:71:20: note: previous definition of 'occ_destroy' with type 'void(struct occ *, void (*)(dev_t))' {aka 'void(struct occ *, void (*)(unsigned int))'}
      71 | static inline void occ_destroy(struct occ *occ, void(*free_devt)(dev_t)) {}
         |                    ^~~~~~~~~~~
   drivers/fsi/occ.c: In function 'occ_destroy':
   drivers/fsi/occ.c:499:12: error: invalid use of undefined type 'struct occ'
     499 |         occ->dead = 1;
         |            ^~
   drivers/fsi/occ.c:501:35: error: invalid use of undefined type 'struct occ'
     501 |         device_for_each_child(&occ->dev, NULL, occ_unregister_child);
         |                                   ^~
   drivers/fsi/occ.c:504:30: error: invalid use of undefined type 'struct occ'
     504 |                 free_devt(occ->dev.devt);
         |                              ^~
   drivers/fsi/occ.c:506:17: error: invalid use of undefined type 'struct occ'
     506 |         if (!occ->no_cdev)
         |                 ^~
   drivers/fsi/occ.c:507:37: error: invalid use of undefined type 'struct occ'
     507 |                 cdev_device_del(&occ->occ, &occ->dev);
         |                                     ^~
   drivers/fsi/occ.c:507:48: error: invalid use of undefined type 'struct occ'
     507 |                 cdev_device_del(&occ->occ, &occ->dev);
         |                                                ^~
   drivers/fsi/occ.c:509:24: error: invalid use of undefined type 'struct occ'
     509 |         put_device(&occ->dev);
         |                        ^~
   drivers/fsi/occ.c: In function 'fsi_occ_submit':
   include/linux/container_of.h:19:54: error: invalid use of undefined type 'struct occ'
      19 |         static_assert(__same_type(*(ptr), ((type *)0)->member) ||       \
         |                                                      ^~
   include/linux/build_bug.h:78:56: note: in definition of macro '__static_assert'
      78 | #define __static_assert(expr, msg, ...) _Static_assert(expr, msg)
         |                                                        ^~~~
   include/linux/container_of.h:19:9: note: in expansion of macro 'static_assert'
      19 |         static_assert(__same_type(*(ptr), ((type *)0)->member) ||       \
         |         ^~~~~~~~~~~~~
   include/linux/container_of.h:19:23: note: in expansion of macro '__same_type'
      19 |         static_assert(__same_type(*(ptr), ((type *)0)->member) ||       \
         |                       ^~~~~~~~~~~
   drivers/fsi/occ.c:515:27: note: in expansion of macro 'container_of'
     515 |         struct occ *occ = container_of(dev, struct occ, dev);
         |                           ^~~~~~~~~~~~
   include/linux/compiler_types.h:298:27: error: expression in static assertion is not an integer
     298 | #define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b))
         |                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/build_bug.h:78:56: note: in definition of macro '__static_assert'
      78 | #define __static_assert(expr, msg, ...) _Static_assert(expr, msg)
..


vim +33 drivers/fsi/occ.c

    27	
    28	struct occ_response {
    29		u8 seq_no;
    30		u8 cmd_type;
    31		u8 return_status;
    32		__be16 data_length;
  > 33		u8 data[OCC_RESP_DATA_BYTES];
    34		u16 checksum;
    35	} __packed;
    36	
  > 37	void occ_pending_alloc(struct occ_pending *pending, size_t size)
    38	{
  > 39		if (pending->allocated) {
    40			void *b = krealloc(pending->buffer, size, GFP_KERNEL);
    41	
    42			if (!b)
    43				kfree(pending->buffer);
    44	
    45			pending->buffer = b;
    46		} else {
    47			pending->buffer = kmalloc(size, GFP_KERNEL);
    48			pending->allocated = 1;
    49		}
    50	
    51		pending->buffer_size = size;
    52	}
    53	
  > 54	static int occ_store(const void *data, size_t size, struct occ_pending *pending)
    55	{
  > 56		if (size > pending->buffer_size) {
    57			if (!pending->resizable)
    58				return -ENOBUFS;
    59	
  > 60			occ_pending_alloc(pending, size);
    61			if (!pending->buffer)
    62				return -ENOMEM;
    63		}
    64	
    65		memcpy(pending->buffer, data, size);
  > 66		pending->data_size = size;
    67		return 0;
    68	}
    69	
    70	static void occ_save_ffdc(struct occ *occ, __be32 *resp, size_t parsed_len, size_t resp_len,
    71				  struct occ_pending *pending)
    72	{
    73		if (resp_len > parsed_len) {
    74			size_t dh = resp_len - parsed_len;
    75			size_t ffdc_len = (dh - 1) * 4; /* SBE words are four bytes */
    76			__be32 *ffdc = &resp[parsed_len];
    77	
  > 78			occ_store(ffdc, ffdc_len, pending);
    79		}
    80	}
    81	
    82	static int occ_verify_checksum(struct occ *occ, struct occ_response *resp, u16 data_length)
    83	{
    84		/* Fetch the two bytes after the data for the checksum. */
    85		u16 checksum_resp = get_unaligned_be16(&resp->data[data_length]);
    86		u16 checksum;
    87		u16 i;
    88	
    89		checksum = resp->seq_no;
    90		checksum += resp->cmd_type;
    91		checksum += resp->return_status;
    92		checksum += (data_length >> 8) + (data_length & 0xFF);
    93	
    94		for (i = 0; i < data_length; ++i)
    95			checksum += resp->data[i];
    96	
    97		if (checksum != checksum_resp) {
  > 98			dev_err(&occ->dev, "Bad checksum: %04x!=%04x\n", checksum, checksum_resp);
    99			return -EBADE;
   100		}
   101	
   102		return 0;
   103	}
   104	
   105	static int occ_getsram(struct occ *occ, u32 offset, ssize_t len, struct occ_pending *pending)
   106	{
   107		size_t resp_len = OCC_MAX_RESP_WORDS;
   108		u32 data_len = ((len + 7) / 8) * 8;	/* must be multiples of 8 B */
 > 109		__be32 *resp = (__be32 *)occ->buffer;
   110		size_t resp_data_len;
   111		size_t parsed_len;
   112		size_t cmd_len;
   113		__be32 cmd[6];
   114		int idx = 0;
   115		int rc;
   116	
   117		/*
   118		 * Magic sequence to do SBE getsram command. SBE will fetch data from
   119		 * specified SRAM address.
   120		 */
 > 121		switch (occ->version) {
   122		default:
 > 123		case occ_p9:
   124			cmd_len = 5;
   125			cmd[2] = cpu_to_be32(1);	/* Normal mode */
   126			cmd[3] = cpu_to_be32(OCC_P9_SRAM_RSP_ADDR + offset);
   127			break;
 > 128		case occ_p10:
   129			idx = 1;
   130			cmd_len = 6;
   131			cmd[2] = cpu_to_be32(OCC_P10_SRAM_MODE);
   132			cmd[3] = 0;
   133			cmd[4] = cpu_to_be32(OCC_P10_SRAM_RSP_ADDR + offset);
   134			break;
   135		}
   136	
   137		cmd[0] = cpu_to_be32(cmd_len);
   138		cmd[1] = cpu_to_be32(SBEFIFO_CMD_GET_OCC_SRAM);
   139		cmd[4 + idx] = cpu_to_be32(data_len);
   140	
   141		rc = sbefifo_submit(&occ->sbefifo->dev, cmd, cmd_len, resp, &resp_len);
   142		if (rc)
   143			return rc;
   144	
   145		rc = sbefifo_parse_status(&occ->sbefifo->dev, SBEFIFO_CMD_GET_OCC_SRAM, resp, resp_len,
   146					  &parsed_len);
   147		if (rc > 0) {
 > 148			dev_err(&occ->dev, "SRAM read returned failure status: %08x\n", rc);
 > 149			occ_save_ffdc(occ, resp, parsed_len, resp_len, pending);
   150			return -ECOMM;
   151		} else if (rc) {
   152			return rc;
   153		}
   154	
   155		resp_data_len = be32_to_cpu(resp[parsed_len - 1]);
   156		if (resp_data_len != data_len) {
   157			dev_err(&occ->dev, "SRAM read expected %d bytes got %zd\n", data_len,
   158				resp_data_len);
   159			rc = -EBADMSG;
   160		}
   161	
   162		return rc;
   163	}
   164	

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

View attachment "config" of type "text/plain" (262348 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ