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 67676A00BE; Mon, 11 Apr 2022 17:17:51 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0E08A41611; Mon, 11 Apr 2022 17:17:51 +0200 (CEST) Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-eopbgr10050.outbound.protection.outlook.com [40.107.1.50]) by mails.dpdk.org (Postfix) with ESMTP id 1A888415D7 for ; Mon, 11 Apr 2022 17:17:50 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=R79KGGnSpZu8Q/w1p34v0tboUH8NG77aoLgY9436TK9dgtAcNcogE2QqFaGUaEXP0urA0O8DP1sklIcu36+stBp/ETYpj21rjlTfeOO65wqyVaNhYjh+XTnyA1WDblcESi2Kpxpiu/AEIjJkwqOjK7L7Zl0486HLCQxPexhJktXlI73ehwKfCYXo/Br6T0zw1Kt2NKY6I0Fzf1p7BzvpglblgCSWhkNKtE/uUQuxt8QYLqsVIe2NuiVov9xBTdzIQmBKHcA20DM8yuflBPy82gle3mG972xjmgUO8qbXsNWSEqGFx9uNDyDpjHsxyEwcqkCl8inp4APFshPj+RbaaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=V00tsxJT10IGhs6b1/zwptqPSUKuDm371CRj0rD4D60=; b=NzaZoyfq74qo7Gc3C08qdEaV5BNIN1pt1oPpNXBrmOAOn9Pmmz7tnuQZviXasYSFT2bqNSVroQPAWB4jXvlN2siRW9qatR97PEhZTfNdRxtiqhlp1/SAtfSFiEES1N2IWoFQRRTjNaYEqntqoahFwXjbMOhVivcUEhxFwsX3eEGbMKU/W8k5G7x5cditLKflDtWDhzii6athbXLvvOdnPkT8kwDPRhKGZXyAEmNoHEShYLRaUYKU4QDlpo/V82ZE2aznDaJnA3ts0xXpFndYJGwI6wGXRWuUPbww2/iSl5XFiABlpL92uPs0lNsb1n7NF61HGfE56oOTosRaZzIA1g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 192.176.1.74) smtp.rcpttodomain=arm.com smtp.mailfrom=ericsson.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=ericsson.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericsson.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=V00tsxJT10IGhs6b1/zwptqPSUKuDm371CRj0rD4D60=; b=sev8zpBrN0JL/uAXlxr/jw0ZoaM49PfgO/NS2rTtycj4Ag7zW3o7xLc9zZdoC8Nj8kzw/nJWIHeQCLJ/caANUU6/qfEWDqIIGXJ/LXUITwCmW/pv3RMnd+Etb9Akuso6ayWS48fjBvUY0dLD5TOEIhUMQWho5cxsHM0k8llMkcs= Received: from AS9PR06CA0414.eurprd06.prod.outlook.com (2603:10a6:20b:461::26) by AM0PR07MB5793.eurprd07.prod.outlook.com (2603:10a6:208:117::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5164.17; Mon, 11 Apr 2022 15:17:48 +0000 Received: from VE1EUR02FT040.eop-EUR02.prod.protection.outlook.com (2603:10a6:20b:461:cafe::45) by AS9PR06CA0414.outlook.office365.com (2603:10a6:20b:461::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5144.29 via Frontend Transport; Mon, 11 Apr 2022 15:17:48 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 192.176.1.74) smtp.mailfrom=ericsson.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=ericsson.com; Received-SPF: Pass (protection.outlook.com: domain of ericsson.com designates 192.176.1.74 as permitted sender) receiver=protection.outlook.com; client-ip=192.176.1.74; helo=oa.msg.ericsson.com; Received: from oa.msg.ericsson.com (192.176.1.74) by VE1EUR02FT040.mail.protection.outlook.com (10.152.13.217) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.5144.20 via Frontend Transport; Mon, 11 Apr 2022 15:17:47 +0000 Received: from ESESBMB504.ericsson.se (153.88.183.171) by ESESBMR501.ericsson.se (153.88.183.129) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.27; Mon, 11 Apr 2022 17:17:46 +0200 Received: from seliiuapp00218.seli.gic.ericsson.se (153.88.183.153) by smtp.internal.ericsson.com (153.88.183.187) with Microsoft SMTP Server id 15.1.2308.27 via Frontend Transport; Mon, 11 Apr 2022 17:17:46 +0200 Received: from localhost.localdomain (seliicwb00002.seli.gic.ericsson.se [10.156.25.100]) by seliiuapp00218.seli.gic.ericsson.se (Postfix) with ESMTP id 9544760160; Mon, 11 Apr 2022 17:17:46 +0200 (CEST) From: =?UTF-8?q?Mattias=20R=C3=B6nnblom?= To: CC: Bruce Richardson , Thomas Monjalon , David Marchand , , , , Stephen Hemminger , =?UTF-8?q?Mattias=20R=C3=B6nnblom?= Subject: [PATCH 2/3] eal: emit warning for unused trylock return value Date: Mon, 11 Apr 2022 17:15:58 +0200 Message-ID: <20220411151559.164217-2-mattias.ronnblom@ericsson.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220411151559.164217-1-mattias.ronnblom@ericsson.com> References: <20220411151559.164217-1-mattias.ronnblom@ericsson.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8aefa276-91aa-489c-293a-08da1bce6fd8 X-MS-TrafficTypeDiagnostic: AM0PR07MB5793:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: OBJOUQTDcaOAugCg1OlcMKZfehawlzkk3cs1ElYM+9kTQCLj7DZKxxgfLlN6KTpBLz7LM8LJSJMpQH1XLzzIqHzKYpVN6Qtn3GpPxSJn5JpceCkcl1ITyw0zBEZMqLKlEcWcmQD/sqZIK5le1P9hdATCozJsnK3t+yHukOrhyYEPkjW4HRikJy9TSSuJTpUAedD2fSCGbjgq7Jxb10+C0Y2z8fdk/KQpJABWycpFkSFNa+NvDB1kL0f7hlAgl/zs/vAUoieT+P1O/gtbjGSDUxsqUYDksevBLQM1e4J1WViccpUw9LEbqsErWQY05S1oHCHG7uNjDrp4OsLKT+oF2Rs17aedQpB9qbkTy2vls+dsP4Us47GLt1vSDCOqrF32bRqBUAzjIE0MtRbisOE2zXud8edpX1bFOkJ9CFjUp75monsUsf+PEYsaC0Pkvh6GEtgWZwwB+TozPeTdUqI4EicIleFpwZSWkAkGnxYAhCkJJMSXz+O6DXaJFXQ05upWv/bVAV4+TxyzUPyN8CnoRO6fZkWtrpiFxw2xv9NV40OdTRToEaeIAmc3IxtyBV4HPBA0xceUGGBI8DjKz0UpwyaZgm5aE34HvI9YxcgiUiZckuskVaLpxk/tT4C2NIK+lwts5KhCPAo1mhC+AMkH/QRMp+oI9XGlpyepSD5OI/R3dMWu0/MhU57fhjz/PMOn X-Forefront-Antispam-Report: CIP:192.176.1.74; CTRY:SE; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:oa.msg.ericsson.com; PTR:office365.se.ericsson.net; CAT:NONE; SFS:(13230001)(4636009)(40470700004)(46966006)(36840700001)(508600001)(86362001)(316002)(54906003)(6916009)(336012)(83380400001)(66574015)(6666004)(36756003)(7636003)(36860700001)(40460700003)(356005)(82960400001)(82310400005)(2616005)(107886003)(1076003)(2906002)(70206006)(5660300002)(70586007)(47076005)(8676002)(186003)(8936002)(4326008)(26005)(6266002); DIR:OUT; SFP:1101; X-OriginatorOrg: ericsson.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Apr 2022 15:17:47.9371 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8aefa276-91aa-489c-293a-08da1bce6fd8 X-MS-Exchange-CrossTenant-Id: 92e84ceb-fbfd-47ab-be52-080c6b87953f X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=92e84ceb-fbfd-47ab-be52-080c6b87953f; Ip=[192.176.1.74]; Helo=[oa.msg.ericsson.com] X-MS-Exchange-CrossTenant-AuthSource: VE1EUR02FT040.eop-EUR02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR07MB5793 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 Mark the trylock family of spinlock functions with __rte_warn_unused_result. Acked-by: Bruce Richardson Signed-off-by: Mattias Rönnblom --- lib/eal/include/generic/rte_spinlock.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/eal/include/generic/rte_spinlock.h b/lib/eal/include/generic/rte_spinlock.h index 40fe49d5ad..73ed4bfbdc 100644 --- a/lib/eal/include/generic/rte_spinlock.h +++ b/lib/eal/include/generic/rte_spinlock.h @@ -97,6 +97,7 @@ rte_spinlock_unlock (rte_spinlock_t *sl) * @return * 1 if the lock is successfully taken; 0 otherwise. */ +__rte_warn_unused_result static inline int rte_spinlock_trylock (rte_spinlock_t *sl); @@ -174,6 +175,7 @@ rte_spinlock_unlock_tm(rte_spinlock_t *sl); * 1 if the hardware memory transaction is successfully started * or lock is successfully taken; 0 otherwise. */ +__rte_warn_unused_result static inline int rte_spinlock_trylock_tm(rte_spinlock_t *sl); @@ -243,6 +245,7 @@ static inline void rte_spinlock_recursive_unlock(rte_spinlock_recursive_t *slr) * @return * 1 if the lock is successfully taken; 0 otherwise. */ +__rte_warn_unused_result static inline int rte_spinlock_recursive_trylock(rte_spinlock_recursive_t *slr) { int id = rte_gettid(); @@ -299,6 +302,7 @@ static inline void rte_spinlock_recursive_unlock_tm( * 1 if the hardware memory transaction is successfully started * or lock is successfully taken; 0 otherwise. */ +__rte_warn_unused_result static inline int rte_spinlock_recursive_trylock_tm( rte_spinlock_recursive_t *slr); -- 2.25.1