Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp933181rdh; Fri, 24 Nov 2023 01:10:08 -0800 (PST) X-Google-Smtp-Source: AGHT+IFaa9GJu/iaFJUfyKtY8+9+a5MI9cTtBXXQwPPdnRAqKoETv1a4BK9qoc5g7jLZkZajOaPj X-Received: by 2002:a05:6a20:3944:b0:18b:b858:17a5 with SMTP id r4-20020a056a20394400b0018bb85817a5mr2517012pzg.28.1700817008418; Fri, 24 Nov 2023 01:10:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700817008; cv=none; d=google.com; s=arc-20160816; b=OLpN9/RC/vf3o7Cj6rKmaEA5zoCAsiqzURUjOt6L5RKJXMRyODEq6YVYwWZ0+sGCnt H6aTK9KNwtURONGvm+V2AcwC1AC7HmXqXr4Qh3YKrtX8B1/s0P4pyjLjRb/hHjB1FMw/ UQBry3LGnN9vFNitmsHXbz/Izy4IIrmCty8QUXeqH7R53z4GyXthP2vFvbKVJZLVMe5y nStqqpvG+E704YNqQOia9BNuT2uASRVlMgz2iaiZGdjWv2w6oXR5UZq6RAVfRHBKBMZw Yo3/hVNmGeIVw40rWNQpN22w61aNiCLtTZHNfRMGFO5WP4VyGUgBTn2e/50Fb0UuJwry TwXA== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=hz/2myqVrdOC+0UwOitd1dKxjWdm0cU1EYlqpNpp+Hs=; fh=ByMNP9v8oTTQ9D3oENe8ie3upH8RbF0rG5JWAC8tKgw=; b=ZWSFSNYz2+ERwrTglHcLva9h4H2IIZ4QZr0VYH5G4BYm+9oSXNWAZq5CDd6xMoJlgB pqFe7RGDyu5VQjbm7zJIFs8i18EVB7R7ZdNfbJchJ3C025Q4OYVamTR6EKC5xCx4L8Ta PNVa5IPj/i7IAoNotYMMbmmgRZ815Q4Y4JfeYBXLQ54TocopzjD0YdQv/SMNlJ1X6kSZ fZDCvBFyrli5WYVRXq+oGaBFoQzTLiPHZOuWbC636YRJfH04EcEmh5se/XabjCynxhFu 77OkkYmN5nEnKPIfkNBFri5BEqIY6228tbck3cDKhDORcVeDRsAW9W6782J0uTKNxXVo 8OBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=h2T48vt+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id m2-20020a654382000000b005be00714949si3120057pgp.222.2023.11.24.01.10.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Nov 2023 01:10:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=h2T48vt+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 9EC0780A1380; Fri, 24 Nov 2023 01:10:03 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232479AbjKXJJo (ORCPT + 99 others); Fri, 24 Nov 2023 04:09:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51568 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230012AbjKXJJm (ORCPT ); Fri, 24 Nov 2023 04:09:42 -0500 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.9]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 834F7D5E; Fri, 24 Nov 2023 01:09:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1700816989; x=1732352989; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=JaTQ4JHa+dyVoXq+fCw9FkUT+lKnnmSMerIyEl8VRYc=; b=h2T48vt++CnaXEMlHgAJfLxPTpu+NrD9RSLgC88/jbZAM4cpH8rmJSql zK4A/6vPGcqervibKkhUNb7OXuf0iu2MAUtjX1GKIRoeMghOJThV/iK9s KdJVN4x13UOefTr5f1P/hCLRIfnes2ZCuFLhfzoeG+F04h2Uv0KZFKd1J 7Uv4SXI8Ly7z4tiLgqyAXAGlBZRXQDCYdZprNs4GvN3uJpkYDSJQTCKq/ ESNv8X71SxODjAFir04Fpd9qhgTfXaNX+C4UD0w4+Pqh7wOiAYPVj3Wum Co1399ZD3MgF6EyHLffRxOlMcEq+iAYPHNVbOuSDZRI4mfoQplYGD6SsF Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10902"; a="11066380" X-IronPort-AV: E=Sophos;i="6.04,223,1695711600"; d="scan'208";a="11066380" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Nov 2023 01:09:31 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10902"; a="885220541" X-IronPort-AV: E=Sophos;i="6.04,223,1695711600"; d="scan'208";a="885220541" Received: from mvlasov-mobl1.ger.corp.intel.com (HELO localhost) ([10.251.220.89]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Nov 2023 01:09:27 -0800 From: =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= To: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Bjorn Helgaas , linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org Cc: =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= Subject: [PATCH 1/6] x86: Use PCI_HEADER_TYPE_* instead of literals Date: Fri, 24 Nov 2023 11:09:13 +0200 Message-Id: <20231124090919.23687-1-ilpo.jarvinen@linux.intel.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Fri, 24 Nov 2023 01:10:03 -0800 (PST) Replace 0x7f and 0x80 literals with PCI_HEADER_TYPE_* defines. Signed-off-by: Ilpo Järvinen --- arch/x86/kernel/aperture_64.c | 3 +-- arch/x86/kernel/early-quirks.c | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/arch/x86/kernel/aperture_64.c b/arch/x86/kernel/aperture_64.c index 4feaa670d578..89c0c8a3fc7e 100644 --- a/arch/x86/kernel/aperture_64.c +++ b/arch/x86/kernel/aperture_64.c @@ -259,10 +259,9 @@ static u32 __init search_agp_bridge(u32 *order, int *valid_agp) order); } - /* No multi-function device? */ type = read_pci_config_byte(bus, slot, func, PCI_HEADER_TYPE); - if (!(type & 0x80)) + if (!(type & PCI_HEADER_TYPE_MFD)) break; } } diff --git a/arch/x86/kernel/early-quirks.c b/arch/x86/kernel/early-quirks.c index a6c1867fc7aa..59f4aefc6bc1 100644 --- a/arch/x86/kernel/early-quirks.c +++ b/arch/x86/kernel/early-quirks.c @@ -779,13 +779,13 @@ static int __init check_dev_quirk(int num, int slot, int func) type = read_pci_config_byte(num, slot, func, PCI_HEADER_TYPE); - if ((type & 0x7f) == PCI_HEADER_TYPE_BRIDGE) { + if ((type & PCI_HEADER_TYPE_MASK) == PCI_HEADER_TYPE_BRIDGE) { sec = read_pci_config_byte(num, slot, func, PCI_SECONDARY_BUS); if (sec > num) early_pci_scan_bus(sec); } - if (!(type & 0x80)) + if (!(type & PCI_HEADER_TYPE_MFD)) return -1; return 0; -- 2.30.2