From patchwork Mon Jun 29 14:04:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 11631003 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 94C4392A for ; Mon, 29 Jun 2020 14:08:38 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1225E23D98 for ; Mon, 29 Jun 2020 14:08:38 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Reak8NV9"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Yqxeccx+" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1225E23D98 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=i5pbml1MU3248IfDUIoZ7f73qp0NxPXu1jSEeropv68=; b=Reak8NV90VQwnG7IiFTXWGPW9 ur8Fq5+mhUSf6JUFrQDCTMi9pvjVjdse7nKjqyBay6tRoPqR5JsgbBvuNLN8mnxEWlXNn/6s7iPRe zZCdgqDsm0g954Dr8Cob0Ed1Fbbsrzaq17EvQXywDCYvd6SU/399WLXG/B0NYqHJHGas9SmMFGLLp a1pMvAPXyaqnK0Z6LKp6ffrrLFB4XV3M5K5Y2ikOHUD+4S0fP0mD6eXMPgDSNXXOqpJsGLq0+hMtw K0Sux1+ib0c0Ewh6MbjwWgNTb30W/Zev0wSyldZF6JRUIAXq/KdWqdiDzbAfeeIry4xO/fYq6rYaN 9Pv/7DWZA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jpuQO-0004l4-8i; Mon, 29 Jun 2020 14:06:20 +0000 Received: from mail-wm1-x343.google.com ([2a00:1450:4864:20::343]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jpuP7-0004Fn-J0 for linux-arm-kernel@lists.infradead.org; Mon, 29 Jun 2020 14:05:04 +0000 Received: by mail-wm1-x343.google.com with SMTP id o2so16258951wmh.2 for ; Mon, 29 Jun 2020 07:05:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=MA4D/3EmXU00HIViUNDTK2zztNgG9GHE3QsyfvIeaek=; b=Yqxeccx+BeP2NcoVf8V9CW9Kfpy/B9e8WWtiZSLEHcXHUfBkdQr5EVkUMgJXYsMhRX eauSayO11Dx3fdjMWqVvKs8GhjWRJLil0U37o7wDe0enpWSyrIfJfS8I0zq1UCIH1waR nSq/2T/OlzJugB5pOGYgAC0+y4dfD241WRypgzJ6jV0dSfxi7/PVCjfJJf6sgOjNVlhz uAAUA0LtZmQhBOmnS6splciovURAzeKzs5zQCV19j1xV1Woy2IFAqcrzrujtgS/xZEoE SW69zYx+gng/6cTnFfPiy0h4WZAr2yIQIHpdb5NMI1ipqNxuU3XKJB3ENdl0yGYKwOTt nM2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=MA4D/3EmXU00HIViUNDTK2zztNgG9GHE3QsyfvIeaek=; b=UzUk2u52CdVAJTUHLdCA7aLXlaZJIY6B4RK0qTjDTknXfg0Ri9peaKSY3YzGZRcVwp wKfia4ol7levB4v4E5dhRrIP25DS9R47vtqsf6exLOW7qOtWZc3fqR0+6/75OZnwp5Vj NSSyphLPkrHerSG9GaiEtb/Nb0f2zddztjEX+NOtDtKXizbKo02Y7hRjtIVXlkPC11pN kIugNEDYuhotNb5l3uEB2+qn/SXC5tlBeO/ty/g5cOm77J5aKdYG9D6XgyLFTOmKABFA UtuIQjHIP+D0xZ2aO+yI2owcN/1a9ACxN9qPdaF03WJfiovnZK/XlgV3emV/1s0JrD4I KxcQ== X-Gm-Message-State: AOAM531wL9/qEEH5csHmaok5Z0d2blxmQEhqNCRwENzJUb++gIadhy+f +xK3JJ0WIPxqT7N9I5iMtkk3FA== X-Google-Smtp-Source: ABdhPJxDNp7vd10O4kA6m0+v/7iGwoA/DNFCia8vBm/9JG0WJDOmhz/GZXc5w1/8d9K8otS7NjxLwg== X-Received: by 2002:a1c:bdc3:: with SMTP id n186mr1698099wmf.84.1593439500590; Mon, 29 Jun 2020 07:05:00 -0700 (PDT) Received: from localhost.localdomain ([2.27.35.144]) by smtp.gmail.com with ESMTPSA id p14sm15394928wrj.14.2020.06.29.07.04.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jun 2020 07:04:59 -0700 (PDT) From: Lee Jones To: arnd@arndb.de, gregkh@linuxfoundation.org Subject: [PATCH 12/20] misc: lattice-ecp3-config: Remove set but clearly unused variable 'ret' Date: Mon, 29 Jun 2020 15:04:34 +0100 Message-Id: <20200629140442.1043957-13-lee.jones@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200629140442.1043957-1-lee.jones@linaro.org> References: <20200629140442.1043957-1-lee.jones@linaro.org> MIME-Version: 1.0 X-Spam-Note: CRM114 invocation failed X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:343 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Stefan Roese , Lee Jones , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org It's odd for the return value to be assigned to a variable so many times, but never actually checked, but this has been the case since the driver's inception in 2012. If it hasn't caused any issues by now, it's probably unlikely to. Let's take it out, at least until someone finds a reason to start using it. Fixes the following W=1 kernel build warning: drivers/misc/lattice-ecp3-config.c: In function ‘firmware_load’: drivers/misc/lattice-ecp3-config.c:70:6: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable] 70 | int ret; | ^~~ Cc: Stefan Roese Signed-off-by: Lee Jones --- drivers/misc/lattice-ecp3-config.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/drivers/misc/lattice-ecp3-config.c b/drivers/misc/lattice-ecp3-config.c index 884485c3f7232..5eaf74447ca1e 100644 --- a/drivers/misc/lattice-ecp3-config.c +++ b/drivers/misc/lattice-ecp3-config.c @@ -67,7 +67,6 @@ static void firmware_load(const struct firmware *fw, void *context) struct spi_device *spi = (struct spi_device *)context; struct fpga_data *data = spi_get_drvdata(spi); u8 *buffer; - int ret; u8 txbuf[8]; u8 rxbuf[8]; int rx_len = 8; @@ -92,7 +91,7 @@ static void firmware_load(const struct firmware *fw, void *context) /* Trying to speak with the FPGA via SPI... */ txbuf[0] = FPGA_CMD_READ_ID; - ret = spi_write_then_read(spi, txbuf, 8, rxbuf, rx_len); + spi_write_then_read(spi, txbuf, 8, rxbuf, rx_len); jedec_id = get_unaligned_be32(&rxbuf[4]); dev_dbg(&spi->dev, "FPGA JTAG ID=%08x\n", jedec_id); @@ -110,7 +109,7 @@ static void firmware_load(const struct firmware *fw, void *context) dev_info(&spi->dev, "FPGA %s detected\n", ecp3_dev[i].name); txbuf[0] = FPGA_CMD_READ_STATUS; - ret = spi_write_then_read(spi, txbuf, 8, rxbuf, rx_len); + spi_write_then_read(spi, txbuf, 8, rxbuf, rx_len); status = get_unaligned_be32(&rxbuf[4]); dev_dbg(&spi->dev, "FPGA Status=%08x\n", status); @@ -130,20 +129,20 @@ static void firmware_load(const struct firmware *fw, void *context) memcpy(buffer + 4, fw->data, fw->size); txbuf[0] = FPGA_CMD_REFRESH; - ret = spi_write(spi, txbuf, 4); + spi_write(spi, txbuf, 4); txbuf[0] = FPGA_CMD_WRITE_EN; - ret = spi_write(spi, txbuf, 4); + spi_write(spi, txbuf, 4); txbuf[0] = FPGA_CMD_CLEAR; - ret = spi_write(spi, txbuf, 4); + spi_write(spi, txbuf, 4); /* * Wait for FPGA memory to become cleared */ for (i = 0; i < FPGA_CLEAR_LOOP_COUNT; i++) { txbuf[0] = FPGA_CMD_READ_STATUS; - ret = spi_write_then_read(spi, txbuf, 8, rxbuf, rx_len); + spi_write_then_read(spi, txbuf, 8, rxbuf, rx_len); status = get_unaligned_be32(&rxbuf[4]); if (status == FPGA_STATUS_CLEARED) break; @@ -160,13 +159,13 @@ static void firmware_load(const struct firmware *fw, void *context) } dev_info(&spi->dev, "Configuring the FPGA...\n"); - ret = spi_write(spi, buffer, fw->size + 8); + spi_write(spi, buffer, fw->size + 8); txbuf[0] = FPGA_CMD_WRITE_DIS; - ret = spi_write(spi, txbuf, 4); + spi_write(spi, txbuf, 4); txbuf[0] = FPGA_CMD_READ_STATUS; - ret = spi_write_then_read(spi, txbuf, 8, rxbuf, rx_len); + spi_write_then_read(spi, txbuf, 8, rxbuf, rx_len); status = get_unaligned_be32(&rxbuf[4]); dev_dbg(&spi->dev, "FPGA Status=%08x\n", status);