From patchwork Sat Oct 14 14:52:24 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin King X-Patchwork-Id: 10006423 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A85B8601E9 for ; Sat, 14 Oct 2017 14:53:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9A143291F0 for ; Sat, 14 Oct 2017 14:53:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8E896291F2; Sat, 14 Oct 2017 14:53:01 +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=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 15B5C291F7 for ; Sat, 14 Oct 2017 14:53:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753806AbdJNOwc (ORCPT ); Sat, 14 Oct 2017 10:52:32 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:50544 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753753AbdJNOwb (ORCPT ); Sat, 14 Oct 2017 10:52:31 -0400 Received: from 1.general.cking.uk.vpn ([10.172.193.212] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1e3Nnd-0006Mn-26; Sat, 14 Oct 2017 14:52:25 +0000 From: Colin King To: Paul Moore , Stephen Smalley , Eric Paris , James Morris , "Serge E . Hallyn" , Markus Elfring , selinux@tycho.nsa.gov, linux-security-module@vger.kernel.org Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] selinux: remove extraneous initialization of slots_used and max_chain_len Date: Sat, 14 Oct 2017 15:52:24 +0100 Message-Id: <20171014145224.840-1-colin.king@canonical.com> X-Mailer: git-send-email 2.14.1 MIME-Version: 1.0 Sender: owner-linux-security-module@vger.kernel.org Precedence: bulk List-ID: X-Virus-Scanned: ClamAV using ClamSMTP From: Colin Ian King Variables slots_used and max_chain_len are being initialized to zero twice. Remove the first set of initializations. Cleans up the clang warnings: Value stored to 'slots_used' is never read Value stored to 'max_chain_len' is never read Signed-off-by: Colin Ian King --- security/selinux/ss/hashtab.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/security/selinux/ss/hashtab.c b/security/selinux/ss/hashtab.c index bef7577d1270..622fd50c8b9c 100644 --- a/security/selinux/ss/hashtab.c +++ b/security/selinux/ss/hashtab.c @@ -148,8 +148,6 @@ void hashtab_stat(struct hashtab *h, struct hashtab_info *info) u32 i, chain_len, slots_used, max_chain_len; struct hashtab_node *cur; - slots_used = 0; - max_chain_len = 0; for (slots_used = max_chain_len = i = 0; i < h->size; i++) { cur = h->htable[i]; if (cur) {