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 */