Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp1700940ybj; Wed, 6 May 2020 03:47:40 -0700 (PDT) X-Google-Smtp-Source: APiQypL5Xu3x0dE6bDLbOrC6CWpAI7seMrv8ATBSRDYXrUmURNyHkVjXCJ4AqIlyOBFmPTU4UW6y X-Received: by 2002:a17:906:bce4:: with SMTP id op4mr6241288ejb.174.1588762060298; Wed, 06 May 2020 03:47:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588762060; cv=none; d=google.com; s=arc-20160816; b=BJE+0ULVeq7ZxxIhz1scfxfCrZi7zHUW0lYMUnFpkm7P0UOJ0704ov8mYu8rTOAfrR AGArxRJVHTx4S5r9AofN1TfESGKGnFj3UR//lZ9gKPFa8kXdFMFn3cmq7hnthUaftBB9 ULVBJhEd19eVgV7+Vi5trn2BCjX2DNrALnAABHt05s0JcFfysEfe8dRMDI4w0po+4Esx rGb3q6HyGwPKU76MCo7zQ8qYwRKPiinqc+ZUaiokJA3bU8mOpClWE7ZN2wu1tt9Xhm/j KVqAS5a/cmG5TZ64370/x1DTtGjJeW9Z6A1E/a54FglbvwkEmqDZCm0iNSbPu+fFBfec kbhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:to:from; bh=CWllhzb98JnHLYUviNK7qsGv/T0c31ZcRwSEFWCNmhU=; b=HBmhMMlsKyxte6Bd7lpsBmxLdV46GI2vY+QszIzleJnVl2NsnAazcf696r30pd2PiK 0zFh8B/bB8uiVYDM0dCkc9oochYR/ucqr389LNd+QvWI9E0mqJTaseKaGHxjaEgKsHJs vc0zlOtkEiYSMBvN2n+SEX9y5JMe5tc3Fy6jAGW2+h0WJZ6Be7DZXWNGbQeLQHuSzr1J rWiZ3k+GQsced34wYnCWUnPwx5kHWDjwDpnnRgghXfvkzsEQrGiDog441flX/ooG9+Ss fIPpwCMxsM3v8FrbUURmDieYGJsQMu/eyKPQnD0pHLVn8mg6uucdsc4Ha+thX44NndpI RTXw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j20si908722ejs.316.2020.05.06.03.47.17; Wed, 06 May 2020 03:47:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728051AbgEFGUB (ORCPT + 99 others); Wed, 6 May 2020 02:20:01 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:60946 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726480AbgEFGUB (ORCPT ); Wed, 6 May 2020 02:20:01 -0400 Received: from DGGEMS409-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 3247C663FE700C20C1EF; Wed, 6 May 2020 14:19:59 +0800 (CST) Received: from huawei.com (10.175.124.28) by DGGEMS409-HUB.china.huawei.com (10.3.19.209) with Microsoft SMTP Server id 14.3.487.0; Wed, 6 May 2020 14:19:49 +0800 From: Jason Yan To: , , , Subject: [PATCH] spi: a3700: make a3700_spi_init() return void Date: Wed, 6 May 2020 14:19:11 +0800 Message-ID: <20200506061911.19923-1-yanaijie@huawei.com> X-Mailer: git-send-email 2.21.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.124.28] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fix the following coccicheck warning: drivers/spi/spi-armada-3700.c:283:8-11: Unneeded variable: "ret". Return "0" on line 315 Signed-off-by: Jason Yan --- drivers/spi/spi-armada-3700.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/spi/spi-armada-3700.c b/drivers/spi/spi-armada-3700.c index e450ee17787f..fcde419e480c 100644 --- a/drivers/spi/spi-armada-3700.c +++ b/drivers/spi/spi-armada-3700.c @@ -276,11 +276,11 @@ static int a3700_spi_fifo_flush(struct a3700_spi *a3700_spi) return -ETIMEDOUT; } -static int a3700_spi_init(struct a3700_spi *a3700_spi) +static void a3700_spi_init(struct a3700_spi *a3700_spi) { struct spi_master *master = a3700_spi->master; u32 val; - int i, ret = 0; + int i; /* Reset SPI unit */ val = spireg_read(a3700_spi, A3700_SPI_IF_CFG_REG); @@ -311,8 +311,6 @@ static int a3700_spi_init(struct a3700_spi *a3700_spi) /* Mask the interrupts and clear cause bits */ spireg_write(a3700_spi, A3700_SPI_INT_MASK_REG, 0); spireg_write(a3700_spi, A3700_SPI_INT_STAT_REG, ~0U); - - return ret; } static irqreturn_t a3700_spi_interrupt(int irq, void *dev_id) @@ -886,9 +884,7 @@ static int a3700_spi_probe(struct platform_device *pdev) master->min_speed_hz = DIV_ROUND_UP(clk_get_rate(spi->clk), A3700_SPI_MAX_PRESCALE); - ret = a3700_spi_init(spi); - if (ret) - goto error_clk; + a3700_spi_init(spi); ret = devm_request_irq(dev, spi->irq, a3700_spi_interrupt, 0, dev_name(dev), master); -- 2.21.1