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 00397A00BE; Sun, 10 Apr 2022 15:52:57 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D95C7410F6; Sun, 10 Apr 2022 15:52:57 +0200 (CEST) Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-eopbgr140045.outbound.protection.outlook.com [40.107.14.45]) by mails.dpdk.org (Postfix) with ESMTP id C2AC240042 for ; Sun, 10 Apr 2022 15:52:56 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mXEpMEpPStq7CCAID7QzPlHCbMVwoc0Y2Cvutrwdk5uDx8ch7NIDlVbMW8XfRDjcMQypA6cKhyeCVCcXRkXF+ksIRfqmShgDeMt8aFKdoi8DCfLntoNzFu+Wlz3ahETYasHzjUWDUvbkXSLnu3v9H/+mS0qhX3T4Epgb6HcnUyTSLC/iF8QPJKdKXElK0keql8ks5x1PY7TVx5sEYuShSOUab7LzIVDPk1BXvc1wJ3HpeWMkI99TJuC7/5KRCKhX8DRtQWPQMCkuYcirDcUipT8dUgh/nZqrFaZSDvibYd/CgMo4A3D6PaICDriVVdOm5i1l/ahxsTBYYb8Ya+DJcg== 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=2qlmkWimIBctx47lWnPfIHW8NMKMbKlpDqe9RmA18hg=; b=CMmBNSf0mkgTWVCFD0mahaClSv/PlHy5kmWWGF5XmKkPZol0p/jCQKahAJQzss4fIFypqW5/zZuK3jLEJmOgSzZL38Y58pR8dif0a0w0/I+Me1nKm7vI7GLrnYdKsQtOhb+33KMVE6wShEnMSVimh9sE5rIFO/TxrVyCAyZTIXmLHpBGcbAodl0JC6RYOLCGcax9Tz/P8Z5/i29SdS+4DOQtlHrFd2CZWGCxpZuNwUP0QAmXikvhrhzZZbkOsooVNS6cDQ+DstYI12QJO5Wj03Bf1WLkwCtbkM/n27RtvCo/MmzTANYZyvuLLqIrE0JUfVjKUaDhPNoP+uSA6gNMGQ== 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=2qlmkWimIBctx47lWnPfIHW8NMKMbKlpDqe9RmA18hg=; b=RvUfSzlEkuSaMvIxbhCsK+DPi+Y/NgzA1KEa7FXkBfr8/oiHYQDSlSIcTtv6lDp6AuPUCiOvfC9TOmEPTdxGRNYmtRZhxa1pqvTnRwoNCQq0UfLaRSkKXDbwVmHJ6xJyxIvVqzIH3Yeu8f84CssGZOFTxclU1YnVLU0TouSdh/w= Received: from AM5PR1001CA0066.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:206:15::43) by HE1PR07MB3115.eurprd07.prod.outlook.com (2603:10a6:7:31::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5144.29; Sun, 10 Apr 2022 13:52:55 +0000 Received: from VE1EUR02FT065.eop-EUR02.prod.protection.outlook.com (2603:10a6:206:15:cafe::b1) by AM5PR1001CA0066.outlook.office365.com (2603:10a6:206:15::43) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5144.29 via Frontend Transport; Sun, 10 Apr 2022 13:52:55 +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 VE1EUR02FT065.mail.protection.outlook.com (10.152.13.69) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.5144.20 via Frontend Transport; Sun, 10 Apr 2022 13:52:54 +0000 Received: from ESESSMB505.ericsson.se (153.88.183.166) by ESESSMR503.ericsson.se (153.88.183.112) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.27; Sun, 10 Apr 2022 15:52:54 +0200 Received: from ESESBMB503.ericsson.se (153.88.183.170) by ESESSMB505.ericsson.se (153.88.183.166) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.27; Sun, 10 Apr 2022 15:52:54 +0200 Received: from seliiuapp00218.seli.gic.ericsson.se (153.88.183.153) by smtp.internal.ericsson.com (153.88.183.186) with Microsoft SMTP Server id 15.1.2308.27 via Frontend Transport; Sun, 10 Apr 2022 15:52:53 +0200 Received: from localhost.localdomain (seliicwb00002.seli.gic.ericsson.se [10.156.25.100]) by seliiuapp00218.seli.gic.ericsson.se (Postfix) with ESMTP id 44A4E601CB; Sun, 10 Apr 2022 15:52:54 +0200 (CEST) From: =?UTF-8?q?Mattias=20R=C3=B6nnblom?= To: CC: Thomas Monjalon , David Marchand , , , , =?UTF-8?q?Mattias=20R=C3=B6nnblom?= Subject: [RFC 2/3] eal: emit warning for unused trylock return value Date: Sun, 10 Apr 2022 15:51:39 +0200 Message-ID: <20220410135140.161842-2-mattias.ronnblom@ericsson.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220410135140.161842-1-mattias.ronnblom@ericsson.com> References: <20220410135140.161842-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: 189d6775-959b-4e5b-8804-08da1af969cd X-MS-TrafficTypeDiagnostic: HE1PR07MB3115: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: +EKig2DEAism31yxF0tFBfZUECC3ssXN4m9lbcMmrwrfyzkM8QtmAUfKviybEOxr3Jz4MNgDZmprYrznZeywkj6htnXyxI07vwiHozd+iLhJX8toawYbwV1ReiBRSPBaf/lGQaXa/4PRyr7mOAK7m0CpELJwLeCFaHAEegVOZYESFhsaGM8+yW9QQH8Ytkzuf5RrFCxq/crKsWA+8cpefeenX/lBDUI7WG8/8ZVgQm8OSxdqddMU2GFvQCY6eego2rH2KAt2/kbaBJnj0Nm8BT/Hh7I4AwACcipHyPp27VZkduaAL/oVao29Zcu6kd6611LJSQGMbjXGTd+NI8H4OypU9E5s9AbgpWOVnUR4B4Icq8+aXmJ9q/7t0auiaqdW2y9H0bOqTIDnFXDA4Z0pqm7gxEZxy4emzBC7rFiBZXyl1Yn8ISNJ1qNsf56/NSsI4nfQoL11VSOeOdiJ5poN39edmOGND+Q+PgTXlPxb48SrEWduxR7yIdT1koC22g3D0I2zZaPRLmK9C5dRInepz3LZ0xLp5EMjB/M0dGdaVWzyUv6FaJqQsra5vE+BZDk3XUeJKd3089cVpyrvcWMeDwfE7ftmZ+t4kgOSxurFAA+6TwNP39fMoCHPPXKxVPTbaDo3C4xy7+kNySjSCVOZuxNo8JZDODQ1TlVsazE3J5pQmm8YD/LhK2GIniJUL5fIXON94z1VIBXkbPp0eu9r+g== 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)(36840700001)(46966006)(40470700004)(7636003)(83380400001)(66574015)(336012)(34020700004)(36860700001)(47076005)(36756003)(4326008)(8676002)(82310400005)(70586007)(70206006)(356005)(508600001)(82960400001)(107886003)(1076003)(2616005)(5660300002)(6666004)(6266002)(26005)(186003)(316002)(86362001)(2906002)(8936002)(54906003)(40460700003)(6916009); DIR:OUT; SFP:1101; X-OriginatorOrg: ericsson.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Apr 2022 13:52:54.9977 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 189d6775-959b-4e5b-8804-08da1af969cd 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: VE1EUR02FT065.eop-EUR02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR07MB3115 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. 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