From patchwork Fri Dec 18 20:01:32 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Mc Guire X-Patchwork-Id: 7887701 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 86BC8BEEE5 for ; Fri, 18 Dec 2015 20:10:44 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4C8792050B for ; Fri, 18 Dec 2015 20:10:43 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 5058120502 for ; Fri, 18 Dec 2015 20:10:42 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id AFCAA265856; Fri, 18 Dec 2015 21:10:40 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,NO_DNS_FOR_FROM, RCVD_IN_DNSWL_LOW, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 7A6102605B4; Fri, 18 Dec 2015 21:10:33 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id C0CC32605C0; Fri, 18 Dec 2015 21:10:31 +0100 (CET) Received: from www.osadl.org (www.osadl.org [62.245.132.105]) by alsa0.perex.cz (Postfix) with ESMTP id A245D26055F for ; Fri, 18 Dec 2015 21:10:24 +0100 (CET) Received: from debian.hofr.at (mail.osadl.at [92.243.35.153]) by www.osadl.org (8.13.8/8.13.8/OSADL-2007092901) with ESMTP id tBIKAIFV027376; Fri, 18 Dec 2015 21:10:18 +0100 From: Nicholas Mc Guire To: Jaroslav Kysela Date: Fri, 18 Dec 2015 21:01:32 +0100 Message-Id: <1450468892-32116-1-git-send-email-hofrat@osadl.org> X-Mailer: git-send-email 1.7.10.4 Cc: alsa-devel@alsa-project.org, Lars-Peter Clausen , Takashi Iwai , linux-kernel@vger.kernel.org, Nicholas Mc Guire Subject: [alsa-devel] [PATCH] ALSA: consolidate allocation API X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 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-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP This is an API consolidation only. The use of kmalloc + memset to 0 is equivalent to kzalloc. Signed-off-by: Nicholas Mc Guire --- Found by coccinelle script (relaxed version of scripts/coccinelle/api/alloc/kzalloc-simple.cocci) Patch was compile tested with: x86_64_defconfig CONFIG_SND_SEQUENCER=y, CONFIG_SND_SEQUENCER_OSS=y Patch is against linux-next (localversion-next is -next-20150518) 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 b1221b2..9babc9e 100644 --- a/sound/core/seq/oss/seq_oss_init.c +++ b/sound/core/seq/oss/seq_oss_init.c @@ -79,7 +79,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; @@ -94,7 +94,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 */