From patchwork Thu Jul 6 13:23:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Christian_G=C3=B6ttsche?= X-Patchwork-Id: 116719 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2564040vqx; Thu, 6 Jul 2023 06:32:40 -0700 (PDT) X-Google-Smtp-Source: APBJJlED20sTZFig6foDYC9c55JGAAybTKN4qPFlmLVFtw2TQkbjxSHsukE970//UddFRKhrax/+ X-Received: by 2002:a17:90b:e10:b0:263:fa04:4f53 with SMTP id ge16-20020a17090b0e1000b00263fa044f53mr1307344pjb.2.1688650360548; Thu, 06 Jul 2023 06:32:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688650360; cv=none; d=google.com; s=arc-20160816; b=ve+e3aGu+sSoujMa83FE7icm49FMrudISP72U6/Cw9iQP1cbIwujKLv8XNxsAXxzbK +88RDNTIu+iT2m80qdnA/tdIV4+JFgKtSnb+WO3SmmSLNvv3U8N1HA42ji9HlbTfLvtD 7lahrrj/iQdL0OBaD425/tV/ZDV8t5kkielnod1l+vPzlMKweeHqigGlJSFqIyAUm7jn FjWPxCDbxYqoPMC2lEe7aHVMavVQxUXyZnxq7hFrJv7igAeWBtlT+7Pqf9Dl/mu64haV 7vGRFjRXS5W19y+BY15SO6/3f0aC3ejiwEpUmJ33OIG7Giu+GFyc2ZTTwciDk0xjos6s COiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=twwRuxY6wI3Kg6heMmcwREwGj5Jtv6WXh1HJopMuo9M=; fh=QKur2PFwoLuCt27JzfZM4LabS9ldoGoSAJNPH9t/KWI=; b=S9JOsSWvGyD2+aj1F1h1Zk1s9RbnIN/0wddp6qwyiPzTSYq/P+lCAipOXLqO3ss4Hn MVa5QTs+1U09KXMpshFXUHOP94+HmyzBd72iEFqzrDi1pF21WEnZEnRd4/5ZeYFuTVEz EfWhrmFgHhtiujA9yA0zWyLnq+vo7pW/UsLHlwAAB09Il92z9hfAqecr2hQYe8IJbTlU xXDjb/FngcCXcesHH7kBS1r1QXyEw3dPwQd8+kZRiVOX9rFiNE7KkqNRiHCo1OFgQyvv B+y2zC9qkg0/0ntprx+JyPuaJiK7roHySLpR2rWUMJzP/BrZNNkEJYRm2MZuzMzwic6h Fy6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@googlemail.com header.s=20221208 header.b=QYgxRvyq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=googlemail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ei23-20020a17090ae55700b0025defcc6e75si1432614pjb.172.2023.07.06.06.32.25; Thu, 06 Jul 2023 06:32:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@googlemail.com header.s=20221208 header.b=QYgxRvyq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=googlemail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232592AbjGFNYT (ORCPT + 99 others); Thu, 6 Jul 2023 09:24:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41192 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232248AbjGFNX5 (ORCPT ); Thu, 6 Jul 2023 09:23:57 -0400 Received: from mail-ej1-x633.google.com (mail-ej1-x633.google.com [IPv6:2a00:1450:4864:20::633]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6016C1BD0; Thu, 6 Jul 2023 06:23:55 -0700 (PDT) Received: by mail-ej1-x633.google.com with SMTP id a640c23a62f3a-99384a80af7so81182266b.2; Thu, 06 Jul 2023 06:23:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20221208; t=1688649834; x=1691241834; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=twwRuxY6wI3Kg6heMmcwREwGj5Jtv6WXh1HJopMuo9M=; b=QYgxRvyqawTzN1vInTvH1KRmelQcb+xZLwjKwmBxAzsui0bJ8PfX+UtyZCMTJ1WaVc ZNmRehBukvKqPo8ryX7uLW37wAINUM4JXjBGUgBbbhZSDOohBGZmTI+hmXGRd5oqy+Ii 0EUXhwdOLy+KM6eRut1aG85YH54T5fXv+v1r1OxhI57hyiintFUfmObk8wvPFDL+xGbZ mO9W+lvh6edsDsjPZF7mZyLgnydEPsziQBugtWXe/Al2fGark+gwCE3Yn65JmLCZYOO8 t0x226t2MkLVbNXEDhM3vPQTPL4cGv6JzwpajWv7kQaKGHKf8dFakCwTzSAhSgHq9m0w ORcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688649834; x=1691241834; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=twwRuxY6wI3Kg6heMmcwREwGj5Jtv6WXh1HJopMuo9M=; b=Qof1XUXj0CJZKO/ehu1Zi7DHu9MWFY3L/EzXhbtiHx+WZg3avjhjdo/TxxaBgoU+aa +CTNR7aM12Sd/IaTRAFhMzHKhqbgtxMwjg93dDIO5gG4m/pfYB9Emwbs9NrvTWKeKq2t ME+SLLUDg5Ia0vRcCHiRRhZ3iODRzO0d5vfsXGu32cJHAcEsvQSEyIAHD2A34ntLAp3+ 3ZqWMXEtTTDBv9tNV3lHokNx3K1VSwZ/m/340bfHmTe9nX5qI0bWPWCXgWVyKnlZXqac MoVs+sBgydYcHVc1FV/MjELNoGgH+85tfdydgqRRnEIHNyutzHRyBRmCyL+PEeJBENmo u3vQ== X-Gm-Message-State: ABy/qLZvfewTC1XATiqjJwsiC3Lk3RB0xno3NBLXvGdtMzVAYehaX2QI x9aH7+d/lZAeNvHGCoZfVHpZJpcQjnThJLPp X-Received: by 2002:a17:906:519d:b0:98d:ffdf:29cb with SMTP id y29-20020a170906519d00b0098dffdf29cbmr1514386ejk.2.1688649833833; Thu, 06 Jul 2023 06:23:53 -0700 (PDT) Received: from debian_development.DebianHome (dynamic-077-008-088-179.77.8.pool.telefonica.de. [77.8.88.179]) by smtp.gmail.com with ESMTPSA id r2-20020a170906364200b00988dbbd1f7esm808024ejb.213.2023.07.06.06.23.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jul 2023 06:23:53 -0700 (PDT) From: =?utf-8?q?Christian_G=C3=B6ttsche?= To: selinux@vger.kernel.org Cc: Paul Moore , Stephen Smalley , Eric Paris , linux-kernel@vger.kernel.org Subject: [RFC PATCH 10/20] selinux: netif: avoid implicit conversions Date: Thu, 6 Jul 2023 15:23:25 +0200 Message-Id: <20230706132337.15924-10-cgzones@googlemail.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230706132337.15924-1-cgzones@googlemail.com> References: <20230706132337.15924-1-cgzones@googlemail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770678240518500172?= X-GMAIL-MSGID: =?utf-8?q?1770678240518500172?= Use the identical type sel_netif_hashfn() returns. Signed-off-by: Christian Göttsche --- security/selinux/netif.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/security/selinux/netif.c b/security/selinux/netif.c index adbe9bea2d26..43a0d3594b72 100644 --- a/security/selinux/netif.c +++ b/security/selinux/netif.c @@ -67,7 +67,7 @@ static inline u32 sel_netif_hashfn(const struct net *ns, int ifindex) static inline struct sel_netif *sel_netif_find(const struct net *ns, int ifindex) { - int idx = sel_netif_hashfn(ns, ifindex); + u32 idx = sel_netif_hashfn(ns, ifindex); struct sel_netif *netif; list_for_each_entry_rcu(netif, &sel_netif_hash[idx], list) @@ -89,7 +89,7 @@ static inline struct sel_netif *sel_netif_find(const struct net *ns, */ static int sel_netif_insert(struct sel_netif *netif) { - int idx; + u32 idx; if (sel_netif_total >= SEL_NETIF_HASH_MAX) return -ENOSPC;