Re: [PATCH] trace-cmd: Add CODING_STYLE and CONTRIBUTE documents

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Steven,

On 5.04.21 г. 22:19, Steven Rostedt wrote:
Unless variables are tightly related, it is expected that each variable be on
+its own line and not grouped by type. That is,
+
+		int r, cpus = 0;
+
+is to be discouraged, as the two variables are not related to each other.
+But if you had a bunch of counters:
+
+		int i, j, k;
+
+That would be fine, as the variables are all related as they are all for the
+same purpose (arbitrary counters). The same may go with pointers;
+
+
+	char *begin, *end;
+

Maybe we should include an explanation what to do in cases like this:

        struct instance_wrapper *iw, **iw_ptr;


Let's say, the two are closely related in the code of the function, however technically speaking the types are different. Is it OK to have both on the same line?

Thanks!

Yordan





[Index of Archives]     [Linux USB Development]     [Linux USB Development]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux