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 E22D74603A; Sun, 12 Jan 2025 20:31:04 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 44B55402F0; Sun, 12 Jan 2025 20:31:03 +0100 (CET) Received: from mail-ej1-f98.google.com (mail-ej1-f98.google.com [209.85.218.98]) by mails.dpdk.org (Postfix) with ESMTP id 3F54A402EB for ; Sun, 12 Jan 2025 20:31:01 +0100 (CET) Received: by mail-ej1-f98.google.com with SMTP id a640c23a62f3a-ab2bb0822a4so755122966b.3 for ; Sun, 12 Jan 2025 11:31:01 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736710261; x=1737315061; 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=eUORhf9zuYi/0fACJjTtyx+fR8/UqOnj6MWc7wTCx/k=; b=HCNAMR57X/BLpN58BemjSDdHgN3mqiK9HDmiMg4HhkUnJjk787qmkpnSNImJ1ou4qD gXa1ZQ7lg06hUtg7nShJ8VI1pOeWBB5mZBEX3HrQwGJ/fqiG2RFqvIfMhjttzAfODuEQ 4iHENUa/BA9+jPzG2Wi9huR4Qdo9SA2W6mgDSvk8Bx0ZnD+RmCeDtEjR01n46lmmrvy8 ZvtzSfmLwssH4Q01WZX2vwdT/NL220IO7eXrgA6n69lUGzIS8DQ77clB5IL+nR5NWKo0 u0GenQtSAZFTQv2uS4xY5kjKtX2HgDd/um6fHQUnq5Fhw+JIl7QlAFnRQzFMzQFYHlUx 15nQ== X-Gm-Message-State: AOJu0YyqR7inumj7/4Mtg4TDYGsgjg+xf6BOCQ9AZZ1bUXsnj5fILbR3 NOt72XbSWaFo3LDUOhzRVB42H5+B5Sk5uHaT/caLIcqbv9t5wtEDmdvyRxnIAAr7SmgkZf36xAO em7WdzoDd3LI+WXB1Aqzw85dNpNifjy5olrPo8+Kb X-Gm-Gg: ASbGnctED5pJOJttkQZs4ugeBIsP3Yq7jpje69bpzJ/e4+z10ZwISFKY1lgZle8F70M lvVODaNivKKBW04eRhrcLUzQXD4Igob4nL780piDdqxIS9Kb8zLA0XxoQdPZpHL+bBGbPKKZfmv 8YlkociiXG203SNhAbkobPXzXIcSoU+rmi8XuDST8bZjus+4Q7Q7DUf9VydaQLn/vsdrE3/tpwc LIBl8Sn+8TL+0a6NcrTzL1Amd95HzakSpaNQNogJT1aiUgHvIL6Na53UllwT4aFBF4HcmEsxamA TC2AsVbJs9aLfspc2/C9EFvgTA== X-Google-Smtp-Source: AGHT+IGDDa9JdIZuBU9thbnX2b5tXQM/bi1F9rYFJ31860KAF4Pw1OgSQrHPOfqbo2/mDPLAkfW+0RsqLbhU X-Received: by 2002:a17:907:6e8d:b0:aa6:8935:ae71 with SMTP id a640c23a62f3a-ab2ab16820amr1748131166b.12.1736710260290; Sun, 12 Jan 2025 11:31:00 -0800 (PST) Received: from smtpservice.6wind.com ([185.13.181.2]) by smtp-relay.gmail.com with ESMTP id a640c23a62f3a-ab2c9644241sm37412366b.235.2025.01.12.11.31.00; Sun, 12 Jan 2025 11:31:00 -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 2304713DA0; Sun, 12 Jan 2025 20:31:00 +0100 (CET) From: Ariel Otilibili To: dev@dpdk.org Cc: Stephen Hemminger , Thomas Monjalon , David Marchand , Ariel Otilibili Subject: [PATCH v2 1/6] raw/ifpga: remove check around pthread_mutex_init() Date: Sun, 12 Jan 2025 20:30:38 +0100 Message-Id: <20250112193043.67372-2-otilibil@eurecom.fr> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20250112193043.67372-1-otilibil@eurecom.fr> References: <20250112185842.9752-1-otilibil@eurecom.fr> <20250112193043.67372-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 | 11 +++-------- 2 files changed, 4 insertions(+), 12 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..49d51c7bc3ab 100644 --- a/drivers/raw/ifpga/base/opae_spi_transaction.c +++ b/drivers/raw/ifpga/base/opae_spi_transaction.c @@ -494,7 +494,6 @@ struct spi_transaction_dev *spi_transaction_init(struct altera_spi_device *dev, int chipselect) { struct spi_transaction_dev *spi_tran_dev; - int ret; spi_tran_dev = opae_malloc(sizeof(struct spi_transaction_dev)); if (!spi_tran_dev) @@ -507,11 +506,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; @@ -523,8 +518,8 @@ struct spi_transaction_dev *spi_transaction_init(struct altera_spi_device *dev, return spi_tran_dev; err: - opae_free(spi_tran_dev); - return NULL; + opae_free(spi_tran_dev); + return NULL; } void spi_transaction_remove(struct spi_transaction_dev *dev) -- 2.30.2