Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp4034068ybi; Tue, 18 Jun 2019 10:34:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqzSi9frqyAjB084f6nzFrra7sCeA3xToJEhL4WfqZIp3xEZGoarEuniU7tYlmjhJM4XxKCK X-Received: by 2002:a17:902:e2:: with SMTP id a89mr115874318pla.210.1560879294312; Tue, 18 Jun 2019 10:34:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560879294; cv=none; d=google.com; s=arc-20160816; b=uOBuzj0cIpRDvcHNBX/Z0pbExpbXVLD1ZW9Dl5NheAmqMP3yrIQ0B8lAxfmx17s8n4 0bC3MyVYqrLZFLPIe57V1KEzVwUBGNt8h6Deq0VFoms8gST3WdYuXBWm5uD++Q4pgysS YFukStdSX8KkUUya0uItZwuiahWVm2zCURLqEUdIrUl1bUAX+PjiIa6wpzb9lTc3hqno 7zKCn2XssLon93hUP8Ga4NLOdj9VPrQTKzKiybq7NBHNnMOVMnQ9wcKnYWStclKQ4Mrj er38aSAh2YpTlP2gSPylDfSFcN/T0UPfLYGwRcJyzB+l5IAMc/dDWZSUDKIC1CjyhrXh ulsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-disposition :mime-version:message-id:subject:to:from:date:dkim-signature; bh=+2YaykVn++bx3Y+KHfNzRgksUkYd1b1acyBCPmK1ESg=; b=Vr2bTi5ltr94NON1oUjm7cmY4x6lhdv2ypsCVXhhB74NhvQJaA4k5SMcbBXvSFLEN7 9motcsrTWo1spPFbfWidTGKpK9fukYr9ytD6isu0iOFdFftP/ZoNLY5j5T8486Jt/D2/ zZ97gWfvY20/EIJjuegYDCJOsFiAODmKmz29FFr9Srxd+6IiJ2nJ9eVjeiEADFvca5KM 9yta1GYVGoqeW7BzLJj0PDuzZ21LIJmQX50g7ApvvzJryM8nDKPXpDyvHw3fJ/QOL+M8 E6LP5mhUoCPCIgxfjDFFQUjMOXVay8J4U6Y7rM/QJghZpLwk/cdAa4vuHeoRrW8DYfOj F+gQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=nP9AQBSF; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id cd3si9669237plb.228.2019.06.18.10.34.36; Tue, 18 Jun 2019 10:34:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=nP9AQBSF; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729846AbfFRRdM (ORCPT + 99 others); Tue, 18 Jun 2019 13:33:12 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:41983 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728572AbfFRRdM (ORCPT ); Tue, 18 Jun 2019 13:33:12 -0400 Received: by mail-pg1-f194.google.com with SMTP id 83so8050290pgg.8 for ; Tue, 18 Jun 2019 10:33:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:mime-version:content-disposition :user-agent; bh=+2YaykVn++bx3Y+KHfNzRgksUkYd1b1acyBCPmK1ESg=; b=nP9AQBSFgnWkiOmTl5JuSjlUIjru21cKetedkVCknU4uibtUwP8x3JBiF+KIaUmF9i MWD6RVEFFdb5jDE+htDOk8e6og5Zmse54tZaqA8IHb4BFz3VlJoFyi0tzcaU2my3XO4D Gfu4u3ZklbxntrED5I0pvVQYoARSj3MScZpEQre325s9DLcXh8SUSy16XAn9rvKRTABh m4cElPAUa+T0t5p4uMGhErlTMBjHfgVBt/BR5tOQKiTFW+WcvZQHy1LtaUwUZcfnpEPi THeUpF3Eelz+9+3p7Mp76VSdJ3fdhTLBJccKS+bHNy8upBr+MOJZHKLr+pyMyafTO/Ak r6ow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:mime-version :content-disposition:user-agent; bh=+2YaykVn++bx3Y+KHfNzRgksUkYd1b1acyBCPmK1ESg=; b=ucflYMxl3Vh5Vt6Vd0JBejkrkgMV6kIY0wNWrf9rYIwQ7h4J6HU+vj03IHlQxr4pVJ VVHotsxXNrlZY4ScGy1EThs2urUCYHoE3qevT6jgw2H2kGzfVs+c7lFOUcgKc0ctvDJ6 /FgyawltW2/VdCdBa06WDadBLG5hlRxIrrvIqt8rgPFyPJeeq9U3ZKmtECDJCTMjh1Jw zVD1WzHkIfiu1KhvPz2jdjat24bx7ykG8lnMAcH9hxijZFqEzHaS/hcRpXlJXDhqZNWL iowgeg+pfjcAK7XT4wAgxZndNIOAyF/vCR7ZJaesQZdNEh4qZ8Nj9uuynALv68PlZ1LK oQQQ== X-Gm-Message-State: APjAAAWhcnOUQdOkAwrVy0kjCu05oxofGfMWmQDkQbsAsARewK4tv4Qe NE2lCWREIWvbE7DIBJ68+Cg= X-Received: by 2002:a62:8643:: with SMTP id x64mr87048095pfd.7.1560879191390; Tue, 18 Jun 2019 10:33:11 -0700 (PDT) Received: from hari-Inspiron-1545 ([183.83.92.187]) by smtp.gmail.com with ESMTPSA id 14sm17529219pfj.36.2019.06.18.10.33.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 18 Jun 2019 10:33:10 -0700 (PDT) Date: Tue, 18 Jun 2019 23:03:05 +0530 From: Hariprasad Kelam To: Larry Finger , Florian Schilhabel , Greg Kroah-Hartman , Julia Lawall , Michael Straube , Hariprasad Kelam , Dafna Hirschfeld , devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: [PATCH] staging: rtl8712: rtl87x_io : make use of kzalloc Message-ID: <20190618173305.GA4776@hari-Inspiron-1545> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org kmalloc followed by memset can be replaced with kzalloc. Signed-off-by: Hariprasad Kelam --- drivers/staging/rtl8712/rtl871x_io.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/staging/rtl8712/rtl871x_io.c b/drivers/staging/rtl8712/rtl871x_io.c index 17dafef..87024d6 100644 --- a/drivers/staging/rtl8712/rtl871x_io.c +++ b/drivers/staging/rtl8712/rtl871x_io.c @@ -107,13 +107,11 @@ uint r8712_alloc_io_queue(struct _adapter *adapter) INIT_LIST_HEAD(&pio_queue->processing); INIT_LIST_HEAD(&pio_queue->pending); spin_lock_init(&pio_queue->lock); - pio_queue->pallocated_free_ioreqs_buf = kmalloc(NUM_IOREQ * + pio_queue->pallocated_free_ioreqs_buf = kzalloc(NUM_IOREQ * (sizeof(struct io_req)) + 4, GFP_ATOMIC); if ((pio_queue->pallocated_free_ioreqs_buf) == NULL) goto alloc_io_queue_fail; - memset(pio_queue->pallocated_free_ioreqs_buf, 0, - (NUM_IOREQ * (sizeof(struct io_req)) + 4)); pio_queue->free_ioreqs_buf = pio_queue->pallocated_free_ioreqs_buf + 4 - ((addr_t)(pio_queue->pallocated_free_ioreqs_buf) & 3); -- 2.7.4