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/09/07 06:49:02 UTC

[GitHub] [incubator-nuttx] yangjiukui opened a new pull request #4492: tools/nxstyle: Fix the check tool incorrectly reported no alignment.

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


   ## Summary
   The nxstyle check tool recognizes the division operator as
   a comment. Check the following content to determine whether
   it is a comment.
   
   Change-Id: Id07c6668489895b45a1042794bc3acca66cd3c47
   Signed-off-by: yangjiukui <ya...@xiaomi.com>
   
   ## Impact
   Affect the execution result of /nuttx/tools/checkpatch.sh.
   
   ## Testing
   1. Before modification, report the wrong misalignment.
   code:
   ```
     priv->dev.fifowtm = ROUNDUP(*latency_us, priv->dev.interval)
                       / priv->dev.interval;
   ```
   test:
   ```
   $ ./nuttx/tools/checkpatch.sh -f nuttx/drivers/sensors/<filename>.c 
   $ /nuttx/drivers/sensors/<filename>.c:1525:20: error: Bad alignment
   ```
   2. When the operator is aligned, run the script check and no error will be reported.
   code:
   ```
     priv->dev.fifowtm = ROUNDUP(*latency_us, priv->dev.interval)
                       / priv->dev.interval;
   ```
   3. If it is a single line comment, an error is reported.
   code:
   ```
     priv->dev.fifowtm = ROUNDUP(*latency_us, priv->dev.interval)
                       / priv->dev.interval;
   
                       /* Single-Line Comments. */
   ```
   test:
   ```
   $ ./nuttx/tools/checkpatch.sh -f nuttx/drivers/sensors/<filename>.c
   $ /nuttx/drivers/sensors/<filename>.c:1527:20: error: Bad alignment
   ```
   


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

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

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



[GitHub] [incubator-nuttx] xiaoxiang781216 merged pull request #4492: tools/nxstyle: Fix the check tool incorrectly reported no alignment.

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


   


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

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

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