From patchwork Fri Nov 24 09:09:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ilpo_J=C3=A4rvinen?= X-Patchwork-Id: 169317 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce62:0:b0:403:3b70:6f57 with SMTP id o2csp1021958vqx; Fri, 24 Nov 2023 01:10:05 -0800 (PST) X-Google-Smtp-Source: AGHT+IGmjMorMFILJFbgPBVn1iyTyHlDFFKCLhZi3MPcFy7Jjlh0nCkKB2Vxm+G5s85uufFdnB5I X-Received: by 2002:a17:90a:ce81:b0:281:3a5:d2ec with SMTP id g1-20020a17090ace8100b0028103a5d2ecmr7877298pju.8.1700817005238; Fri, 24 Nov 2023 01:10:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700817005; cv=none; d=google.com; s=arc-20160816; b=zFP1CqpAcPT37GRr/pj1j4eJY0LPBd/T1sbmQoVzYqA+UlPAcV9KwyxmnNoBU6q4Xx UNXH+V5uEZzGYlSSRFrUivPylypZp0OHd9aqb/a7zzBi9KWgOzeLW4Vkf/LlFnsi8d4C kbzBpQHXV2LuFA6RD+HAJtAVLG+gBeD4yJAyTReCGN3PLve3fKHJJXwZWBrqPlS0PgXF OSLbkJbPehFu7AQz6xIdmVUdgm2LKvDMg6sC6AqZF6mnv3q34+7+iFhq3WQnV1JpgbO4 QlTW8Zz5UjRVxAkp/7GvJBLYIIIRyVbA4iDCHCDG9TGqpCzaKkHRLqPg3/jmYtXlDARZ Yc/A== 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 23.128.96.31 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 morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id y6-20020a17090a474600b0028516fe2bffsi3644176pjg.186.2023.11.24.01.09.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Nov 2023 01:10:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; 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 23.128.96.31 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 E372580A1376; Fri, 24 Nov 2023 01:09:52 -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_J=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_J=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 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:09:53 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783435892079469021 X-GMAIL-MSGID: 1783435892079469021 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;