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 EF98F46060; Sun, 12 Jan 2025 19:59:03 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 451E0402E8; Sun, 12 Jan 2025 19:59:00 +0100 (CET) Received: from mail-ed1-f97.google.com (mail-ed1-f97.google.com [209.85.208.97]) by mails.dpdk.org (Postfix) with ESMTP id 78312402A7 for ; Sun, 12 Jan 2025 19:58:58 +0100 (CET) Received: by mail-ed1-f97.google.com with SMTP id 4fb4d7f45d1cf-5d982bce8f9so6830242a12.1 for ; Sun, 12 Jan 2025 10:58:58 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736708338; x=1737313138; 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=TJQEaO8WBSWjTw0fw4PN3ClmBrz8VRvTqQ5OpHva7cU=; b=vbdljOnPJMzmXoPb1kOEGYuHXXvDHzPHEnD8mqc2N6ARMuQ8TDoaxy0mTBmOGwaEYW 7RPeHiT+Ez/4OvJj/SLaoPoeVjFUouCqwsnvp8cfQABGSx4502bbtkyN73LKIGRtjr63 zNJZPR7zhTlYMZP/vMf1JCKm9Wd8rWLJVd/ITA7bhEYvj+l0Qm3/omaDYk4ByimihqOt C4aVL4FDAPZkO7XZpVYGy3fiVRjLgh/oIHBCbLot3aMKg5N+gs4DXuEMvUw7lHMRTF3J TMBRkF4v3PC0axFPhnQwlRIWxU+BoZ41XZeeDnDTpJe1XT9XdBsFUyz1K9RYfmsUI4+K h2HA== X-Gm-Message-State: AOJu0Yw2P2LMqm3SKgcmkvg04YqlWE8gO1sQHX5nVRFb2r8/YaVYavvU TRWDIJIdcyJ7idX06uRGpuGTCOGjT0tqpp/hz3ppBjNQKXRJitFyIkqQKY6qJ/fML1Ge/GMb28f bYEEeZPDB9rJs+CMJ2WLSArwvqrAyCGvkOfFiBCiW X-Gm-Gg: ASbGncsy0W+8pJEPX2Az89xVqVZoZbRbWPv7mV4ms/S+1HjBuXhYfj6ML8Q+JwDYrCq CZbkBYqGFOZBnEdqx566hU3jOJI60VRqoPiAYMYpCQXcTxVM5igeTOsjefDZcusPKh99SV7xf5+ O1VJlX6jZA7PXTHwvyNlc1WoLEuD4mlu1J0eqZ6enCZ8Pg9xnQZeQNTjZ9WrZ2d9tMfvWOb2tsA LVIN6khGCqqBCRpnd40BteWN8vA0pvM/GSObRyfA85k2aIrmc256Jk0FrN1HB+ZTykqece8KL0j wtIqWUUG7GTVLHlWbnGPJ2iGNA== X-Google-Smtp-Source: AGHT+IGK7UWT+FkEkOaBpTLKjs2+2No/f4ZQzwBm3dTu/E2v/e72jk+4RgMHEdsT9Mz/vsKhVq75dq8LLefV X-Received: by 2002:a17:907:2cc6:b0:aa6:23ba:d8c8 with SMTP id a640c23a62f3a-ab2ab6a8503mr1778381666b.11.1736708337979; Sun, 12 Jan 2025 10:58:57 -0800 (PST) Received: from smtpservice.6wind.com ([185.13.181.2]) by smtp-relay.gmail.com with ESMTP id a640c23a62f3a-ab2faedfd85sm19297366b.102.2025.01.12.10.58.57; Sun, 12 Jan 2025 10:58:57 -0800 (PST) X-Relaying-Domain: 6wind.com Received: from localhost (rainbow.dev.6wind.com [10.17.1.165]) by smtpservice.6wind.com (Postfix) with ESMTP id CE7F913D75; Sun, 12 Jan 2025 19:58:57 +0100 (CET) From: Ariel Otilibili To: dev@dpdk.org Cc: Stephen Hemminger , Thomas Monjalon , David Marchand , Ariel Otilibili Subject: [PATCH 1/6] raw/ifpga: remove check around pthread_mutex_init() Date: Sun, 12 Jan 2025 19:58:37 +0100 Message-Id: <20250112185842.9752-2-otilibil@eurecom.fr> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20250112185842.9752-1-otilibil@eurecom.fr> References: <20250112185842.9752-1-otilibil@eurecom.fr> 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 > pthread_mutex_init always returns 0. The other mutex functions > return 0 on success and a non-zero error code on error. Link: https://man7.org/linux/man-pages/man3/pthread_mutex_lock.3.html Bugzilla ID: 1586 Signed-off-by: Ariel Otilibili --- drivers/raw/ifpga/base/opae_intel_max10.c | 5 +---- drivers/raw/ifpga/base/opae_spi_transaction.c | 10 +--------- 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/drivers/raw/ifpga/base/opae_intel_max10.c b/drivers/raw/ifpga/base/opae_intel_max10.c index d5a9ceb6e355..58c884a8d8e1 100644 --- a/drivers/raw/ifpga/base/opae_intel_max10.c +++ b/drivers/raw/ifpga/base/opae_intel_max10.c @@ -1486,10 +1486,7 @@ intel_max10_device_init(struct intel_max10_device *dev) if (ret) return ret; - ret = pthread_mutex_init(&dev->bmc_ops.lock, NULL); - if (ret) - return ret; - + pthread_mutex_init(&dev->bmc_ops.lock, NULL); if (!dev->bmc_ops.mutex) dev->bmc_ops.mutex = &dev->bmc_ops.lock; } diff --git a/drivers/raw/ifpga/base/opae_spi_transaction.c b/drivers/raw/ifpga/base/opae_spi_transaction.c index 21015eb95ef5..95efcbbecb0a 100644 --- a/drivers/raw/ifpga/base/opae_spi_transaction.c +++ b/drivers/raw/ifpga/base/opae_spi_transaction.c @@ -507,11 +507,7 @@ struct spi_transaction_dev *spi_transaction_init(struct altera_spi_device *dev, if (!spi_tran_dev->buffer) goto err; - ret = pthread_mutex_init(&spi_tran_dev->lock, NULL); - if (ret) { - dev_err(spi_tran_dev, "fail to init mutex lock\n"); - goto err; - } + pthread_mutex_init(&spi_tran_dev->lock, NULL); if (dev->mutex) { dev_info(NULL, "use multi-process mutex in spi\n"); spi_tran_dev->mutex = dev->mutex; @@ -521,10 +517,6 @@ struct spi_transaction_dev *spi_transaction_init(struct altera_spi_device *dev, } return spi_tran_dev; - -err: - opae_free(spi_tran_dev); - return NULL; } void spi_transaction_remove(struct spi_transaction_dev *dev) -- 2.30.2