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 8519F46061; Sun, 12 Jan 2025 21:20:37 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 78C6140612; Sun, 12 Jan 2025 21:20:37 +0100 (CET) Received: from mail-lj1-f226.google.com (mail-lj1-f226.google.com [209.85.208.226]) by mails.dpdk.org (Postfix) with ESMTP id 9924040430 for ; Sun, 12 Jan 2025 21:20:35 +0100 (CET) Received: by mail-lj1-f226.google.com with SMTP id 38308e7fff4ca-303548a933aso29025181fa.3 for ; Sun, 12 Jan 2025 12:20:35 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736713235; x=1737318035; 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=WTzgCKs1rEyJY3Iq05CXAmFYquQlL/mtrPykoHMZ5b8=; b=gOJnhw//UdIs1hMcc5jtXzoo5mlzR3+cRTo9GesZxByec4ic2eTorzURsxuZBsatv6 CisqY4K56O0AoJZJfcW7V7V099bWvCztJnOncmXD2Yf+VVQeIXyBGGvVG9ceMAuOmuWH tcer1qfXa3J5oYE57++OAYM3Ea5hStmVViFfW1BC7L5n6dadf3tVFa5sj6EK9Nzk5KfC nntc8l5gJge8N2IS5RAsUNLm11Lz3Gt/j2rHZrH+xlbayktcnrLoYQCiBP9z3maXnhd0 j70JgJsbMmadpwtSijA491ExDHYDBGsGb/Em5bjIcIl/B6tqR+Hdit/QeZEgF4f/1AWo iyMg== X-Gm-Message-State: AOJu0YyphqK8UrAns9/iVNaDCReamaGnf9rp7sM6P1BddAENDKFlUIcR etlemBDEjrd8F0137AkaftgtpdszBWVBv6toFPd4I8uhFptN2Q4v39wOt0o4PEDuQNwrAfaoYd2 6lX3cm7/kiy27Jf46qz9lDwJ1Jtg0K+3N3wR8lngk X-Gm-Gg: ASbGncv+gp8XJ2x4AVxM1PB6eUiVxmAVk+KXOOr+NGzZtWqkbRgnF036Y1KEpCIEFJM fFvegNgIAhemAWG9S31ZY5Hq4rtAlGNewhY3O1B/yvbWs4l9siNNJ3yvPCiPu+SuhGNVTf67xmr 4O/b85xFO0vCJumhCi7RF0TWWHhsF2vKq4F2E56tI2b3twoZyghciQnP6P4ct+WX6xgQzOnqGf4 966UHZGNW1v9S8piryMjCgULEFB7JYoyMXdkEz1MCs9SbDuN98g0/Z9tMiqdeqehkBJoZVGYKwN nIBHSVb/Ru+GvXqzDx/uFmRl9g== X-Google-Smtp-Source: AGHT+IFAqEuUWEOYVgkCViaYvXc9uxFtBndQhA7f1oLc30ogUObHV/x6gRLVoIdiwvjrdOavgUBU2/rVph51 X-Received: by 2002:a05:651c:1505:b0:302:1dd5:6b34 with SMTP id 38308e7fff4ca-305f45db418mr58804231fa.29.1736713234919; Sun, 12 Jan 2025 12:20:34 -0800 (PST) Received: from smtpservice.6wind.com ([185.13.181.2]) by smtp-relay.gmail.com with ESMTP id 38308e7fff4ca-305ff136951sm1996091fa.28.2025.01.12.12.20.34; Sun, 12 Jan 2025 12:20:34 -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 868BA13DDB; Sun, 12 Jan 2025 21:20:34 +0100 (CET) From: Ariel Otilibili To: dev@dpdk.org Cc: Stephen Hemminger , Thomas Monjalon , David Marchand , Ariel Otilibili Subject: [PATCH v3 1/6] raw/ifpga: remove check around pthread_mutex_init() Date: Sun, 12 Jan 2025 21:20:16 +0100 Message-Id: <20250112202021.179634-2-otilibil@eurecom.fr> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20250112202021.179634-1-otilibil@eurecom.fr> References: <20250112185842.9752-1-otilibil@eurecom.fr> <20250112202021.179634-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 | 7 +------ 2 files changed, 2 insertions(+), 10 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..14ea93cb43df 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; -- 2.30.2