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 4282946080; Tue, 14 Jan 2025 08:50:50 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2BD81402E8; Tue, 14 Jan 2025 08:50:50 +0100 (CET) Received: from mail-lf1-f99.google.com (mail-lf1-f99.google.com [209.85.167.99]) by mails.dpdk.org (Postfix) with ESMTP id 18156400EF for ; Tue, 14 Jan 2025 08:50:49 +0100 (CET) Received: by mail-lf1-f99.google.com with SMTP id 2adb3069b0e04-540218726d5so4899068e87.2 for ; Mon, 13 Jan 2025 23:50:49 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736841048; x=1737445848; 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=uK0Uf2qYllPisv8EGw/xqG9pwEZ/Uv2plGZ431rbrLg=; b=sw3+AnXPP4BLrGvYr34c3BP4IDCvQImIFKdJbd+fuNxaljbHge++NvMldTwovs9kzH s3icFqOwgM7ItaRDG03MvQovEDkPUTBbc4WTTU+PF7D1UwCKbB1alElpqybU7GrAQqIP JONsakBCprEBjoJc/Mmp5MUXS2aevTwGXFTTFjkv6RF/YSfcsqSlsfvXQTP7BMlNXqAD ueeKmuTPrd/HSEJal//VodAKswKVCDKIxIn3pJ2wLcsv66nBkNhrwBXCwmynrRa8mR0B NPP7KDEb2dWIAp0aTicsFT3inLH+UpDWosO8fqYx9cNvnsDrH48q5X1g+Xvg1l9/FfDb dx8A== X-Gm-Message-State: AOJu0Ywj8zXRUWXHEDVTXooDJTo4Foo9yPBsQzIreFs67RIKUl4aey0i bgCo8AIy9wulZJsfxIMmZsxOxzrWFBOURJCxXgAWqUCcAdRZcCm7UFna+6A4WBu/5q1H9SkR8nP OWPJELe3QvpVaX3OpgN6HLGJPbl+8NGRJ1G06/MVR X-Gm-Gg: ASbGncshwe5ZW1a528CXEJYkSyt7SrEKBt0ARrB6RJaGzaA7/yGdM/zrlb1ePFaXCj6 AZraS+0pjgpIpXYsh+km/k5I+XGPJFuCqhymEub4HUzYsFWL3UBhWTSR1guHse+0woSmn6H9arP 0PGduJc6hAtrlL6UCLrW+YlTke7pCAbXPttdz0LSop2VPVU9wUPe2QVVyPdCEQvI7deDde+Ktz4 34lmEFB1ke3sTfVydS+VEWvTEqw+fYTm9OtILd0vqHA2cERzZMFLAyVADteDkjSCf/sRH9x44b6 SXXXnuud+GiDCC/zLRCdH/0HUA== X-Google-Smtp-Source: AGHT+IFLgIWVIk7NOLI3Z4MQXmPCNoPftXREpmifX4mnJ062pAV9OIMoxyaWVWEqREs7B8vy0U2LodTKfZ4Q X-Received: by 2002:a05:6512:3c8a:b0:540:2022:e3c8 with SMTP id 2adb3069b0e04-54284810aabmr7167596e87.41.1736841048462; Mon, 13 Jan 2025 23:50:48 -0800 (PST) Received: from smtpservice.6wind.com ([185.13.181.2]) by smtp-relay.gmail.com with ESMTP id 2adb3069b0e04-5428be90e27sm521726e87.96.2025.01.13.23.50.48; Mon, 13 Jan 2025 23:50:48 -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 1908D1027A; Tue, 14 Jan 2025 08:50:48 +0100 (CET) From: Ariel Otilibili To: dev@dpdk.org Cc: Stephen Hemminger , Thomas Monjalon , David Marchand , Ariel Otilibili , Rosen Xu Subject: [PATCH v4 1/6] raw/ifpga: remove check around pthread_mutex_init() Date: Tue, 14 Jan 2025 08:50:28 +0100 Message-Id: <20250114075033.2027286-2-otilibil@eurecom.fr> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20250114075033.2027286-1-otilibil@eurecom.fr> References: <20250112185842.9752-1-otilibil@eurecom.fr> <20250114075033.2027286-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 Cc: Rosen Xu Signed-off-by: Ariel Otilibili Acked-by: Stephen Hemminger --- 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