From patchwork Tue Jan 17 09:21:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: ye.xingchen@zte.com.cn X-Patchwork-Id: 44609 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp1654023wrn; Tue, 17 Jan 2023 01:25:53 -0800 (PST) X-Google-Smtp-Source: AMrXdXv7SYNbgUbHtJwOv6f6rW9bW/fU0YVrYV5K2mPgZtsM2YWd99hSTpz4lvzTqRYqbSinyAJq X-Received: by 2002:a17:907:a586:b0:86a:316:d107 with SMTP id vs6-20020a170907a58600b0086a0316d107mr2208825ejc.72.1673947552768; Tue, 17 Jan 2023 01:25:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673947552; cv=none; d=google.com; s=arc-20160816; b=u0n5kuqnyIl2UZiiLz6BIzCyAM41CxyjlTt/mQXIt59XkiGL4HmKSaRZ2+Itpuo4us Qju3Go38X7+iPF6y405Cc5mXdECwIWK9c8AT5i4QPIisGiUHtK7DniIL09W8VTIsjXx4 wAbvdwbqkiriX0oLuXFFxrXwWF5MvoBClpQ54Dxbj9MskMmbJpkzMJrfkE6TIhH0Ua5g cqQKoPvS/pcal4MrgC2s6XfmjcfWa69wlTjhfJPFvtR7FnojashSk1yDCO8LUEo6VKkl 7z3CAaeQKXP9qOj9yZirKxJfIanDy427vlb30zsTKlSZo04OvlxdDoYAh5v50bcDebSE APXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:cc:to:from:mime-version:message-id:date; bh=dvpprNbQkDuk/4y/dTRgXkxRB0uMbd4ka49O/l4BIqA=; b=xO6vlZrHpj9y3rBVeYV82rPU1P0/pGmkx99MPINWH3dcGLOkAtAKGdM089D5yG99ME 3yGTb8u+pD4HxmEJ33oeaHusyYcCA/ZDv1SWloowdhUTLEvl6o9sK1TIAJrnSJjYbk3D MCJ/sAnmgmtg+w9jgYsIZNlO8GzC8tz4rHYr84Tik3QDUG/jAAV0IVbmqZoocvK9tYK/ kayy1qY+4diLSuHONJR9A4kVN3VwOZFrEg7mTkxsh0A6mRp8pfentkQ0w01AgZW8EVBo CVC/92pelfR2YPYS2VmOEuRjYx11bUkdT9hsVyh7yP1AtHqnb/lvY4OL+BPsi8DNXImn Qjzg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=zte.com.cn Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ae2-20020a17090725c200b007c07d0dbe85si10725397ejc.463.2023.01.17.01.25.28; Tue, 17 Jan 2023 01:25:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=zte.com.cn Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235964AbjAQJY4 (ORCPT + 99 others); Tue, 17 Jan 2023 04:24:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56260 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236767AbjAQJYF (ORCPT ); Tue, 17 Jan 2023 04:24:05 -0500 Received: from mxct.zte.com.cn (mxct.zte.com.cn [183.62.165.209]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F404830E81; Tue, 17 Jan 2023 01:21:28 -0800 (PST) Received: from mse-fl2.zte.com.cn (unknown [10.5.228.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mxct.zte.com.cn (FangMail) with ESMTPS id 4Nx3Kz3cmRz501Sq; Tue, 17 Jan 2023 17:21:27 +0800 (CST) Received: from xaxapp01.zte.com.cn ([10.88.99.176]) by mse-fl2.zte.com.cn with SMTP id 30H9L5EC054983; Tue, 17 Jan 2023 17:21:05 +0800 (+08) (envelope-from ye.xingchen@zte.com.cn) Received: from mapi (xaxapp01[null]) by mapi (Zmail) with MAPI id mid31; Tue, 17 Jan 2023 17:21:07 +0800 (CST) Date: Tue, 17 Jan 2023 17:21:07 +0800 (CST) X-Zmail-TransId: 2af963c668836dc062e9 X-Mailer: Zmail v1.0 Message-ID: <202301171721076625091@zte.com.cn> Mime-Version: 1.0 From: To: <3chas3@gmail.com> Cc: , , Subject: =?utf-8?q?=5BPATCH_linux-next=5D_atm=3A_lanai=3A_Use_dma=5Fzalloc?= =?utf-8?q?=5Fcoherent=28=29?= X-MAIL: mse-fl2.zte.com.cn 30H9L5EC054983 X-Fangmail-Gw-Spam-Type: 0 X-Fangmail-Anti-Spam-Filtered: true X-Fangmail-MID-QID: 63C66897.000/4Nx3Kz3cmRz501Sq X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, T_SPF_PERMERROR,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1755261228976762367?= X-GMAIL-MSGID: =?utf-8?q?1755261228976762367?= From: ye xingchen Instead of using dma_alloc_coherent() and memset() directly use dma_zalloc_coherent(). Signed-off-by: ye xingchen --- drivers/atm/lanai.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/atm/lanai.c b/drivers/atm/lanai.c index 32d7aa141d96..b7e0199ce642 100644 --- a/drivers/atm/lanai.c +++ b/drivers/atm/lanai.c @@ -342,8 +342,8 @@ static void lanai_buf_allocate(struct lanai_buffer *buf, * everything, but the way the lanai uses DMA memory would * make that a terrific pain. This is much simpler. */ - buf->start = dma_alloc_coherent(&pci->dev, - size, &buf->dmaaddr, GFP_KERNEL); + buf->start = dma_zalloc_coherent(&pci->dev, + size, &buf->dmaaddr, GFP_KERNEL); if (buf->start != NULL) { /* Success */ /* Lanai requires 256-byte alignment of DMA bufs */ APRINTK((buf->dmaaddr & ~0xFFFFFF00) == 0, @@ -352,7 +352,6 @@ static void lanai_buf_allocate(struct lanai_buffer *buf, buf->ptr = buf->start; buf->end = (u32 *) (&((unsigned char *) buf->start)[size]); - memset(buf->start, 0, size); break; } size /= 2;