From patchwork Fri Jun 28 02:50: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: 11021225 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 3E2E517D2 for ; Fri, 28 Jun 2019 02:51:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2CBDD2876B for ; Fri, 28 Jun 2019 02:51:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2061B28775; Fri, 28 Jun 2019 02:51:55 +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=-1.4 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_WEB autolearn=no version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A121E2876B for ; Fri, 28 Jun 2019 02:51:53 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id C60B116A5; Fri, 28 Jun 2019 04:51:01 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz C60B116A5 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1561690311; bh=bDzZ4MWjGwypNua85VmDUpCAw8e7fuu7pph8e83CAWc=; h=From:To:Date:Cc:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=pYmFeotfNIcH9Z4N5uedo0Z1NciW2ihVH4pOI3PwOUyBdtPNAmimqLhwIqAiClIcN hutZq4Cik9x8LylRAtgLIYBHEWCcLOddJnyfbp6Pae0x5k5f4BjefRTXtP1jzVumf5 ryP+CbxM0hz5G/FP3VWSs8YItWRjQhJwdp0uB8Vg= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 2E6CFF896B7; Fri, 28 Jun 2019 04:51:01 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 355D1F896B9; Fri, 28 Jun 2019 04:50:59 +0200 (CEST) Received: from mail-pf1-x442.google.com (mail-pf1-x442.google.com [IPv6:2607:f8b0:4864:20::442]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 11541F80058 for ; Fri, 28 Jun 2019 04:50:55 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 11541F80058 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="OMOoigyS" Received: by mail-pf1-x442.google.com with SMTP id x15so2203288pfq.0 for ; Thu, 27 Jun 2019 19:50: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=F0GZtLBtco0OGsuekl6L6Sm8t8dj7LSLjNvFPb4po3A=; b=OMOoigySa27Ebqls8JGEjkQYipYUPgnN24ja9hC3JvuTlSLBCj2VmHwcPLIfIlyMNW i+FPVcvo62rXh1Rt7hZB0wkhv9qZvAy401spXeCyXD5VxMLlSAxweBLHcW/tWlh2lC5G rMcZJfaQJu/ss3l80QiYdC8Nu7Iv534Lf6RP0D8lghj3QcjyIjwFtx3l2u+Y3PIPeNfu mWdbY0NQ24O2Vvx/HaTzAEesjRH0SHGGQ+dpSjIVsLPiX18fUCYpZ/NLmuEAbXRht5NT Tu5AC2UYvqzvAGqy6LoICuGiSu+CPFDli96AcaYLkkfowx6Jk5GTqLEIhHwmLbgTGk/v 9Agg== 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=F0GZtLBtco0OGsuekl6L6Sm8t8dj7LSLjNvFPb4po3A=; b=LKRGJyXPoaKFfGu6Das08+PMOMTmtIJkybez3K9kWj2ZfP3W28yNgvG6BauY1IXQfC rBlV5DDUTJENfxMBJRXA2AW8ZHLLg+HimXbLMDDHB1qrfWy+TaksRl/sffdH9n1qsZRM tLttz3HyJ8373wCBI+1vRRzTkGZsK6Bx4vwzP7OBHyqwAqRobCavoBCGd4xny865NxvM cpEX5XyyUarjtaxe0qywZRkQ4rEiSEf/SB5CwYkt0KnRX5zq2og77a64hnKEzVfbK7m6 25MQ8OLT/f+rCeAtchYJJOWtwXervVzy2y0kVx5QAKA4SelRS3dk8MnG5r2Z1cO7etNs Kr5w== X-Gm-Message-State: APjAAAWqAHJQ+/+3QFU6vCtqI36t2NOwkSI1QUoBr584tNbMWD+g1h7y G0A9LCqmH70GGnQE+PdYbBU= X-Google-Smtp-Source: APXvYqznY1Wol2rASo8YS+K58U5LNR/loQAj+GVGr9S3nFp22CPoBautxWfldQrpAGZkreJ8HHSjzw== X-Received: by 2002:a63:4d4a:: with SMTP id n10mr6804907pgl.396.1561690253101; Thu, 27 Jun 2019 19:50:53 -0700 (PDT) Received: from hfq-skylake.ipads-lab.se.sjtu.edu.cn ([202.120.40.82]) by smtp.googlemail.com with ESMTPSA id bo20sm513338pjb.23.2019.06.27.19.50.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 27 Jun 2019 19:50:52 -0700 (PDT) From: Fuqian Huang To: Date: Fri, 28 Jun 2019 10:50:43 +0800 Message-Id: <20190628025044.16187-1-huangfq.daxian@gmail.com> X-Mailer: git-send-email 2.11.0 Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Greg Kroah-Hartman , Takashi Iwai , Richard Fontana , Fuqian Huang , Thomas Gleixner , Allison Randal Subject: [alsa-devel] [PATCH v2 26/27] sound: oss: use kzalloc rather than kmalloc with memset X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" X-Virus-Scanned: ClamAV using ClamSMTP Use zeroing allocator instead of using allocator followed with memset with 0. Signed-off-by: Fuqian Huang --- sound/core/seq/oss/seq_oss_init.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sound/core/seq/oss/seq_oss_init.c b/sound/core/seq/oss/seq_oss_init.c index 6dc94efc19c9..6e8020d4368a 100644 --- a/sound/core/seq/oss/seq_oss_init.c +++ b/sound/core/seq/oss/seq_oss_init.c @@ -66,7 +66,7 @@ snd_seq_oss_create_client(void) struct snd_seq_port_info *port; struct snd_seq_port_callback port_callback; - port = kmalloc(sizeof(*port), GFP_KERNEL); + port = kzalloc(sizeof(*port), GFP_KERNEL); if (!port) { rc = -ENOMEM; goto __error; @@ -81,7 +81,6 @@ snd_seq_oss_create_client(void) system_client = rc; /* create annoucement receiver port */ - memset(port, 0, sizeof(*port)); strcpy(port->name, "Receiver"); port->addr.client = system_client; port->capability = SNDRV_SEQ_PORT_CAP_WRITE; /* receive only */ From patchwork Fri Jun 28 02:50:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fuqian Huang X-Patchwork-Id: 11021227 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 91013924 for ; Fri, 28 Jun 2019 02:52:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8295F28780 for ; Fri, 28 Jun 2019 02:52:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 74B022877B; Fri, 28 Jun 2019 02:52:50 +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=-1.4 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_WEB autolearn=no version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id DE2622876B for ; Fri, 28 Jun 2019 02:52:49 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id E2BE416D2; Fri, 28 Jun 2019 04:51:56 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz E2BE416D2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1561690367; bh=oAQPnPb9nLY9IIxhBiZ35EYdiMh518OEVz6lMfzLHrg=; h=From:To:Date:Cc:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=cogNzXCcX+mtDZ15WRaoVAPLU0VkCMslfdQAGKMFv6EyDexNiIKYIRYJEEVCXhFGe FPm2EBjkx5cYl9KI1qimn6/sgfYmPfHecpakB2ATui62hjYj92pG7APUg92sG9hbwy 2S9m7YY5d+1uxz2WrIkSvS8cVvYws0RW7+wMYHVI= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 40ACEF896EC; Fri, 28 Jun 2019 04:51:13 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 48A8AF896CB; Fri, 28 Jun 2019 04:51:12 +0200 (CEST) Received: from mail-pl1-x644.google.com (mail-pl1-x644.google.com [IPv6:2607:f8b0:4864:20::644]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 713D9F896CB for ; Fri, 28 Jun 2019 04:51:05 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 713D9F896CB Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="IhxJ2cyQ" Received: by mail-pl1-x644.google.com with SMTP id m7so2350416pls.8 for ; Thu, 27 Jun 2019 19:51:04 -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=FR72I8Co0+MJGxYGED+5/dqb9dBV7h2vnmoy22KZs5Q=; b=IhxJ2cyQo1/nvunCFvFfS0lEbh/0091c04NKKkhNShMj9sWqyfADIGoFXQl05TpjYZ 7j9A1FXpIIEdEwYze1FTKINBI27EiSaozaS7oQ9bNK1BFztQRxa22TtkmWEFmUKAQ+ZB Nzy0w3v1kP9zev1mkPZoA9lp3fLcgU4t6y3NmEjraSL8V+oHQ6LknVwFeNHupu+NLP73 Q8YBHbhPZtOVyBiwviEQHq0703WzQ6nsqSlyYrcGslLgXO3uwcIsdDebNOqrEuhe0uPS 29oPRFdsznFFLxhrSOb7M5UCeR5+K1sx5WNlxrRdHaRg5YW1mkMs3kIi/offf8HJ0AZ8 ngdA== 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=FR72I8Co0+MJGxYGED+5/dqb9dBV7h2vnmoy22KZs5Q=; b=fhek7j/xbdgXUfolGkExTNU8j/egNVunNmkW3c7Kome6NBzJ/Xg1/LydQmA9bG2oUK pQ5uMTfQystOgXQ98DDb/ap8mcbaIDulHbj6RsjB/H1AkZccRoDMti+azDdeMnFuapql RwhcJilFlS632pDXmC77USWO1H8inymvY2dHlqFXVNdSBBI6U7VQ+/SGO9wyCpFd+rOK B4mWGTe1f8U11RP2fEmwAT9h8XWpyXa+en2M5TDcgvJm53Z4XrgLYdcS/sWBS++zCGmz RkXXPurVO3t0qATLsJzJaokgxR1l0DEmMlVfCY2BzEXrPhejWC/px3+n7wlFCYt6NlLI Asig== X-Gm-Message-State: APjAAAXpvGjXElmtijeDgV5qjYi7m1mXdKtwNT4JvhvG+Y8h5pCa1bfY JzMyEx6L8lJp9OfaLMHE/zE= X-Google-Smtp-Source: APXvYqzL32mC6au/7C3TzD/kwMbOVnb1DJlzl+HtOU7wDCsXVoSrKw2C4o6YPmea15yYB/y61C1tKg== X-Received: by 2002:a17:902:868f:: with SMTP id g15mr8558096plo.67.1561690262921; Thu, 27 Jun 2019 19:51:02 -0700 (PDT) Received: from hfq-skylake.ipads-lab.se.sjtu.edu.cn ([202.120.40.82]) by smtp.googlemail.com with ESMTPSA id b1sm457294pfi.91.2019.06.27.19.50.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 27 Jun 2019 19:51:02 -0700 (PDT) From: Fuqian Huang To: Date: Fri, 28 Jun 2019 10:50:54 +0800 Message-Id: <20190628025055.16242-1-huangfq.daxian@gmail.com> X-Mailer: git-send-email 2.11.0 Cc: Rob Herring , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Greg Kroah-Hartman , Benjamin Herrenschmidt , Takashi Iwai , Richard Fontana , Paul Mackerras , Michael Ellerman , Fuqian Huang , Thomas Gleixner , linuxppc-dev@lists.ozlabs.org, Allison Randal Subject: [alsa-devel] [PATCH v2 27/27] sound: ppc: remove unneeded memset after dma_alloc_coherent X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" 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 has already zeroed the memory. So memset is not needed. Signed-off-by: Fuqian Huang --- sound/ppc/pmac.c | 1 - 1 file changed, 1 deletion(-) diff --git a/sound/ppc/pmac.c b/sound/ppc/pmac.c index 1b11e53f6a62..1ab12f4f8631 100644 --- a/sound/ppc/pmac.c +++ b/sound/ppc/pmac.c @@ -56,7 +56,6 @@ static int snd_pmac_dbdma_alloc(struct snd_pmac *chip, struct pmac_dbdma *rec, i if (rec->space == NULL) return -ENOMEM; rec->size = size; - memset(rec->space, 0, rsize); rec->cmds = (void __iomem *)DBDMA_ALIGN(rec->space); rec->addr = rec->dma_base + (unsigned long)((char *)rec->cmds - (char *)rec->space);