From patchwork Fri Jan 26 17:15:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 13532909 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 DBA05C47422 for ; Fri, 26 Jan 2024 17:17:43 +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=b4qcwn/j8RhUF2p2oHyghwh9O9JPqkVQ/Ee6yPIFWR8=; b=j/sthUwGyGfvl6 cR0+LU5yGX+0Im8nZrbmI814t5bq7DnP0xX7l2qNoLipyrapHa5jAgomNn1PiFkzXJygWbxkCEs4L TW9eTJKXcB1bg2tEMnU9aRP5PFyyLyt5PmONWDb8p0ou9JH1v49nH5l17Q0JK0TFT88rWDCIOAs8+ 8spzNEcq7CjvhDyE3L80UkLaw1e+bVKSTfPpF3t9UT/oWyCI2BOHGw/YemP3lovDRHzphs0mk5L7r kKhQsI4yh6irXddaQzh/63JKNP2c3osfNy+YekusnNJHhYa37t5wbQrYcyDnNhWNnzsfJEwYGuUoc WJu/IEyF8eQQJBFn6+CA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rTPpa-00000004qPu-2UI7; Fri, 26 Jan 2024 17:17:30 +0000 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rTPo8-00000004pSd-4AP1 for linux-arm-kernel@lists.infradead.org; Fri, 26 Jan 2024 17:16:03 +0000 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-40e7065b7bdso12372715e9.3 for ; Fri, 26 Jan 2024 09:16:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706289357; x=1706894157; 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=y4xVKWwugYgGoHizGIdwlg/22zyZrS4EMqmySuw93Sc=; b=v6GtdRlJkShirfnshY1TB913ykWvtjK6PKiSUtW3TtOJxbNiHGY4eIeL9S+uut8aXc uqX8/PX5TH5xi49RxcNBEiT/Oh4MwT6qX3ckAE0c1LLR0b+RFSnuNcWLnSkERWboj/B6 st2ds1WTnZKkckbVK4++KmjIf2cdHaemH8Vjzg/uUK68IOpaMGl9ToqLp/5mQjHM9ol6 VoOGyZBMt78gnZlZJ9ecTg6u7pwoxMSUFq8SFcwC9mZDUdEWpokgfKOBSn8JMiE2NtLa aV5p9tCjezzzcToADsf2/+iwxhH5/qjhJoscIXGZGtYYqerNuXLBA70ulJ0GO6sZH/py ZCOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706289357; x=1706894157; 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=y4xVKWwugYgGoHizGIdwlg/22zyZrS4EMqmySuw93Sc=; b=cgG3UNQA1wlAfFRsZEophXho+wLktGhcVrJY8GoEIjIaKkEen3igHMxuQoJY8b/E26 exDMt8SMZzCYBlQFv0i7R3b1TO2qlWqxx1SG94W7rMKjFUfHO8I9mlAaIiKvD1mLYMEk u2tCrisznPC7I8Se+SDydUlv/JrJ8EflpN0AQE78p/20hLF0wQ2PQ4BP2mjtV7YuTIJ8 4HDE9Pv70n/1EC3sENQOLHWVJwlSN+supE5j6kroRQpoi1muAVCEOjOJUbD+d1CjxdOv 40LFWh2xPPHZ+ieSLCdDTzCqRFI1jHCQ0K9vm+5gcDbWw4tCk/F8b5d+sZPsd6654pd5 1c8A== X-Gm-Message-State: AOJu0YwJ21E26jXQd6goakVKZrv3CWQik+dEWr16A4/quDUFGQaDwVIJ RSXZTJsvUlEldzqEjTqzjWgwHtTR6PxUZ/GKgD3stD9aVSxhLUTMvuVsFxZA93Q= X-Google-Smtp-Source: AGHT+IEXhDE4nufHz0/LUuTfSrWjuCL+iH1BoKlo3v9opQn+OxuMuntV4aZh2UJOeFdGIflbLzWWYQ== X-Received: by 2002:a05:600c:3144:b0:40c:2417:3b51 with SMTP id h4-20020a05600c314400b0040c24173b51mr73223wmo.74.1706289357772; Fri, 26 Jan 2024 09:15:57 -0800 (PST) Received: from ta2.c.googlers.com.com (88.140.78.34.bc.googleusercontent.com. [34.78.140.88]) by smtp.gmail.com with ESMTPSA id k10-20020a05600c1c8a00b0040e451fd602sm6287286wms.33.2024.01.26.09.15.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Jan 2024 09:15:57 -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, jassi.brar@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 v3 08/17] spi: s3c64xx: move common code outside if else Date: Fri, 26 Jan 2024 17:15:36 +0000 Message-ID: <20240126171546.1233172-9-tudor.ambarus@linaro.org> X-Mailer: git-send-email 2.43.0.429.g432eaa2c6b-goog In-Reply-To: <20240126171546.1233172-1-tudor.ambarus@linaro.org> References: <20240126171546.1233172-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-20240126_091601_561220_6C0831BC X-CRM114-Status: UNSURE ( 9.89 ) 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 bd2ac875af59..bbbc4795bcbf 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c @@ -291,20 +291,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);