From patchwork Wed Feb 7 12:04:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 13548389 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C9D1BC4828D for ; Wed, 7 Feb 2024 12:05:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=SAlzUCI7v4F8/erkgA0BeHTflsoMMJ5M1Uv07ONwbOQ=; b=wiDSAqJsvhM0Vc E6s3eXH7Ar8ItDkhuvS8S5itJcAHP+l8vTQ7ovgxZH4u50gE4J3m5SRWLHORL3R7D6LcXQ9a6SZGm S8PbEKrMVsAB00j87JYlWB6KmX3Lyf9qOevWfaagm03rncWUcm/8CgcTH4wjSduH89sfT8XPT4rSN shw3HPnJQrEqjv/I3m36o+n1dcFnlTY6xQll9Mc89XwLCF84nPvxf+a4henUF2gZt5ApSds2gaqRY mKFPdOK2AxdW1M+Gd6tqchgYdDueC5GZIB1v92UU6gbzONRztIJjFqf+lFRhP/lxvVgL5F7zMVdcB V85IxLcSLPgycwAC8TPA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rXgfu-0000000AZUC-0HW2; Wed, 07 Feb 2024 12:05:10 +0000 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rXgfX-0000000AZCE-3hXH for linux-arm-kernel@lists.infradead.org; Wed, 07 Feb 2024 12:04:49 +0000 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-4101eb5a115so1123665e9.1 for ; Wed, 07 Feb 2024 04:04:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1707307486; x=1707912286; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=AmZwPJi4/crk/e7JVHaewrMAfpkKxE489+JbcSaSVHE=; b=M7eSUZscq6MoTHkozZ2W79BxoYVC/PVGlfo/OrosXWHntkCQE7qGqBhuRtNsrUn78y JJ96Mw7L1DGo6LTuYdcUfH/2gsTckTRQoPy0OEOOb83c1+qVQox8KeHQJSTe91RM67rI p3t0y9EEPxBGj2tSNde0pYVlF0k2BJT0Aq7u3fusRBDsnHlYIDrWhQISBZD99NbE3k+7 nCev//ELtT2kZCeGvbNEMhdoRKgKGVVO1fmvMwLwjH7d80c/7wim2i+PUEZgsnF83M4m 3sjqWk9Dt4oiZ7XyC3cyvM2wVn2pqa5KCyBJS5Bjmc6ENDBONaK0vrvx5/wBhO0893Dl 8UhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707307486; x=1707912286; 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=AmZwPJi4/crk/e7JVHaewrMAfpkKxE489+JbcSaSVHE=; b=gfIbUJHv1b8Ji2XbHdJenXxCjF8h07/gRwIxnCS89383FKH2yIMhtJ0HDgT9XLQKsL j0S7haWHDforRTnrbTZF7J2vGLHGDWkGjMaG/CVqwO8bucX8nELzIB9V3wYZkQ7MZEA7 MPkz0/2VMy3P4StBA0IGFwLylz3RaIRuzCBsmr57la7au21gtHvD7YhPj3FPWk0f4qaN qjid1/APPM0xPnhbOiY0SHTRchN3tYUIegWAHCmT0UBiRNXkdjcCXro72FQINgvPTcQq fiFcrFixoQrn+Lv2BqasKc9B5PCP+q+nMsDXMXmj6W/UuCXZsTIqACu4Ju6tOp47o6qX Pj6w== X-Gm-Message-State: AOJu0Yw8O2PGlByoT0F3e0w8KSSE4L6KNNgpgo5XMA9KnZmctGt5hF2L RpLLn068z8nfgPB5+k6gYsVoHBaiVRzsJGgUX3boWFskk7OZhrVuat19tQKcLVldzwWuyu1oYM/ Pd/U= X-Google-Smtp-Source: AGHT+IHmmMpg7y1ljPpAMnyZ14o8FS7S/PH5KbVyCVDh5pUlgHetiQ6wRGO7fPXOnM8iUIbbDdGRFw== X-Received: by 2002:a5d:42cc:0:b0:33b:2fba:1ea8 with SMTP id t12-20020a5d42cc000000b0033b2fba1ea8mr3192011wrr.52.1707307486148; Wed, 07 Feb 2024 04:04:46 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCVK4JPDc4iDMmGLIARBd4DhgeTGua/l6VbPFhSXw0UCakv/hGsahC4rjyeLrlUE1mLdXcbtM/+chMVezRIIXgxMl62fbmh9orhyACFJvEW25SZwyXuWDqbAmCNhAX2748XWiAkaVvdhH9DaHXDNvgG3ik6hEhlohBdQPJrCGmtC8pnEpH9AnH/b8ZgXhQjk41sThzoiUnjHEaPJA1pkh8/XGlJ7R3wWyfvugWeCgsA/rC9VONkWqcSEE/2C2HcBFfF/xRDy8P4pWXppH1pZ8GGKWPWpwM9trNTw/NGY6mHDFRaK4ne2a4F9b51Tj3FR88dYbmwVsu7x4QToJrKl+vGfsNK+zj9EgF9yjgIH/CH/SMz9IsqdUOpjQjD17fHWJpFkxlL24fj6RNpcaNc732qYzK0TPYGcCMMSdDDW5y9N9C9SQgNmyTuKH6sF8khgyB0xhKDi17at+bga1nNJ+Gg2vIT2fEUhO7og7b9BAT79VWcUfrGP2A7ezidzzQ== Received: from ta2.c.googlers.com.com (105.168.195.35.bc.googleusercontent.com. [35.195.168.105]) by smtp.gmail.com with ESMTPSA id d15-20020a5d644f000000b0033b44a349e1sm1349967wrw.38.2024.02.07.04.04.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Feb 2024 04:04:45 -0800 (PST) From: Tudor Ambarus To: broonie@kernel.org, andi.shyti@kernel.org, semen.protsenko@linaro.org Cc: krzysztof.kozlowski@linaro.org, alim.akhtar@samsung.com, linux-spi@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, andre.draszik@linaro.org, peter.griffin@linaro.org, kernel-team@android.com, willmcvicker@google.com, Tudor Ambarus Subject: [PATCH v5 09/17] spi: s3c64xx: move common code outside if else Date: Wed, 7 Feb 2024 12:04:23 +0000 Message-ID: <20240207120431.2766269-10-tudor.ambarus@linaro.org> X-Mailer: git-send-email 2.43.0.687.g38aa6559b0-goog In-Reply-To: <20240207120431.2766269-1-tudor.ambarus@linaro.org> References: <20240207120431.2766269-1-tudor.ambarus@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240207_040447_970111_74C5C648 X-CRM114-Status: UNSURE ( 9.98 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Move common code outside if else to avoid code duplication. Reviewed-by: Sam Protsenko Signed-off-by: Tudor Ambarus --- drivers/spi/spi-s3c64xx.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c index 0b42d28d2019..4ce6cb3b43f6 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c @@ -294,20 +294,18 @@ static int prepare_dma(struct s3c64xx_spi_dma_data *dma, if (dma->direction == DMA_DEV_TO_MEM) { sdd = container_of((void *)dma, struct s3c64xx_spi_driver_data, rx_dma); - config.direction = dma->direction; config.src_addr = sdd->sfr_start + S3C64XX_SPI_RX_DATA; config.src_addr_width = sdd->cur_bpw / 8; config.src_maxburst = 1; - dmaengine_slave_config(dma->ch, &config); } else { sdd = container_of((void *)dma, struct s3c64xx_spi_driver_data, tx_dma); - config.direction = dma->direction; config.dst_addr = sdd->sfr_start + S3C64XX_SPI_TX_DATA; config.dst_addr_width = sdd->cur_bpw / 8; config.dst_maxburst = 1; - dmaengine_slave_config(dma->ch, &config); } + config.direction = dma->direction; + dmaengine_slave_config(dma->ch, &config); desc = dmaengine_prep_slave_sg(dma->ch, sgt->sgl, sgt->nents, dma->direction, DMA_PREP_INTERRUPT);