From patchwork Fri Jun 28 02:46:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fuqian Huang X-Patchwork-Id: 11021195 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0EA17924 for ; Fri, 28 Jun 2019 02:47:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F301F286E5 for ; Fri, 28 Jun 2019 02:47:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E51B328775; Fri, 28 Jun 2019 02:47:03 +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=-3.7 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RCVD_IN_SORBS_WEB autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 97435286E5 for ; Fri, 28 Jun 2019 02:47:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=+NZZ47MfHFTmjFRMMQPtzVl2LeMz0m7jWi3BIerEpcs=; b=c5Y rTRQfBR9A3HGt/B5NuV6bj5+AjnJa0RgDbjnB4Vx+1ice4r0y9BnM5BqkHVzkS8pvMnPc4e948HSD EXyd0yR5wWQn9CVYdcUuYagIb+f6/twOugfKeOqxEodNvCD4kzRlBr+as1hj/s2yBFAdJ9Sz4Wsu4 Vr8YyBLGHGm5IRIl3K/qY0uDjzcIjtPRtVKm6YXzAh0upHhTfDEclxGQl0ZVgUtRvDvyDP0emxzv4 icIrWjzPUEF4jgqBFrIClespX/jr3mlZL2CraY5c0qT5eaOU5yCZiVprOeN60Y+Ga7U8F8XRn1KIu SHiKYNqwKfn/A3FqYN9Jkm29YGWKckw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hgguf-00086E-VM; Fri, 28 Jun 2019 02:46:57 +0000 Received: from mail-pl1-x641.google.com ([2607:f8b0:4864:20::641]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hggub-00085a-Hz for linux-arm-kernel@lists.infradead.org; Fri, 28 Jun 2019 02:46:54 +0000 Received: by mail-pl1-x641.google.com with SMTP id m7so2345062pls.8 for ; Thu, 27 Jun 2019 19:46:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=04GljEtl2h3DmnTzFw9yoiLkqcADLLyfQ+DeoECtL/g=; b=DfYRJv3o9Bcrqrgqw90Ljs1hZlo0ut9UVtzdSkOf+R1UrqOE5qgOpWli4VXM0vexVS kcLQdIIY41qtuPt77bpfXCCz78DVSEt8nHQLWrbGGHdvoUJiz0AHcKv0zey3ymekMWQW 3ZYA8ry/J/fEnLyaQxY/BCrVNKg3WvLn+S+OzgWsXccwFp47WifaGx+EJq/hvLPyjB5T MReyTie+sBqblJjpj/MiGCu3GI5I5tLhd2JdRgoeCaOJaKr2J4U4bH/SxUo06oabCEJW tSJtSMgB5G+PcmJykIpGyPCl2lY/vlSPJFcP9+0kFoqBvtyZKe04tgqrO4PjH2qf54hN q8Xg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=04GljEtl2h3DmnTzFw9yoiLkqcADLLyfQ+DeoECtL/g=; b=ERZx4z0viB1zy/x/CzJVyQ5RTbUAMlIVq7xWBga2TTF+Iq4nZc4aq9cJvzruteedkP lwtTdJn9UEyTlPgurH+kP0YJrAyB86UjvnvlImdPLd6R7gAn1e4jiHsasUolmCFEH9oC bNIVUj0TZIH0tVg7DMBpOTjh0nIQBp7ZG6AdtMMHhlxkre8Id8xEWvcMxaxHawSZI6CD ZbUhRxXfAUzHKATf6y7w0lyFS0ALh5jNsyl5BgWVbWZxB/dcGj1iHE28j+IxFf07h6Fk bB4RCgllvITkD0SWnnkxzcIYHQXf70fyIKtvRGdIkyzopRsXnoCLfevrJu/fs9oN45cD Nr9A== X-Gm-Message-State: APjAAAWqxZgeHRPBezHhCfUjYogtCOerYzSpBuzOhvlo8+gkl0AXVt2R EvgzpUfxiLDRkJ+V0R/A0I8= X-Google-Smtp-Source: APXvYqwZWLNOSYNebra3h7VxqKFQWWgskOaNU9GLrmfb1nSa3+umdvA8TKyiTag+IOKEC5NcyTD2Fg== X-Received: by 2002:a17:902:9a42:: with SMTP id x2mr8693861plv.106.1561690012576; Thu, 27 Jun 2019 19:46:52 -0700 (PDT) Received: from hfq-skylake.ipads-lab.se.sjtu.edu.cn ([202.120.40.82]) by smtp.googlemail.com with ESMTPSA id j15sm450696pfr.146.2019.06.27.19.46.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 27 Jun 2019 19:46:52 -0700 (PDT) From: Fuqian Huang To: Subject: [PATCH v2 06/27] dma: remove memset after dma_alloc_coherent/dmam_alloc_coherent Date: Fri, 28 Jun 2019 10:46:42 +0800 Message-Id: <20190628024642.15089-1-huangfq.daxian@gmail.com> X-Mailer: git-send-email 2.11.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190627_194653_592624_8E7472B6 X-CRM114-Status: GOOD ( 11.60 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: dmaengine@vger.kernel.org, Fabio Estevam , Sascha Hauer , Sinan Kaya , linux-kernel@vger.kernel.org, David Brown , Vinod Koul , Andy Gross , NXP Linux Team , Pengutronix Kernel Team , linux-arm-msm@vger.kernel.org, Fuqian Huang , Dan Williams , Shawn Guo , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP In commit af7ddd8a627c ("Merge tag 'dma-mapping-4.21' of git://git.infradead.org/users/hch/dma-mapping"), dma_alloc_coherent/dmam_alloc_coherent has already zeroed the memory. So memset is not needed. Signed-off-by: Fuqian Huang --- drivers/dma/imx-sdma.c | 4 ---- drivers/dma/qcom/hidma_ll.c | 2 -- 2 files changed, 6 deletions(-) diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c index 99d9f431ae2c..54d86359bdf8 100644 --- a/drivers/dma/imx-sdma.c +++ b/drivers/dma/imx-sdma.c @@ -1886,10 +1886,6 @@ static int sdma_init(struct sdma_engine *sdma) sdma->context_phys = ccb_phys + MAX_DMA_CHANNELS * sizeof (struct sdma_channel_control); - /* Zero-out the CCB structures array just allocated */ - memset(sdma->channel_control, 0, - MAX_DMA_CHANNELS * sizeof (struct sdma_channel_control)); - /* disable all channels */ for (i = 0; i < sdma->drvdata->num_events; i++) writel_relaxed(0, sdma->regs + chnenbl_ofs(sdma, i)); diff --git a/drivers/dma/qcom/hidma_ll.c b/drivers/dma/qcom/hidma_ll.c index 5bf8b145c427..bb4471e84e48 100644 --- a/drivers/dma/qcom/hidma_ll.c +++ b/drivers/dma/qcom/hidma_ll.c @@ -749,7 +749,6 @@ struct hidma_lldev *hidma_ll_init(struct device *dev, u32 nr_tres, if (!lldev->tre_ring) return NULL; - memset(lldev->tre_ring, 0, (HIDMA_TRE_SIZE + 1) * nr_tres); lldev->tre_ring_size = HIDMA_TRE_SIZE * nr_tres; lldev->nr_tres = nr_tres; @@ -769,7 +768,6 @@ struct hidma_lldev *hidma_ll_init(struct device *dev, u32 nr_tres, if (!lldev->evre_ring) return NULL; - memset(lldev->evre_ring, 0, (HIDMA_EVRE_SIZE + 1) * nr_tres); lldev->evre_ring_size = HIDMA_EVRE_SIZE * nr_tres; /* the EVRE ring has to be EVRE_SIZE aligned */ From patchwork Fri Jun 28 02:47:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fuqian Huang X-Patchwork-Id: 11021201 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B990476 for ; Fri, 28 Jun 2019 02:48:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AA3B1286E5 for ; Fri, 28 Jun 2019 02:48:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9E9242877B; Fri, 28 Jun 2019 02:48:03 +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=-3.7 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RCVD_IN_SORBS_WEB autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 429DE28775 for ; Fri, 28 Jun 2019 02:48:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=iJ0Bokvsj2EnGysd9E7pKwu99yoTJqRnFjDi3f3oBTc=; b=NLZ 6r3bFQFzkf7r/eAG3lko3DBYDAavny9Uv/Z9P42GWNJ0nY0DQ5oapaUoOrmMCajfP0D25N4Kvle5A ksDG0622lonO6w4FgI4SyUzoAyl1SMrc9CMm9avPXg5UDaQ3LwoMdooxk3UuHbRozy0h93gh2RdEY ityRtLFcxL1pbsYB1VwL8ntugjFCbrapUoggJ/CKevDrXfe9VGyOEhjg2vtZVzJPjC+Kji/gQHkl5 IP92IJ3azbhYQpR0GgKoZAmxbXTOIxmBSkKYCTBdSD3BPtW9MpMA89RTFz7CZjkDzmd79WBYxLi65 7CB+Il2zuPGtLXfkV8CwMbZ3EfhcFjg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hggvh-0008RM-9o; Fri, 28 Jun 2019 02:48:01 +0000 Received: from mail-pg1-x542.google.com ([2607:f8b0:4864:20::542]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hggvb-0008QU-VY for linux-arm-kernel@lists.infradead.org; Fri, 28 Jun 2019 02:47:59 +0000 Received: by mail-pg1-x542.google.com with SMTP id q4so418591pgj.8 for ; Thu, 27 Jun 2019 19:47:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=6aVVFTG6J+mdEsYXUboxldScMRbRZCxioRYOiLEnKqo=; b=jkXS095oU0EJo69ErmIu2wtcYOP1wRsvlgLdQCfZ5Pv2Zh/7gShFRVIXqJcELmd9Qr 1BTNahLebCv7Yp99CNXI3P0SNaADHCbW7EZBdeOYXI4hwsdlzEpp+QeEq9CEQ+0buno7 Ewr3L3245KLVjBcBvkYSf9mxVdzetjaByD9iCF0rYL0qAwwNQFy3lASxtoMeC2QyrSUA zgDP4trJVupB4rSAy1wimgi6dvK0RW3lk8FmZeGCjhkPpEV6uVv6amT6NQkMX9Sv4z5f oCX0WCKLCsXkCR10WY55sfGOxFeUIUjx3e9IkITJ3vHuIlvwsFCiR9m3AUfzf0hSf+cT 9lTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=6aVVFTG6J+mdEsYXUboxldScMRbRZCxioRYOiLEnKqo=; b=hbO3+OR54opBnrR+wRLwsvEgrqeaY6tm6kB8ofzeEbN0xIq8q46uA4S6xcqE2pTn3w IsiGyC4dUTafrcCcv0iDjjUNcW9At2NF6/ZKOlx2niVHg1T3RMowhakSVWmHfe5gO6CN ICh8CnSKbXGgT40buotufLkRiWYqaPF7rfwbmbqGQOTezxjBmnpIDeE9X2Amqf/hwL+m mEG/o0oJJKIxZcIol+m64a+IIwk23UYD+GDU39FznTsUjA5jrwqJQmdqXCfS1TtByZdl ANx04N/vrT6qkTHEREhRo/uJ8lSknJ4vayVBsAnzPM5DliVuK+mC2y2ls0vTX36PKmx+ itsw== X-Gm-Message-State: APjAAAVtmWVkCR97DkmWHHtIfiIBGyAc55+65FgjfynGY99qjHwtWVob 0LzyAbDrccKlbRxQGTx9K8Q= X-Google-Smtp-Source: APXvYqztbcHxq0I2L5B3UFUCS5LeG8dAI4heG4E4Zv6OJyvw7TJjS519CqekfItIYensQjICjYysWA== X-Received: by 2002:a63:a48:: with SMTP id z8mr6935646pgk.91.1561690075033; Thu, 27 Jun 2019 19:47:55 -0700 (PDT) Received: from hfq-skylake.ipads-lab.se.sjtu.edu.cn ([202.120.40.82]) by smtp.googlemail.com with ESMTPSA id c130sm450104pfc.184.2019.06.27.19.47.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 27 Jun 2019 19:47:54 -0700 (PDT) From: Fuqian Huang To: Subject: [PATCH v2 11/27] media: remove memset after dma_alloc_coherent/pci_alloc_consistent Date: Fri, 28 Jun 2019 10:47:43 +0800 Message-Id: <20190628024744.15367-1-huangfq.daxian@gmail.com> X-Mailer: git-send-email 2.11.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190627_194757_913596_3F2F64B4 X-CRM114-Status: GOOD ( 11.79 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-samsung-soc@vger.kernel.org, Greg Kroah-Hartman , linux-kernel@vger.kernel.org, Krzysztof Kozlowski , Kyungmin Park , Kukjin Kim , linux-arm-kernel@lists.infradead.org, Sylwester Nawrocki , Fuqian Huang , Thomas Gleixner , Mauro Carvalho Chehab , Allison Randal , linux-media@vger.kernel.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP pci_alloc_consistent calls dma_alloc_coherent directly. In commit af7ddd8a627c ("Merge tag 'dma-mapping-4.21' of git://git.infradead.org/users/hch/dma-mapping"), dma_alloc_coherent has already zeroed the memory. So memset after these 2 functions is not needed. Signed-off-by: Fuqian Huang --- drivers/media/pci/ngene/ngene-core.c | 4 ---- drivers/media/platform/exynos4-is/fimc-is.c | 1 - 2 files changed, 5 deletions(-) diff --git a/drivers/media/pci/ngene/ngene-core.c b/drivers/media/pci/ngene/ngene-core.c index b75ab7d29226..af15ca1c501b 100644 --- a/drivers/media/pci/ngene/ngene-core.c +++ b/drivers/media/pci/ngene/ngene-core.c @@ -854,8 +854,6 @@ static int create_ring_buffer(struct pci_dev *pci_dev, if (!Head) return -ENOMEM; - memset(Head, 0, MemSize); - PARingBufferCur = PARingBufferHead; Cur = Head; @@ -907,8 +905,6 @@ static int AllocateRingBuffers(struct pci_dev *pci_dev, if (SCListMem == NULL) return -ENOMEM; - memset(SCListMem, 0, SCListMemSize); - pRingBuffer->SCListMem = SCListMem; pRingBuffer->PASCListMem = PASCListMem; pRingBuffer->SCListMemSize = SCListMemSize; diff --git a/drivers/media/platform/exynos4-is/fimc-is.c b/drivers/media/platform/exynos4-is/fimc-is.c index e043d55133a3..77633e356305 100644 --- a/drivers/media/platform/exynos4-is/fimc-is.c +++ b/drivers/media/platform/exynos4-is/fimc-is.c @@ -341,7 +341,6 @@ static int fimc_is_alloc_cpu_memory(struct fimc_is *is) return -ENOMEM; is->memory.size = FIMC_IS_CPU_MEM_SIZE; - memset(is->memory.vaddr, 0, is->memory.size); dev_info(dev, "FIMC-IS CPU memory base: %#x\n", (u32)is->memory.paddr);