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 AE6D0438E3; Tue, 16 Jan 2024 19:43:39 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id ED85940DF8; Tue, 16 Jan 2024 19:43:18 +0100 (CET) Received: from mail-pl1-f171.google.com (mail-pl1-f171.google.com [209.85.214.171]) by mails.dpdk.org (Postfix) with ESMTP id 84F86406BC for ; Tue, 16 Jan 2024 19:43:15 +0100 (CET) Received: by mail-pl1-f171.google.com with SMTP id d9443c01a7336-1d5f388407bso3993295ad.0 for ; Tue, 16 Jan 2024 10:43:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1705430595; x=1706035395; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=YRy986OZMTK8UPIJueTsaB8x4SlAGbHlq6aruIRYKf4=; b=kTmGbv+KzkqiSYoWkCO9YCR6u3cbX3JQal51Icr//GEx6j7taSNe9S3U4LsAy+JrKY UUuQissmaDCP+uYo2PTEUjnl7kaYJVykxo7V4Dpo9+sJLAfPEKQX+Y1R3igP2QlX0Hxc QWSUoXzfUIWPlgxYWXHVaRugYkfk49ont5YgAEGip4Nimfh2Z+5f4XgK174QxD+lkAMy s4dhuiqj7vLcLaZZV1Q3/JbSYx+G+L0DNV4MLOTk5BFKR9Qtov+1stN68r6ipdNNf8em XfGSNrjrn1ozkk4WrM7Rh7ETZJiZOT07rQKfFntn/cVTMDZbQVYsasVI+KMyVKQsphx9 0rIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705430595; x=1706035395; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=YRy986OZMTK8UPIJueTsaB8x4SlAGbHlq6aruIRYKf4=; b=Elign9MblJJ1a4gZcY5e0FBcaVif/UOjTFL0nQVHYGc5XCY3rHFjB6IHigeEfwEOZ6 UDYpxQnIcfo5GEAouzNROpPLvuG9XXXZOPsnFDPO47pcsggObg+whGquoOLK3AZazCc0 T+mR4OUSp5h8S/TD6bu2ZUGom821PO+3YUcvA6zx1g5oghzfhNQmHGT/7/Xeb0vsHf90 jpISOA65ln9xNuo7frdmCpGvxoAQCq1mcZo1z3vwC9DB3/0GlLP4sa8a3ERyZcib1pCp 4yLo3ibrwpB9LerfChu7s8zDdj4mwKExVKsKAl/ArdPQr+cnJwHyrg6vRtpEAnSgvGK6 cRyg== X-Gm-Message-State: AOJu0YxXR7wIB253fo60fFkySFJb7B5XYZCEcm2bv+XMReesn7Rn4GOr PNUwSaPXHNhnS0ZTvSD4JUUBw6ILkOsTm1duAmKNTKq8momHzg== X-Google-Smtp-Source: AGHT+IFajDVer8Qfy8021aHtr+hr+FIgT4b9xe6lTbO2GDq+WVOhLduGQnFbAFyJtNEvmMreMlWexg== X-Received: by 2002:a17:902:7d82:b0:1d5:36f2:f2f3 with SMTP id a2-20020a1709027d8200b001d536f2f2f3mr4241911plm.33.1705430594795; Tue, 16 Jan 2024 10:43:14 -0800 (PST) Received: from hermes.lan (204-195-123-141.wavecable.com. [204.195.123.141]) by smtp.gmail.com with ESMTPSA id m8-20020a1709026bc800b001d60a70809bsm379238plt.168.2024.01.16.10.43.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jan 2024 10:43:14 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Andrew Rybchenko , =?UTF-8?q?Morten=20Br=C3=B8rup?= Subject: [PATCH v3 4/5] mempool: avoid floating point expression in static assertion Date: Tue, 16 Jan 2024 10:41:14 -0800 Message-ID: <20240116184307.162882-5-stephen@networkplumber.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240116184307.162882-1-stephen@networkplumber.org> References: <20231111172153.57461-1-stephen@networkplumber.org> <20240116184307.162882-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Clang does not handle casts in static_assert() expressions. It doesn't like use of floating point to calculate threshold. Use a different expression with same effect; yes this will cause checkpatch nag. Signed-off-by: Stephen Hemminger --- lib/mempool/rte_mempool.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/mempool/rte_mempool.c b/lib/mempool/rte_mempool.c index b7a19bea7185..ba3a54cfc298 100644 --- a/lib/mempool/rte_mempool.c +++ b/lib/mempool/rte_mempool.c @@ -50,9 +50,7 @@ static void mempool_event_callback_invoke(enum rte_mempool_event event, struct rte_mempool *mp); -#define CACHE_FLUSHTHRESH_MULTIPLIER 1.5 -#define CALC_CACHE_FLUSHTHRESH(c) \ - ((typeof(c))((c) * CACHE_FLUSHTHRESH_MULTIPLIER)) +#define CALC_CACHE_FLUSHTHRESH(c) ((c) + (c) / 2) #if defined(RTE_ARCH_X86) /* -- 2.43.0