You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2020/11/19 13:04:21 UTC

[GitHub] [incubator-nuttx] juniskane opened a new pull request #2345: drivers/mtd/mtd_progmem.c: fix progmem_log2 parameter type to match prototype

juniskane opened a new pull request #2345:
URL: https://github.com/apache/incubator-nuttx/pull/2345


   ## Summary
   
   If size_t != uint32_t, this can give a build error:
   
    mtd/mtd_progmem.c:134:16: error: conflicting types for 'progmem_log2'
      134 | static int32_t progmem_log2(uint32_t blocksize)
          |                ^~~~~~~~~~~~
    mtd/mtd_progmem.c:82:16: note: previous declaration of 'progmem_log2' was here
       82 | static int32_t progmem_log2(size_t blocksize);
          |                ^~~~~~~~~~~~
    Makefile:118: recipe for target 'mtd_progmem.o' failed
   
   Signed-off-by: Juha Niskanen <ju...@haltian.com>
   
   ## Impact
   No functional change
   ## Testing
   Compile tested only
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] juniskane commented on a change in pull request #2345: drivers/mtd/mtd_progmem.c: fix progmem_log2 parameter type to match prototype

Posted by GitBox <gi...@apache.org>.
juniskane commented on a change in pull request #2345:
URL: https://github.com/apache/incubator-nuttx/pull/2345#discussion_r527653254



##########
File path: drivers/mtd/mtd_progmem.c
##########
@@ -131,7 +131,7 @@ static struct progmem_dev_s g_progmem =
  *
  ****************************************************************************/
 
-static int32_t progmem_log2(uint32_t blocksize)
+static int32_t progmem_log2(size_t blocksize)

Review comment:
       @yamt: I don't think so. The various _ioctl_ function pointers in _include/nuttx/fs/ioctl.h_ and elsewhere have _arg_ as unsigned long because that is supposed to be a generic argument that can represent other things than just sizes of memory areas. 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] xiaoxiang781216 merged pull request #2345: drivers/mtd/mtd_progmem.c: fix progmem_log2 parameter type to match prototype

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 merged pull request #2345:
URL: https://github.com/apache/incubator-nuttx/pull/2345


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] yamt commented on a change in pull request #2345: drivers/mtd/mtd_progmem.c: fix progmem_log2 parameter type to match prototype

Posted by GitBox <gi...@apache.org>.
yamt commented on a change in pull request #2345:
URL: https://github.com/apache/incubator-nuttx/pull/2345#discussion_r527315670



##########
File path: drivers/mtd/mtd_progmem.c
##########
@@ -131,7 +131,7 @@ static struct progmem_dev_s g_progmem =
  *
  ****************************************************************************/
 
-static int32_t progmem_log2(uint32_t blocksize)
+static int32_t progmem_log2(size_t blocksize)

Review comment:
       i guess you should use unsigned long to match https://github.com/apache/incubator-nuttx/blob/23495a7fa26368cde373e7091631de2a1926012b/include/nuttx/mtd/mtd.h#L191




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org