<div dir="ltr"><div dir="ltr">I want to update you. </div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, May 13, 2024 at 4:08 PM Ferruh Yigit <<a href="mailto:ferruh.yigit@amd.com">ferruh.yigit@amd.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 5/8/2024 10:19 PM, Abdullah Ömer Yamaç wrote:<br>
> clang-format is a tool to format C/C++/Objective-C code. It can be used<br>
> to reformat code to match a given coding style, or to ensure that code<br>
> adheres to a specific coding style. It helps to maintain a consistent<br>
> coding style across the DPDK codebase.<br>
> <br>
> .clang-format file overrides the default style options provided by<br>
> clang-format and large set of IDEs and text editors support it.<br>
> <br>
> Signed-off-by: Abdullah Ömer Yamaç <<a href="mailto:aomeryamac@gmail.com" target="_blank">aomeryamac@gmail.com</a>><br>
><br>
<br>
Hi Omer,<br>
<br>
I tried on ethdev.c (clang-format -i ./lib/ethdev/rte_ethdev.c), I will<br>
highlight a few issues below (not all of them), I hope it is OK to<br>
continue step by step, fixing these issues.<br>
<br>
1. clang format failed for following options, not sure why, am I using a<br>
wrong version:<br>
LineEnding: LF<br>
InsertNewlineAtEOF: true<br>
<br>
I commented them out to continue the test.<br>
<br>
And for 'ColumnLimit', I prefer default 80 with the flexibility to go<br>
100 when makes sense, so I will got with 'ColumnLimit: 80'; but I don't<br>
want to start this discussion.<br>
<br></blockquote><div>In the .editorconfig file, 100 is stated as a max_line_length. That's why I prefer 100. </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
2. Double tab indentation vs parenthesis align<br>
         if (iter->bus != NULL &&<br>
 -                       /* not in middle of rte_eth_dev iteration, */<br>
 -                       iter->class_device == NULL) {<br>
 +           /* not in middle of rte_eth_dev iteration, */<br>
 +           iter->class_device == NULL) {<br>
<br>
DPDK coding guide suggests double tab, but also accepts alignment by<br>
spaces. But as far as I can see most of code has double tab.<br>
Majority of the diff caused because of this rule.<br>
<br></blockquote><div>Still, some discussions are going on </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
3. enum merged into single line<br>
 -enum {<br>
 -       STAT_QMAP_TX = 0,<br>
 -       STAT_QMAP_RX<br>
 -};<br>
 +enum { STAT_QMAP_TX = 0, STAT_QMAP_RX };<br>
<br></blockquote><div>This is ok; I will send a new patch for it. </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
4. split message strings<br>
 - RTE_ETHDEV_LOG_LINE(ERR,<br>
 -         "Cannot initialize iterator from NULL device description<br>
string");<br>
 + RTE_ETHDEV_LOG_LINE(ERR, "Cannot initialize iterator from NULL "<br>
 +                          "device description string");<br>
<br>
<br>
5. Empty open parenthesis<br>
 -       RTE_ETHDEV_LOG_LINE(ERR,<br>
 -               "Cannot get next device from NULL iterator");<br>
 +       RTE_ETHDEV_LOG_LINE(<br>
 +               ERR, "Cannot get next device from NULL iterator");<br>
<br></blockquote><div>I couldn't find a solution, so I am still working on it. </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
6. space before macro arguments<br>
-       RTE_ETH_FOREACH_DEV(p)<br>
+       RTE_ETH_FOREACH_DEV (p)<br>
<br></blockquote><div>This is ok. The fix will be in the next patch.</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
7. some lists get merged (this seems similar to 3.)<br>
 -               RTE_PTYPE_L2_MASK,<br>
 -               RTE_PTYPE_L3_MASK,<br>
 -               RTE_PTYPE_L4_MASK,<br>
 -               RTE_PTYPE_TUNNEL_MASK,<br>
 -               RTE_PTYPE_INNER_L2_MASK,<br>
 -               RTE_PTYPE_INNER_L3_MASK,<br>
 +               RTE_PTYPE_L2_MASK,       RTE_PTYPE_L3_MASK,<br>
 +               RTE_PTYPE_L4_MASK,       RTE_PTYPE_TUNNEL_MASK,<br>
 +               RTE_PTYPE_INNER_L2_MASK, RTE_PTYPE_INNER_L3_MASK,<br>
<br></blockquote><div>I couldn't find a configuration that aligns with array initialization.</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
<br>
Thanks,<br>
ferruh<br>
</blockquote></div></div>