Received: by 10.213.65.68 with SMTP id h4csp722419imn; Fri, 6 Apr 2018 07:52:09 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+eIrAuN8Z9nKMPbPb/w2qz2IW1SDHGq4rKDMj7eu5nAbXkQtJEfMBvq8TwjdvlKBG7YggX X-Received: by 10.101.77.198 with SMTP id q6mr18319592pgt.61.1523026329078; Fri, 06 Apr 2018 07:52:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523026329; cv=none; d=google.com; s=arc-20160816; b=ksgZyUekYpa0lkH9rcOAyPIn97T0hJJNL0NMGR8N6hEab+MJzCPz9mdXcXWoYCN/qw Hh/ZSv+ihS1JiOEjs6kaXJVqXpyKq/6olM5t4jC9+iyPhw+reWq6lMd5CKBLHu6Nc+EC sEMseXINy0bnw/jILBu/APbSIzQRyeIvDOgoT3ERfXf727rF9T9bpTIXrDlSQRG7BskQ txXsLW3u29kwNZuD1Xi6QjpJ/8dvHsLm1q6gYbsZ10KPQHmr8GngAzrf7s5I2+Nbrr8J YC1xE0isxD6dvNPyNcnt/Ilba6TuWkzukDnnFoYn6Z7mhBvZoswMxEGAFej3xWBp6i6f mQ1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=TVEwuBiyTFjW/iduPe+5y+q0h18WMq2VVW2728aPwec=; b=f6Kk1VzA/XK5ZGhtJh+WoIsE+MMJ3wepgMQsEiHgpSF8tMg8Y2BGtHw3XrNbc/aqpy 7bWnTLuHJy5kWBoTC8wzHiIHUrDQCHPl8K2Il9r2xBj9XcZKMa/JFrdK3hX0ak9uk+YH dt+DVqroCp7UWWCJFLm1bIYJAmVaA8805QYPTRxRWPn7g7C5FPuAJwKc1ofWJreX7B8e Psy75hZH9yd+PsWtMwrG8QwdZE7lqx5CkClHV68HWJ1PFZ8y7z51BmF8lBYVeQg+yj0O Fg+VOKVL9q3DWm0RpyL4ESY1mhoEuR5IxXoPEj3pEyf6rkuWjRD4pzadcChIyBs29+3M Pqug== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z23si4971614pgc.484.2018.04.06.07.51.55; Fri, 06 Apr 2018 07:52:09 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755191AbeDFNc4 (ORCPT + 99 others); Fri, 6 Apr 2018 09:32:56 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:57670 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755363AbeDFNcx (ORCPT ); Fri, 6 Apr 2018 09:32:53 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 9A64AC7C; Fri, 6 Apr 2018 13:32:52 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Matthias Kaehlcke , Bjorn Helgaas , Nathan Chancellor Subject: [PATCH 4.9 013/102] PCI: Make PCI_ROM_ADDRESS_MASK a 32-bit constant Date: Fri, 6 Apr 2018 15:22:54 +0200 Message-Id: <20180406084333.495241476@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180406084331.507038179@linuxfoundation.org> References: <20180406084331.507038179@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Matthias Kaehlcke commit 76dc52684d0f72971d9f6cc7d5ae198061b715bd upstream. A 64-bit value is not needed since a PCI ROM address consists in 32 bits. This fixes a clang warning about "implicit conversion from 'unsigned long' to 'u32'". Also remove now unnecessary casts to u32 from __pci_read_base() and pci_std_update_resource(). Signed-off-by: Matthias Kaehlcke Signed-off-by: Bjorn Helgaas Cc: Nathan Chancellor Signed-off-by: Greg Kroah-Hartman --- drivers/pci/probe.c | 2 +- drivers/pci/setup-res.c | 2 +- include/uapi/linux/pci_regs.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c @@ -231,7 +231,7 @@ int __pci_read_base(struct pci_dev *dev, res->flags |= IORESOURCE_ROM_ENABLE; l64 = l & PCI_ROM_ADDRESS_MASK; sz64 = sz & PCI_ROM_ADDRESS_MASK; - mask64 = (u32)PCI_ROM_ADDRESS_MASK; + mask64 = PCI_ROM_ADDRESS_MASK; } if (res->flags & IORESOURCE_MEM_64) { --- a/drivers/pci/setup-res.c +++ b/drivers/pci/setup-res.c @@ -63,7 +63,7 @@ static void pci_std_update_resource(stru mask = (u32)PCI_BASE_ADDRESS_IO_MASK; new |= res->flags & ~PCI_BASE_ADDRESS_IO_MASK; } else if (resno == PCI_ROM_RESOURCE) { - mask = (u32)PCI_ROM_ADDRESS_MASK; + mask = PCI_ROM_ADDRESS_MASK; } else { mask = (u32)PCI_BASE_ADDRESS_MEM_MASK; new |= res->flags & ~PCI_BASE_ADDRESS_MEM_MASK; --- a/include/uapi/linux/pci_regs.h +++ b/include/uapi/linux/pci_regs.h @@ -106,7 +106,7 @@ #define PCI_SUBSYSTEM_ID 0x2e #define PCI_ROM_ADDRESS 0x30 /* Bits 31..11 are address, 10..1 reserved */ #define PCI_ROM_ADDRESS_ENABLE 0x01 -#define PCI_ROM_ADDRESS_MASK (~0x7ffUL) +#define PCI_ROM_ADDRESS_MASK (~0x7ffU) #define PCI_CAPABILITY_LIST 0x34 /* Offset of first capability list entry */