From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ed1-f43.google.com (mail-ed1-f43.google.com [209.85.208.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 192282C82 for ; Tue, 25 Jan 2022 14:14:53 +0000 (UTC) Received: by mail-ed1-f43.google.com with SMTP id p12so63190111edq.9 for ; Tue, 25 Jan 2022 06:14:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=NRMo8oBZ8+mVDMCIjAmqszLdgAaOe0du5QVx8CbR6LU=; b=Keg/CfUa7pgzGJokONpw5J5CoQdeJfQqPtdVD6pzALAt/5u/vrr/8n8G8ue+OvxStH x8obD8gvX1gNPUmXJ5C8lBmA05Px0E+0bak7zTXR1xCy30MR/t14N5WJaOSdD416v8Aq Tmwt6y0Orx8j4kkOIw2agGeErFRRPB3zTXEJSpNkaeTbmy70JrdSfGQ4ErcciKmP4WNN l3eS+LOGgfQtD/vA3IUTkX0BeDihIgKSxkIfZi4AcjOZtb8aQt/o48/zhlg4Y63aOYU+ 0sbBtjJVjUBzrIt7Jf/L9pUxZbtmPrwPnM4Iag8Bw9nLcmIanFTMsIqPfpx/cjoLtPUB q1/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=NRMo8oBZ8+mVDMCIjAmqszLdgAaOe0du5QVx8CbR6LU=; b=Yupg8t7LAg7Lyv2oAlFm5rkafVi31NH7m2Cs4VY7C+4CCr65waA9LSKa11RVoSejah N9+B0Ib0e3trRyR6i+DrHydIJt3wIhqLppmeEDvF4EFw7NTzEmNqKbZH8gpEW3ovwvmU 7a1ms+pnOH9oqbUlLG58ZstxDr5ddkNLoLmeHF0i5Y1FIss1X/uDPhJVV6J2TkGnOwXE 6eDWZbbRLnxu8S4M0b1U8DbLEKDI15YLnZL6yDXOI4CPyqgq8CaHBbg4TXVFLWXjC+9M K7sui/ZlDM4ip1vcfPYBubLVTUkdfImR+HyKoLNF20B0t1X4MdtwdhVVb74c39J7+OLf SxBA== X-Gm-Message-State: AOAM532FoHGNp9aqI1UV7R/oxx5lOAgcw2RG1hVGYvLRejJEf1WEYkg7 dOf6kf6+REIjYjKBFeByims= X-Google-Smtp-Source: ABdhPJxzNTfugb/8TN28oCuJEKaHituBsPLKKjb+mWflGgyqXKjhjIHzmLU75UQmOIYSLm9pI2z8Fw== X-Received: by 2002:a05:6402:c8c:: with SMTP id cm12mr20320905edb.78.1643120091453; Tue, 25 Jan 2022 06:14:51 -0800 (PST) Received: from debianHome.localdomain (dynamic-077-010-144-044.77.10.pool.telefonica.de. [77.10.144.44]) by smtp.gmail.com with ESMTPSA id lu44sm6292929ejb.145.2022.01.25.06.14.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Jan 2022 06:14:51 -0800 (PST) From: =?UTF-8?q?Christian=20G=C3=B6ttsche?= To: selinux@vger.kernel.org Cc: Paul Moore , Stephen Smalley , Eric Paris , Nathan Chancellor , Nick Desaulniers , Jiapeng Chong , Xiu Jianfeng , Jeff Vander Stoep , linux-kernel@vger.kernel.org, llvm@lists.linux.dev Subject: [PATCH 3/9] selinux: declare name parameter of hash_eval const Date: Tue, 25 Jan 2022 15:14:13 +0100 Message-Id: <20220125141422.32655-2-cgzones@googlemail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220125141422.32655-1-cgzones@googlemail.com> References: <20220125141422.32655-1-cgzones@googlemail.com> Precedence: bulk X-Mailing-List: llvm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit String literals are passed as second argument to hash_eval(). Also the parameter is already declared const in the DEBUG_HASHES configuration. Reported by clang [-Wwrite-strings]: security/selinux/ss/policydb.c:1881:26: error: passing 'const char [8]' to parameter of type 'char *' discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers] hash_eval(&p->range_tr, rangetr); ^~~~~~~~~ security/selinux/ss/policydb.c:707:55: note: passing argument to parameter 'hash_name' here static inline void hash_eval(struct hashtab *h, char *hash_name) ^ security/selinux/ss/policydb.c:2099:32: error: passing 'const char [11]' to parameter of type 'char *' discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers] hash_eval(&p->filename_trans, filenametr); ^~~~~~~~~~~~ security/selinux/ss/policydb.c:707:55: note: passing argument to parameter 'hash_name' here static inline void hash_eval(struct hashtab *h, char *hash_name) ^ Signed-off-by: Christian Göttsche --- security/selinux/ss/policydb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security/selinux/ss/policydb.c b/security/selinux/ss/policydb.c index 0ae1b718194a..67e03f6e8966 100644 --- a/security/selinux/ss/policydb.c +++ b/security/selinux/ss/policydb.c @@ -704,7 +704,7 @@ static void symtab_hash_eval(struct symtab *s) } #else -static inline void hash_eval(struct hashtab *h, char *hash_name) +static inline void hash_eval(struct hashtab *h, const char *hash_name) { } #endif -- 2.34.1