From mboxrd@z Thu Jan 1 00:00:00 1970 From: Luc Van Oostenryck Subject: [PATCH 09/17] scope: no memset() needed after __alloc_scope() Date: Mon, 13 Apr 2020 18:15:57 +0200 Message-ID: <20200413161605.95900-10-luc.vanoostenryck@gmail.com> References: <20200413161605.95900-1-luc.vanoostenryck@gmail.com> Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Return-path: Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38426 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731400AbgDMQQV (ORCPT ); Mon, 13 Apr 2020 12:16:21 -0400 Received: from mail-wm1-x341.google.com (mail-wm1-x341.google.com [IPv6:2a00:1450:4864:20::341]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 62A2FC0A3BDC for ; Mon, 13 Apr 2020 09:16:21 -0700 (PDT) Received: by mail-wm1-x341.google.com with SMTP id d77so9802459wmd.3 for ; Mon, 13 Apr 2020 09:16:21 -0700 (PDT) In-Reply-To: <20200413161605.95900-1-luc.vanoostenryck@gmail.com> Sender: linux-sparse-owner@vger.kernel.org List-Id: linux-sparse@vger.kernel.org To: linux-sparse@vger.kernel.org Cc: Luc Van Oostenryck When starting some scopes, the newly allocated struct is memset'ed with zero but this is unneeded since the allocator always returns zeroed memory. Remove the unneeded call to memset(). Signed-off-by: Luc Van Oostenryck --- scope.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/scope.c b/scope.c index 420c0f5a3f51..0e4fb3b42150 100644 --- a/scope.c +++ b/scope.c @@ -68,7 +68,6 @@ void rebind_scope(struct symbol *sym, struct scope *new) static void start_scope(struct scope **s) { struct scope *scope = __alloc_scope(0); - memset(scope, 0, sizeof(*scope)); scope->next = *s; *s = scope; } @@ -77,7 +76,6 @@ void start_file_scope(void) { struct scope *scope = __alloc_scope(0); - memset(scope, 0, sizeof(*scope)); scope->next = &builtin_scope; file_scope = scope; -- 2.26.0