Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp30474583rwd; Thu, 6 Jul 2023 06:31:27 -0700 (PDT) X-Google-Smtp-Source: APBJJlEJcOYIzT+GAQ2DBB8hyejU+m9ouyBbY6zS0uJYC+/05Lm9Hvoc2YlkL5qnT7Z71tRO3S91 X-Received: by 2002:a17:90a:64cd:b0:262:e946:7ec4 with SMTP id i13-20020a17090a64cd00b00262e9467ec4mr1326846pjm.17.1688650286950; Thu, 06 Jul 2023 06:31:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688650286; cv=none; d=google.com; s=arc-20160816; b=wqpBD1T6irHoNbbKwXWXjYo9laDiWqF8LArTfDAEh/qmGdC0LW/0K4wZ8JNaMUMvcw 4hl35hQYoTu9q5Hkm7NP2RXrhd+a46dqB7I/DQXUHZAyEuCqQt7gNrydiL14dDVUaofr RL4+S+5Q3+nMwrve+vj/3OlzZDq0T+/7qdcIgxrTOOqrqofq1D3slJUCja7k10fa7npq x42qtEQXC3WjZJMxvtLxiWi66inO8WhEF1QzTKxvdkfPqMHHBRLCVUvBNguiMh/MOJ89 o1Yi9sOhrGAuCI/azinNYzvaOFqi3T9PMTKNqMx50q9d9wgnVFG/2SxfsnNbQ4UyaSt3 2u5g== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o17-20020a17090b0c9100b0026360db339fsi1499419pjz.12.2023.07.06.06.31.10; Thu, 06 Jul 2023 06:31:26 -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 S232590AbjGFNYS (ORCPT + 99 others); Thu, 6 Jul 2023 09:24:18 -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=20G=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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 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; -- 2.40.1