From patchwork Sat Jul 19 11:37:41 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: HIMANGI SARAOGI X-Patchwork-Id: 4589291 Return-Path: X-Original-To: patchwork-linux-parisc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id F11489F1D6 for ; Sat, 19 Jul 2014 11:37:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3ACDF20179 for ; Sat, 19 Jul 2014 11:37:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 43C332011B for ; Sat, 19 Jul 2014 11:37:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761459AbaGSLht (ORCPT ); Sat, 19 Jul 2014 07:37:49 -0400 Received: from mail-pd0-f182.google.com ([209.85.192.182]:49423 "EHLO mail-pd0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1761022AbaGSLhs (ORCPT ); Sat, 19 Jul 2014 07:37:48 -0400 Received: by mail-pd0-f182.google.com with SMTP id fp1so6398703pdb.41 for ; Sat, 19 Jul 2014 04:37:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:mime-version:content-type :content-disposition:user-agent; bh=8JZYG/FmiHGOqgRFNqealPz/fAU+PJntPJvGZ6vIprk=; b=M/PGpPCaOHpPAHLjgfV8jIuoUZPa8sy8IBg0mLDVOPtFWmf7AoIzgAhYWhiM2CjT0u 8f1taLuinShGOUFR4rPZMapuS8Oglta2SpycRkQkZu2C2l4r7xhJRlHMVoRNXfQ0NC7t QudieQgpe0jFWzKZkbTJblLxg6KcCVUe3vXL9Nzk0v1L1UoqNY4HjMiTowV41gJ80CGv k6C9vNK9jg1F4eAJrFZr8gaefGrWPVKUFiWhKOJY3+alM/RU1cfhIDwYXPpY2h+3B7uX /2kgB4DfcLiarzRL3Pupetp4zxKhxmbvrEilYfcafPh4zhO159BUJYvyd5QBBLzwFHY8 YuIQ== X-Received: by 10.66.163.98 with SMTP id yh2mr12075476pab.104.1405769868387; Sat, 19 Jul 2014 04:37:48 -0700 (PDT) Received: from localhost ([125.17.132.98]) by mx.google.com with ESMTPSA id cr4sm8327576pbb.86.2014.07.19.04.37.44 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sat, 19 Jul 2014 04:37:47 -0700 (PDT) Date: Sat, 19 Jul 2014 17:07:41 +0530 From: Himangi Saraogi To: "James E.J. Bottomley" , Helge Deller , linux-parisc@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Julia Lawall Subject: [PATCH] parisc: Eliminate memset after alloc_bootmem_pages Message-ID: <20140719113741.GA23655@himangi-Dell> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-parisc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP alloc_bootmem and related function always return zeroed region of memory. Thus a memset after calls to these functions is unnecessary. The following Coccinelle semantic patch was used for making the change: @@ expression E,E1; @@ E = \(alloc_bootmem\|alloc_bootmem_low\|alloc_bootmem_pages\|alloc_bootmem_low_pages\)(...) ... when != E - memset(E,0,E1); Signed-off-by: Himangi Saraogi Acked-by: Julia Lawall --- arch/parisc/mm/init.c | 1 - 1 file changed, 1 deletion(-) diff --git a/arch/parisc/mm/init.c b/arch/parisc/mm/init.c index ae085ad..0bef864 100644 --- a/arch/parisc/mm/init.c +++ b/arch/parisc/mm/init.c @@ -728,7 +728,6 @@ static void __init pagetable_init(void) #endif empty_zero_page = alloc_bootmem_pages(PAGE_SIZE); - memset(empty_zero_page, 0, PAGE_SIZE); } static void __init gateway_init(void)