From patchwork Tue May 30 22:39:17 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Logan Gunthorpe X-Patchwork-Id: 9755583 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 28512601D2 for ; Tue, 30 May 2017 22:39:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1C62520410 for ; Tue, 30 May 2017 22:39:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 113BC20499; Tue, 30 May 2017 22:39:27 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4F1EE20410 for ; Tue, 30 May 2017 22:39:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751025AbdE3WjZ (ORCPT ); Tue, 30 May 2017 18:39:25 -0400 Received: from ale.deltatee.com ([207.54.116.67]:56541 "EHLO ale.deltatee.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751002AbdE3WjY (ORCPT ); Tue, 30 May 2017 18:39:24 -0400 Received: from cgy1-donard.priv.deltatee.com ([172.16.1.31]) by ale.deltatee.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1dFpnK-0007wz-CJ; Tue, 30 May 2017 16:39:19 -0600 Received: from gunthorp by cgy1-donard.priv.deltatee.com with local (Exim 4.84_2) (envelope-from ) id 1dFpnN-0001jv-F2; Tue, 30 May 2017 16:39:21 -0600 From: Logan Gunthorpe To: linux-kernel@vger.kernel.org, dmaengine@vger.kernel.org Cc: Linus Walleij , Logan Gunthorpe , Stephen Bates , Dan Williams , Vinod Koul , =?UTF-8?q?Per=20F=C3=B6rlin?= Date: Tue, 30 May 2017 16:39:17 -0600 Message-Id: <20170530223917.6643-2-logang@deltatee.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170530223917.6643-1-logang@deltatee.com> References: <20170530223917.6643-1-logang@deltatee.com> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 172.16.1.31 X-SA-Exim-Rcpt-To: linux-kernel@vger.kernel.org, dmaengine@vger.kernel.org, linus.walleij@linaro.org, logang@deltatee.com, sbates@raithlin.com, dan.j.williams@intel.com, vinod.koul@intel.com, per.forlin@axis.com X-SA-Exim-Mail-From: gunthorp@deltatee.com Subject: [PATCH v2 2/2] dmaengine: ste_dma40: Cleanup scatterlist layering violations X-SA-Exim-Version: 4.2.1 (built Mon, 26 Dec 2011 16:24:06 +0000) X-SA-Exim-Scanned: Yes (on ale.deltatee.com) Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This dma engine driver directly accesses page_link assuming knowledge that should be contained only in scatterlist.h. We replace this access with a call to sg_chain which is equivalent. Signed-off-by: Logan Gunthorpe Signed-off-by: Stephen Bates Acked-by: Linus Walleij Cc: Dan Williams Cc: Vinod Koul Cc: Per Förlin --- v2: Splits the patch into two: one per driver drivers/dma/ste_dma40.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) -- 2.11.0 -- To unsubscribe from this list: send the line "unsubscribe dmaengine" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c index a6620b671d1d..c3052fbfd092 100644 --- a/drivers/dma/ste_dma40.c +++ b/drivers/dma/ste_dma40.c @@ -2528,10 +2528,7 @@ dma40_prep_dma_cyclic(struct dma_chan *chan, dma_addr_t dma_addr, dma_addr += period_len; } - sg[periods].offset = 0; - sg_dma_len(&sg[periods]) = 0; - sg[periods].page_link = - ((unsigned long)sg | 0x01) & ~0x02; + sg_chain(sg, periods + 1, sg); txd = d40_prep_sg(chan, sg, sg, periods, direction, DMA_PREP_INTERRUPT);