From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 8D7AE43FB9; Sun, 5 May 2024 20:44:00 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1F9D1400EF; Sun, 5 May 2024 20:44:00 +0200 (CEST) Received: from mail-oa1-f54.google.com (mail-oa1-f54.google.com [209.85.160.54]) by mails.dpdk.org (Postfix) with ESMTP id 7E5B540041 for ; Sun, 5 May 2024 20:43:58 +0200 (CEST) Received: by mail-oa1-f54.google.com with SMTP id 586e51a60fabf-23e78ef3de7so686558fac.1 for ; Sun, 05 May 2024 11:43:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714934637; x=1715539437; darn=dpdk.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=712jteid7QNX0j5kfZ8f1VbGznX/QwCXlUwAk6eft28=; b=gn2ZvTkmbbXexYafU5WF/5fiwSsHZ1Qpu/PgPKFfArjoX2MAjrJtjKYhlqInxOySwq 4h84EEhacrvxHqhRhLTHCHbY7DpqBpAzb5cDBGln0y6B7DKvYtXAlCAHnWaBJ7BuiN5e ZGUQiMWFOLDRbVXMPtqxOfBL6r20euQJxhCjPtVrPvmgkOFsGL82JW1Pk0XyRRTv1/+N r/t40cWrGOTO8EtF+wp+sXhc7m5auG7dtUScssr/+50smxKXiPctvt6KYwKZ79xjireA p86b80oVQotEoM74gvOJXxoI6/0Wbgq3lxqW81dRWfTGgfYx8Ko1ae8OEDPPxukfZ+zn bBNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714934637; x=1715539437; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=712jteid7QNX0j5kfZ8f1VbGznX/QwCXlUwAk6eft28=; b=eHwSDKA0ou5M87uKXgqBZoMGqZhAYnDYdKuKH4NINQqYRAjeov41RXpJVnbj/JUVFu A5SmjSuItfQHyBPAwF4EdgQyY62SBHbtDtwxaIn98XYVHhClytb2M/ro9LE5ThK0S2CO at/TZ65QO4uPVYgHqCxyPqTeAPryUmAEQBv9zTRoC1wSGlH0D3XLuw9liKfZ5zwrWwtH 8R4VWkUB/KNHMdWIiUe/lJgcZhkP8MbgXg+kfwiDbotEzHqNuToCX2oNslUKdd5T6d/q mDgO8PEn5YZp3SClUYW/5Rg5sYfqT7QUDTi2QT1Dnd2UZWO7yCleaSVcWG2r6OLWlh27 3p9A== X-Gm-Message-State: AOJu0YxcgCCvXtdtdj2JgJsnzOH2wH4fWOHmT/t1GVnJzFuqU/pBNQZz zSz7mDTAwgJdyRVYGdT3ZXnG1nKE1kz0U+36Lh3NTmklWENSOmCKle2GA44MVxPv/4W2AyIAybJ SKsNI9Qcrw1RiwLFcb5E+WoRWcaNz+ZYWawo= X-Google-Smtp-Source: AGHT+IF5uNTzJIySrblJbpFbebSd70Vh56i3rL5d5mDI0k8aQgj+1iNs7kcGUvvFqyw4KFllZhfBpC1qUNYmc5cHZ28= X-Received: by 2002:a05:6870:6e10:b0:234:56f5:cf16 with SMTP id qt16-20020a0568706e1000b0023456f5cf16mr12170538oab.32.1714934637502; Sun, 05 May 2024 11:43:57 -0700 (PDT) MIME-Version: 1.0 References: <20240504191837.1096185-1-aomeryamac@gmail.com> <20240505091855.6364eaf6@hermes.local> In-Reply-To: <20240505091855.6364eaf6@hermes.local> From: =?UTF-8?B?QWJkdWxsYWggw5ZtZXIgWWFtYcOn?= Date: Sun, 5 May 2024 21:43:48 +0300 Message-ID: Subject: Re: [PATCH v3] devtools: add .clang-format file To: Stephen Hemminger Cc: dev@dpdk.org Content-Type: multipart/alternative; boundary="000000000000e1a8ca0617b95546" X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org --000000000000e1a8ca0617b95546 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sun, May 5, 2024 at 7:18=E2=80=AFPM Stephen Hemminger wrote: > On Sat, 4 May 2024 19:18:37 +0000 > Abdullah =C3=96mer Yama=C3=A7 wrote: > > > clang-format is a tool to format C/C++/Objective-C code. It can be used > > to reformat code to match a given coding style, or to ensure that code > > adheres to a specific coding style. It helps to maintain a consistent > > coding style across the DPDK codebase. > > > > .clang-format file overrides the default style options provided by > > clang-format and large set of IDEs and text editors support it. > > > > Signed-off-by: Abdullah =C3=96mer Yama=C3=A7 > > --- > > .clang-format | 138 ++++++++++++++++++++++++++++++++++++++++++++++++++ > > 1 file changed, 138 insertions(+) > > create mode 100644 .clang-format > > Tried this, but it needs some change to how braces at start of function > are handled. For example, this is not how DPDK should look: > Are the changes below ok? When I fix these cases, some macros are also formatted in the same manner. -#define RTE_RX_OFFLOAD_BIT2STR(_name) \ - { RTE_ETH_RX_OFFLOAD_##_name, #_name } +#define RTE_RX_OFFLOAD_BIT2STR(_name) \ + { \ + RTE_ETH_RX_OFFLOAD_##_name, #_name \ + } > > static int > -rte_pmd_tap_remove(struct rte_vdev_device *dev) > -{ > +rte_pmd_tap_remove(struct rte_vdev_device *dev) { > struct rte_eth_dev *eth_dev =3D NULL; > > /* find the ethdev entry */ > --000000000000e1a8ca0617b95546 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Sun, May 5, 2024 at 7:18=E2=80=AFP= M Stephen Hemminger <steph= en@networkplumber.org> wrote:
On Sat,=C2=A0 4 May 2024 19:18:37 +0000
Abdullah =C3=96mer Yama=C3=A7 <aomeryamac@gmail.com> wrote:

> clang-format is a tool to format C/C++/Objective-C code. It can be use= d
> to reformat code to match a given coding style, or to ensure that code=
> adheres to a specific coding style. It helps to maintain a consistent<= br> > coding style across the DPDK codebase.
>
> .clang-format file overrides the default style options provided by
> clang-format and large set of IDEs and text editors support it.
>
> Signed-off-by: Abdullah =C3=96mer Yama=C3=A7 <aomeryamac@gmail.com>
> ---
>=C2=A0 .clang-format | 138 ++++++++++++++++++++++++++++++++++++++++++++= ++++++
>=C2=A0 1 file changed, 138 insertions(+)
>=C2=A0 create mode 100644 .clang-format

Tried this, but it needs some change to how braces at start of function
are handled.=C2=A0 For example, this is not how DPDK should look:
Are the changes below ok? When I fix these cases, some macros a= re also formatted in the same manner.

-#define RTE_RX_OFFLOAD_BIT2ST= R(_name) \
- { RTE_ETH_RX_OFFLOAD_##_name, #_name }
+#define RTE_RX_O= FFLOAD_BIT2STR(_name) =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0\
= + { =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0\
+ RTE_ETH_RX_OFFLOAD_##_name, #_name \
+ }
=C2=A0

=C2=A0static int
-rte_pmd_tap_remove(struct rte_vdev_device *dev)
-{
+rte_pmd_tap_remove(struct rte_vdev_device *dev) {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 struct rte_eth_dev *eth_dev =3D NULL;

=C2=A0 =C2=A0 =C2=A0 =C2=A0 /* find the ethdev entry */
--000000000000e1a8ca0617b95546--