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 2021/03/17 14:51:36 UTC

[GitHub] [incubator-nuttx] JON95Git opened a new pull request #3088: samv7: Fix sam_putreg() parameter type

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


   ## Summary
   Changes the second parameter of `sam_putreg()` in `sam_usbdevhs.c` from `uintptr_t` to `uint32_t`, to avoid compilation error
   ## Impact
   Allows to build USB device configurations for SAMv7 boards
   ## Testing
   With no changes, compilation for SAMv7 with USB device will fail
   


----------------------------------------------------------------
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 #3088: samv7: Fix sam_putreg() parameter type

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


   


-- 
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 commented on pull request #3088: samv7: Fix sam_putreg() parameter type

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on pull request #3088:
URL: https://github.com/apache/incubator-nuttx/pull/3088#issuecomment-801586386


   @JON95Git as the community agreement, the contributor has to fix the coding style in the code even it isn't introduced by the patch self. So could you please fix the warning report here:
   https://github.com/apache/incubator-nuttx/pull/3088/checks?check_run_id=2132523726
   You can run this command verify locally before updating the PR:
   ```
   ./tools/checkpatch.sh -g HEAD~...HEAD
   ```
   Thanks for your contribution!


----------------------------------------------------------------
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 commented on a change in pull request #3088: samv7: Fix sam_putreg() parameter type

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



##########
File path: arch/arm/src/samv7/sam_usbdevhs.c
##########
@@ -457,8 +457,8 @@ static uint32_t sam_getreg(uintptr_t regaddr);
 static void   sam_putreg(uint32_t regval, uintptr_t regaddr);
 static void   sam_dumpep(struct sam_usbdev_s *priv, int epno);
 #else
-static inline uint32_t sam_getreg(uintptr_t regaddr);
-static inline void sam_putreg(uint32_t regval, uintptr_t regaddr);
+static inline uint32_t sam_getreg(uint32_t regaddr);
+static inline void sam_putreg(uint32_t regval, uint32_t regaddr);

Review comment:
       let's keep the inline and non-inline with the same prototype, but fix the sam_getreg/sam_putreg prototype at line 856.




----------------------------------------------------------------
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 commented on a change in pull request #3088: samv7: Fix sam_putreg() parameter type

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



##########
File path: arch/arm/src/samv7/sam_usbdevhs.c
##########
@@ -458,7 +458,7 @@ static void   sam_putreg(uint32_t regval, uintptr_t regaddr);
 static void   sam_dumpep(struct sam_usbdev_s *priv, int epno);
 #else
 static inline uint32_t sam_getreg(uintptr_t regaddr);
-static inline void sam_putreg(uint32_t regval, uintptr_t regaddr);

Review comment:
       But, other similar functions(e.g. sam_getreg) can pass the build even it use uintptr_t. My question is that why only sam_putreg fail to compile. Could you point me which line fail to compile and the detailed error message?




----------------------------------------------------------------
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] JON95Git commented on a change in pull request #3088: samv7: Fix sam_putreg() parameter type

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



##########
File path: arch/arm/src/samv7/sam_usbdevhs.c
##########
@@ -458,7 +458,7 @@ static void   sam_putreg(uint32_t regval, uintptr_t regaddr);
 static void   sam_dumpep(struct sam_usbdev_s *priv, int epno);
 #else
 static inline uint32_t sam_getreg(uintptr_t regaddr);
-static inline void sam_putreg(uint32_t regval, uintptr_t regaddr);

Review comment:
       My bad, `sam_getreg()` also fail to compile without changes. I just forget to commit:
   
   ```
   CC:  chip/sam_usbdevhs.c
   chip/sam_usbdevhs.c:830:24: error: conflicting types for 'sam_getreg'
    static inline uint32_t sam_getreg(uint32_t regaddr)
                           ^~~~~~~~~~
   chip/sam_usbdevhs.c:460:24: note: previous declaration of 'sam_getreg' was here
    static inline uint32_t sam_getreg(uintptr_t regaddr);
                           ^~~~~~~~~~
   chip/sam_usbdevhs.c:856:20: error: conflicting types for 'sam_putreg'
    static inline void sam_putreg(uint32_t regval, uint32_t regaddr)
                       ^~~~~~~~~~
   chip/sam_usbdevhs.c:461:20: note: previous declaration of 'sam_putreg' was here
    static inline void sam_putreg(uint32_t regval, uintptr_t regaddr);
   ```




----------------------------------------------------------------
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 commented on pull request #3088: samv7: Fix sam_putreg() parameter type

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on pull request #3088:
URL: https://github.com/apache/incubator-nuttx/pull/3088#issuecomment-805475613


   @JON95Git please squash your patchset into one, thanks.


-- 
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 commented on a change in pull request #3088: samv7: Fix sam_putreg() parameter type

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



##########
File path: arch/arm/src/samv7/sam_usbdevhs.c
##########
@@ -458,7 +458,7 @@ static void   sam_putreg(uint32_t regval, uintptr_t regaddr);
 static void   sam_dumpep(struct sam_usbdev_s *priv, int epno);
 #else
 static inline uint32_t sam_getreg(uintptr_t regaddr);
-static inline void sam_putreg(uint32_t regval, uintptr_t regaddr);

Review comment:
       Ok, the better fix is correct the prototype at line 856:
   ```
   static inline void sam_putreg(uint32_t regval, uintptr_t regaddr)
   ```

##########
File path: arch/arm/src/samv7/sam_usbdevhs.c
##########
@@ -458,7 +458,7 @@ static void   sam_putreg(uint32_t regval, uintptr_t regaddr);
 static void   sam_dumpep(struct sam_usbdev_s *priv, int epno);
 #else
 static inline uint32_t sam_getreg(uintptr_t regaddr);
-static inline void sam_putreg(uint32_t regval, uintptr_t regaddr);

Review comment:
       Ok, the better fix is correct the prototype at line 856 not here:
   ```
   static inline void sam_putreg(uint32_t regval, uintptr_t regaddr)
   ```




----------------------------------------------------------------
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