Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1452199yba; Wed, 24 Apr 2019 23:18:01 -0700 (PDT) X-Google-Smtp-Source: APXvYqyo6+O1XsTIh0SjOD7rHaYgIP+lKH45wxu4S8ct/OWb4pBpY5symMsyx0i1VmFYZiBmlHoO X-Received: by 2002:a17:902:e683:: with SMTP id cn3mr37320322plb.115.1556173081147; Wed, 24 Apr 2019 23:18:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556173081; cv=none; d=google.com; s=arc-20160816; b=zxVcc1irKbPHvxtFajTB4S1+qIryKvZt6Uz7DBm6ZFso8u2t98zuLKzzuaxASVVT1/ LrrC6Nvxt4f1Q/5yIzAQrpfIrVcZAL0nJPw+UTJMoRXu2I8rozOZ4Ny9q6FI2+VqKgyf h/hFDO/OUnUDgS01C28oMa7wKHVZzvLXbpk7vrcTlYXKGpyrYgPxGPayh4O+/iUP0CvJ Z6HOakujMfQmPJkBIZzbWph5rf+Rm2FZyIKTWcGcudLAjs6cS/VDxBx4+y2XBp+WXWSa YGDwzovsRO8835T2wr6lgnM1TqbRCYLK3/yk3L3EUCUNsOZZBtEVNUKd0Hb7BEOZ2Iif +lEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:references:cc:to:from:subject:dkim-signature; bh=vWfV/uLxHlKTCY8jgaOm/hsQsubaADZJKJWfjxs7Npo=; b=gYXQ1Mj1MgC98VV7Mjsm91xasCUEZwtFMOIvoljN3thUopXmfqgS5rarEk5qW3Ibrr RPK9dsdIpZD5D4A7HUGbMc8sq6ZlAzhsp/kJPvn1wIpJyf4/1yolN8EWsXtdYMVzjYf3 GtvU7TgYKlIEAwKXQetwj7GRrND1N1dxR2koPxAfANVho7MZsdRpK1t7+PQTeweRdwdB rrK3rK+7czf4X72V4VSPG8c0axNqSeVd4HG9mTMYDRsE571HBjAFNLrhIp6TdquJfJH/ +dknDduUNkxd7EFI7Qr1IHam3KJmMqs94z5JEEfV5+9Rqag0X3Wy31RjX5eNEgJqS5NS U19g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="q/vVbZY/"; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l189si19755509pgd.291.2019.04.24.23.17.45; Wed, 24 Apr 2019 23:18:01 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b="q/vVbZY/"; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731052AbfDXTRl (ORCPT + 99 others); Wed, 24 Apr 2019 15:17:41 -0400 Received: from mail-wm1-f65.google.com ([209.85.128.65]:39975 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727357AbfDXTRl (ORCPT ); Wed, 24 Apr 2019 15:17:41 -0400 Received: by mail-wm1-f65.google.com with SMTP id z24so6671748wmi.5; Wed, 24 Apr 2019 12:17:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:from:to:cc:references:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=vWfV/uLxHlKTCY8jgaOm/hsQsubaADZJKJWfjxs7Npo=; b=q/vVbZY/oSONQZN13xcosLByqm2O1DfMuokvB/Zs2CWi9b5hGXmvyq5jC9E3clmH+l mIkrlnMdfjyZvxDJ7sKt77zegqGhpIuSqQ+loZavowwQos0CAq4G8VuC2WsyZSU4w9eS FEpVZEGh+2MtbxAPoEBXG807GvXT+LbvdPixqZwaMbJnTUMyKK9cG9RgV7pugAkrGx0+ VlDqc1JKTGsHMFI/rNNYUesCgEfddgmbZ68Cmkgj3BJX0xcTRbEbCbMwco6Yc1n7sbDy tm3SLEuQ1Aojh+7gfxXY3GPDcxlsHmodwHLzy1agZwERBblJjhvLLUlBgvN1AxNgjjzB +NYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=vWfV/uLxHlKTCY8jgaOm/hsQsubaADZJKJWfjxs7Npo=; b=jvYwWiTcNnOTaYX8lMKXSHwa6JiqnElNfwfufVCYtihzqxOk7XOFLzm9MCL7nND+fn gEWUjnQwv/yWxPtSncGhTTpg4xRm+ONRjkffROap52wI2JSCseJkaYj/veCWQLeFW783 4hesdE6G/5i2JFN0S+edEWDRG43VuP+C9Yl3RfGy/d1b+XGOaFQWwsxacq6ViuYyOZoa JYA/e1EEWkmahT6XFuqylB8VPVzJV+aLNbpx7bgC2pOYunrZZCA6qZ3GuCx5lo9pLzgo IX2karhSmUjUeayCWg/tEMR+iAa1fu2b0FEF7/Vrikpi0h73a8Pa4y0Vk1GKVu1xy1y4 5pGA== X-Gm-Message-State: APjAAAUlTBl7eLKsC+2TqA8Ap4W5zcyTRWf6BCcJoLPfT09MZtqPueOC Zk3D6mV/opF8gFG0AFiVF2RL0gmFsYcXZQ== X-Received: by 2002:a05:600c:22d1:: with SMTP id 17mr449859wmg.62.1556133458836; Wed, 24 Apr 2019 12:17:38 -0700 (PDT) Received: from ?IPv6:2003:ea:8bd4:5700:c498:ee8f:ff0a:13e5? (p200300EA8BD45700C498EE8FFF0A13E5.dip0.t-ipconnect.de. [2003:ea:8bd4:5700:c498:ee8f:ff0a:13e5]) by smtp.googlemail.com with ESMTPSA id s18sm19261192wmc.41.2019.04.24.12.17.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 24 Apr 2019 12:17:37 -0700 (PDT) Subject: [PATCH v2 1/9] PCI: add helper pci_dev_id From: Heiner Kallweit To: Benjamin Herrenschmidt , Michael Ellerman , Oded Gabbay , Alex Deucher , =?UTF-8?Q?Christian_K=c3=b6nig?= , "David (ChunMing) Zhou" , David Airlie , Daniel Vetter , Joerg Roedel , David Woodhouse , Realtek linux nic maintainers , "David S. Miller" , Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , Maxime Coquelin , Bjorn Helgaas , Benson Leung , Enric Balletbo i Serra , Stephen Rothwell , Paul Mackerras Cc: open list , "open list:AMD KFD" , "open list:RADEON and AMDGPU DRM DRIVERS" , "open list:AMD IOMMU (AMD-VI)" , "open list:8169 10/100/1000 GIGABIT ETHERNET DRIVER" , "moderated list:ARM/STM32 ARCHITECTURE" , "moderated list:ARM/STM32 ARCHITECTURE" , "open list:PCI SUBSYSTEM" References: <2e1f9a57-6d08-d017-24da-3e6b97fa2449@gmail.com> Message-ID: Date: Wed, 24 Apr 2019 21:11:58 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <2e1f9a57-6d08-d017-24da-3e6b97fa2449@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In several places in the kernel we find PCI_DEVID used like this: PCI_DEVID(dev->bus->number, dev->devfn) Therefore create a helper for it. Signed-off-by: Heiner Kallweit --- include/linux/pci.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/linux/pci.h b/include/linux/pci.h index 2c056a7a7..28d0313a3 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -598,6 +598,11 @@ struct pci_bus { #define to_pci_bus(n) container_of(n, struct pci_bus, dev) +static inline u16 pci_dev_id(struct pci_dev *dev) +{ + return PCI_DEVID(dev->bus->number, dev->devfn); +} + /* * Returns true if the PCI bus is root (behind host-PCI bridge), * false otherwise -- 2.21.0