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 C7239A0542; Fri, 4 Nov 2022 13:13:42 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 62BB142D10; Fri, 4 Nov 2022 13:13:42 +0100 (CET) Received: from smartserver.smartsharesystems.com (smartserver.smartsharesystems.com [77.243.40.215]) by mails.dpdk.org (Postfix) with ESMTP id 2EA3A42D0E for ; Fri, 4 Nov 2022 13:13:41 +0100 (CET) X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: Help with macro Date: Fri, 4 Nov 2022 13:13:38 +0100 Message-ID: <98CBD80474FA8B44BF855DF32C47DC35D87485@smartserver.smartshare.dk> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Help with macro Thread-Index: AdjwRt75c1r2+LH5QAKbMKT2R4SdTg== From: =?iso-8859-1?Q?Morten_Br=F8rup?= To: 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 With this macro: #define RTE_MEMPOOL_CACHE_STAT_ADD(cache, name, n) do { \ (cache)->stats.name +=3D n; \ } while (0) checkpatch complained: WARNING:SINGLE_STATEMENT_DO_WHILE_MACRO: Single = statement macros should not use a do {} while (0) loop So I reluctantly changed it to this: #define RTE_MEMPOOL_CACHE_STAT_ADD(cache, name, n) (cache)->stats.name = +=3D n and checkpatch complained: ERROR:COMPLEX_MACRO: Macros with complex = values should be enclosed in parentheses Any suggestions for how to define this macro, without checkpatch = throwing a fit? Med venlig hilsen / Kind regards, -Morten Br=F8rup