From patchwork Sun Jan 24 19:21:58 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?TcOlbnMgUnVsbGfDpXJk?= X-Patchwork-Id: 8101081 Return-Path: X-Original-To: patchwork-dmaengine@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 4373EBEEE5 for ; Sun, 24 Jan 2016 19:27:03 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 690AF20380 for ; Sun, 24 Jan 2016 19:27:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 894B12021A for ; Sun, 24 Jan 2016 19:27:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751605AbcAXTZs (ORCPT ); Sun, 24 Jan 2016 14:25:48 -0500 Received: from unicorn.mansr.com ([81.2.72.234]:59293 "EHLO unicorn.mansr.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751532AbcAXTZr (ORCPT ); Sun, 24 Jan 2016 14:25:47 -0500 Received: by unicorn.mansr.com (Postfix, from userid 51770) id 550431562F; Sun, 24 Jan 2016 19:25:46 +0000 (GMT) From: Mans Rullgard To: Viresh Kumar , Andy Shevchenko , Vinod Koul , linux-kernel@vger.kernel.org, dmaengine@vger.kernel.org Cc: Dan Williams Subject: [PATCH 11/15] dmaengine: dw: platform: use field-by-field initialization Date: Sun, 24 Jan 2016 19:21:58 +0000 Message-Id: <1453663322-14474-12-git-send-email-mans@mansr.com> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1453663322-14474-1-git-send-email-mans@mansr.com> References: <1453663322-14474-1-git-send-email-mans@mansr.com> Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Andy Shevchenko This is a simple stylish change that allows to use less lines of code. Signed-off-by: Andy Shevchenko --- I'm a little ambivalent on this one. While the patch is correct as such, the change means that if struct dw_dma_slave gains new members in future, these will not be initialised. This added fragility seems an unnecesary price to pay for saving one line of code. --- drivers/dma/dw/platform.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/drivers/dma/dw/platform.c b/drivers/dma/dw/platform.c index 808bafdd7d48..0fd5a49311a2 100644 --- a/drivers/dma/dw/platform.c +++ b/drivers/dma/dw/platform.c @@ -32,14 +32,13 @@ static struct dma_chan *dw_dma_of_xlate(struct of_phandle_args *dma_spec, struct of_dma *ofdma) { struct dw_dma *dw = ofdma->of_dma_data; - struct dw_dma_slave slave = { - .dma_dev = dw->dma.dev, - }; + struct dw_dma_slave slave; dma_cap_mask_t cap; if (dma_spec->args_count != 3) return NULL; + slave.dma_dev = dw->dma.dev; slave.src_id = dma_spec->args[0]; slave.dst_id = dma_spec->args[0]; slave.m_master = dma_spec->args[1]; @@ -62,13 +61,13 @@ static struct dma_chan *dw_dma_of_xlate(struct of_phandle_args *dma_spec, static bool dw_dma_acpi_filter(struct dma_chan *chan, void *param) { struct acpi_dma_spec *dma_spec = param; - struct dw_dma_slave slave = { - .dma_dev = dma_spec->dev, - .src_id = dma_spec->slave_id, - .dst_id = dma_spec->slave_id, - .m_master = 1, - .p_master = 0, - }; + struct dw_dma_slave slave; + + slave.dma_dev = dma_spec->dev; + slave.src_id = dma_spec->slave_id; + slave.dst_id = dma_spec->slave_id; + slave.m_master = 1; + slave.p_master = 0; return dw_dma_filter(chan, &slave); }