From: "Abdullah Ömer Yamaç" <aomeryamac@gmail.com>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: dev@dpdk.org
Subject: Re: [PATCH v3] devtools: add .clang-format file
Date: Mon, 6 May 2024 13:43:31 +0300 [thread overview]
Message-ID: <CA+sj1i9RvD5o7sczf_aVjjo+5P=P0UzL=8hEe9qc92VSQsqpjw@mail.gmail.com> (raw)
In-Reply-To: <20240505133836.4711bad3@hermes.local>
[-- Attachment #1: Type: text/plain, Size: 2716 bytes --]
On Sun, May 5, 2024 at 11:38 PM Stephen Hemminger <
stephen@networkplumber.org> wrote:
> On Sun, 5 May 2024 22:42:57 +0300
> Abdullah Ömer Yamaç <aomeryamac@gmail.com> wrote:
>
> > > Also, this looks wrong. The initialized arrays looked better before.
> > >
> > >
> > > -static const char *tuntap_types[ETH_TUNTAP_TYPE_MAX] = {
> > > - "UNKNOWN", "TUN", "TAP"
> > > -};
> > > +static const char *tuntap_types[ETH_TUNTAP_TYPE_MAX] = {"UNKNOWN",
> "TUN",
> > > "TAP"};
> > >
> > > -static const char *valid_arguments[] = {
> > > - ETH_TAP_IFACE_ARG,
> > > - ETH_TAP_REMOTE_ARG,
> > > - ETH_TAP_MAC_ARG,
> > > - ETH_TAP_PERSIST_ARG,
> > > - NULL
> > > -};
> > > +static const char *valid_arguments[] = {ETH_TAP_IFACE_ARG,
> > > ETH_TAP_REMOTE_ARG, ETH_TAP_MAC_ARG,
> > > + ETH_TAP_PERSIST_ARG, NULL};
> > >
> >
> > I am confused about these variables. tuntap_types list values in a
> single
> > line, but valid_arguments' values are listed separately.
> > So, it is getting more complex to handle both of them. What should we do,
> > do you have any idea?
>
> Ignore the initialized lists for now. It should be possible to have it
> generate something
> like
>
> static const char *tuntap_types[ETH_TUNTAP_TYPE_MAX] = {
> "UNKNOWN", "TUN", "TAP"
> };
>
> With the following changes result looks better. You got the format wrong
> for the ForEach list.
>
> diff --git a/.clang-format b/.clang-format
> index 16164ef1de..d16185c049 100644
> --- a/.clang-format
> +++ b/.clang-format
> @@ -1,12 +1,20 @@
> ---
> BasedOnStyle: LLVM
>
> +AttributeMacros:
> + - __rte_aligned
> + - __rte_packed
> + - __rte_may_alias
> + - __rte_deprecated
> + - __rte_weak
> + - __rte_unused
> + - __rte_restrict
> +
> # Place opening and closing parentheses on the same line for control
> statements
> BreakBeforeBraces: Custom
> BraceWrapping:
> - AfterFunction: false
> + AfterFunction: true
> AfterControlStatement: false
> - AfterEnum: false
>
> These are ok for me.
> # Set maximum line length to 100 characters
> ColumnLimit: 100
> @@ -41,98 +49,117 @@ AlwaysBreakAfterReturnType: TopLevelDefinitions
> # Always break before multiline string literals
> AlignEscapedNewlines: Left
>
> -# Foreach macros
>
In the clang documentation, it says "ForEachMacros (List of Strings)" and
gives an example: "ForEachMacros: ['RANGES_FOR', 'FOREACH']"
> ...
> +ObjCSpaceAfterProperty: true
> +IndentGotoLabels: false
>
These are also ok for me.
If you agree on the for-each part, then I will send the new patch.
Thanks
[-- Attachment #2: Type: text/html, Size: 3868 bytes --]
next prev parent reply other threads:[~2024-05-06 10:43 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-29 13:04 [PATCH] " Abdullah Ömer Yamaç
2024-04-29 13:32 ` Ferruh Yigit
2024-04-29 15:36 ` Stephen Hemminger
2024-04-29 15:43 ` Stephen Hemminger
2024-05-04 13:38 ` Abdullah Ömer Yamaç
2024-05-04 13:41 ` [PATCH v2] " Abdullah Ömer Yamaç
2024-05-04 16:27 ` Stephen Hemminger
2024-05-04 18:18 ` Abdullah Ömer Yamaç
2024-05-04 19:18 ` [PATCH v3] " Abdullah Ömer Yamaç
2024-05-05 16:18 ` Stephen Hemminger
2024-05-05 18:43 ` Abdullah Ömer Yamaç
2024-05-05 16:20 ` Stephen Hemminger
2024-05-05 19:42 ` Abdullah Ömer Yamaç
2024-05-05 20:38 ` Stephen Hemminger
2024-05-06 10:43 ` Abdullah Ömer Yamaç [this message]
2024-05-08 21:19 ` [PATCH v4] " Abdullah Ömer Yamaç
2024-05-13 13:08 ` Ferruh Yigit
2024-05-13 15:55 ` Stephen Hemminger
2024-05-13 19:11 ` Morten Brørup
2024-05-14 7:56 ` Bruce Richardson
2024-05-14 16:59 ` Tyler Retzlaff
2024-05-15 8:28 ` Abdullah Ömer Yamaç
2024-05-15 8:43 ` Bruce Richardson
2024-05-15 10:19 ` Abdullah Ömer Yamaç
2024-05-15 11:41 ` Bruce Richardson
2024-05-15 15:07 ` Stephen Hemminger
2024-05-15 20:32 ` Abdullah Ömer Yamaç
2024-05-16 8:20 ` [PATCH v5] " Abdullah Ömer Yamaç
2024-05-17 9:30 ` Bruce Richardson
2024-04-30 21:27 ` [PATCH] " Abdullah Ömer Yamaç
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CA+sj1i9RvD5o7sczf_aVjjo+5P=P0UzL=8hEe9qc92VSQsqpjw@mail.gmail.com' \
--to=aomeryamac@gmail.com \
--cc=dev@dpdk.org \
--cc=stephen@networkplumber.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).