On 05/25/2017 10:10 AM, Laszlo Ersek wrote:

The canonical way to write this DEBUG invocation is:

   DEBUG ((
     DEBUG_VERBOSE,
     "%a:%a Set C-bit Cr3 %Lx Base %Lx Length %Lx flush %d\n",
     gEfiCallerBaseName,
     __FUNCTION__,
     Cr3BaseAddress,
     PhysicalAddress,
     Length,
     Flush
     ));

(Do not miss the indentation of the closing paren(s)!)

Please refer to <https://bugzilla.tianocore.org/show_bug.cgi?id=425>.

If it all fits on a single line, not exceeding 80 characters, then you
can keep it on a single line.

Otherwise, if you don't fit on a single line, then you have to break
every argument to a separate line. If your format string (or any other
argument) doesn't fit on a line in itself, then you have to break it up
too.

Earlier I'd been using a "meet in the middle" style, where I wouldn't
exceed 80 characters per line, and would indent the continuations by 2
additional spaces, but still wouldn't break each argument to a new line.
Example:

   DEBUG ((DEBUG_VERBOSE,
     "%a:%a Set C-bit Cr3 %Lx Base %Lx Length %Lx flush %d\n",
     gEfiCallerBaseName, __FUNCTION__, Cr3BaseAddress, PhysicalAddress, Length,
     Flush));

In my opinion, this would be the best compromise, since (a) it keeps
lines under 80 chars width, (b) conforms to the indentation requirement,
(c) doesn't waste vertical space like the official layout above.

However, this style had not been approved, and I abandoned it in favor
of the canonical style, when I filed
<https://bugzilla.tianocore.org/show_bug.cgi?id=425>.

I will follow your recommendation. I will wait for Jordan's response
on your IoMmu patch suggestion and include all fixes in  v6.

Thank you so much for feedback.

-Brijesh
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to