Hi Steve,

On 2025/7/23 08:25, Steven Rostedt wrote:
+       TP_STRUCT__entry(__string(name, dev->name ?: "unknown") __field(
+               unsigned int, type) __field(unsigned int, code)
+                                __field(int, value) __field(u16, bustype)
+                                        __field(u16, vendor)
+                                                __field(u16, product)),
+
The contents of the tracepoints in the subsystems are determined by the
subsystem maintainers, but please follow the tracepoint formatting. The
above is horrible. It should look like a structure layout. One wouldn't
write:

struct entry { char *name;
                unsigned int type; unsigned int code;
                        int value; u16 bustype;
                                u16 vendor;
                                        u16 product; };

That's what the above looks like. It should be instead:

        TP_STRUCT__entry(
                __string(       name,           dev->name ?: "unknown"     )
                __field(        unsigned int,   type                    )
                __field(        unsigned int,   code                    )
                __field(        int,            value                   )
                __field(        u16,            bustype                 )
                __field(        u16,            vendor                  )
                __field(        u16,            product                 )
        ),

So the fields can be easily visible and easily reviewed.

My apologies.

Since this was a new file I added, I didn't carefully check it after applying clang-format, which led to this issue.

I'll fix the code formatting and send a patch v2.

--
WangYuli*
*

Attachment: OpenPGP_0xC5DA1F3046F40BEE.asc
Description: OpenPGP public key

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature

Reply via email to