acassis commented on code in PR #18140:
URL: https://github.com/apache/nuttx/pull/18140#discussion_r2725851130


##########
include/nuttx/trace.h:
##########
@@ -34,273 +34,272 @@
  ****************************************************************************/
 
 #ifdef CONFIG_TRACE
-#  define trace_begin(tag) sched_note_begin(tag)
-#  define trace_end(tag) sched_note_end(tag)
-#  define trace_beginex(tag, name) sched_note_beginex(tag, name)
-#  define trace_endex(tag, name) sched_note_endex(tag, name)
-#  define trace_mark(tag, s) sched_note_mark(tag, s)
-#  define trace_printf(tag, fmt, ...) sched_note_printf(tag, fmt, 
##__VA_ARGS__)
+#define trace_begin(tag) sched_note_begin(tag)
+#define trace_end(tag) sched_note_end(tag)
+#define trace_beginex(tag, name) sched_note_beginex(tag, name)
+#define trace_endex(tag, name) sched_note_endex(tag, name)
+#define trace_mark(tag, s) sched_note_mark(tag, s)
+#define trace_printf(tag, fmt, ...) sched_note_printf(tag, fmt, ##__VA_ARGS__)

Review Comment:
   @aviralgarg05 I think you don't need to fix "#  define"s. The first time I 
saw it in the NuttX kernel I had a strange sensation, like something wrong, but 
it is perfectly valid.
   
   If you look in the source code you will see it is everywhere:
   ```
   $ git grep "#  define" | wc -l
   129647
   ```
   
   And it is perfectly valid and in fact even used in the Linux kernel, see the 
"likely" macro:
   
   https://github.com/torvalds/linux/blob/master/include/linux/compiler.h
   
   There are other places in the Linux kernel where it is used as well, like:
   
   ```
   # ifdef __CHECKER__
   # define __user         __attribute__((noderef, address_space(1)))
   # define __kernel       __attribute__((address_space(0)))
   # define __safe         __attribute__((safe))
   ...
   # endif
   ```
   
   So, unless you want to change all these occurrences in the NuttX kernel 
(believe me they are more than 129647 because there are many levels of 
indentation), I suggest to keep it this way :-)



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to