From patchwork Wed Dec 23 12:28:12 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geliang Tang X-Patchwork-Id: 7911091 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 123729F1AF for ; Wed, 23 Dec 2015 12:28:33 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 465E920481 for ; Wed, 23 Dec 2015 12:28:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 28AA520453 for ; Wed, 23 Dec 2015 12:28:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934345AbbLWM23 (ORCPT ); Wed, 23 Dec 2015 07:28:29 -0500 Received: from m50-132.163.com ([123.125.50.132]:46425 "EHLO m50-132.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932824AbbLWM23 (ORCPT ); Wed, 23 Dec 2015 07:28:29 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id; bh=x+7AlP2MI81ccmtq1r 8o6KQY6+iXoPhIKRja0whSQMM=; b=Gu6REeou0Bf/QG3m8CRethAF9U3mMu6AF6 CKnweplm2y0/UxfCUaR+S2TORXzFLtSLgLwOj0fpeEVAdfgKQabpTgB9lEbR5fY0 03ae+Hue8ObaXiKIsMEE/VWzeS2Ul/W6I85HWS6AVLhR9EM6gqHbskGaHICvbehe W6JZlLxQY= Received: from localhost (unknown [116.77.148.162]) by smtp2 (Coremail) with SMTP id DNGowEAJ4UBhk3pWBYd6AA--.762S3; Wed, 23 Dec 2015 20:28:19 +0800 (CST) From: Geliang Tang To: Bjorn Helgaas Cc: Geliang Tang , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] PCI: use to_pci_dev Date: Wed, 23 Dec 2015 20:28:12 +0800 Message-Id: <8ab09476f7fb0283031b973808740f40522bebe1.1450873511.git.geliangtang@163.com> X-Mailer: git-send-email 2.5.0 X-CM-TRANSID: DNGowEAJ4UBhk3pWBYd6AA--.762S3 X-Coremail-Antispam: 1Uf129KBjvdXoW7XFWxJFyxtr43Wr4xtFWxtFb_yoWkZFc_uw 1j9rsxJr48Xr1rK3yakr1fZryUKa4IqF1kWr4xtF9ayFnrZr1DArW2vr13JFW5uw4fAF15 J3srJr15urWqkjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IUUdOz3UUUUU== X-Originating-IP: [116.77.148.162] X-CM-SenderInfo: 5jhoxtpqjwt0rj6rljoofrz/xtbBygTZmVO+gvf0KAABsL Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Use to_pci_dev() instead of open-coding it. Signed-off-by: Geliang Tang --- drivers/pci/hotplug/shpchp_sysfs.c | 2 +- drivers/pci/pci.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/pci/hotplug/shpchp_sysfs.c b/drivers/pci/hotplug/shpchp_sysfs.c index 52875b3..392a40b 100644 --- a/drivers/pci/hotplug/shpchp_sysfs.c +++ b/drivers/pci/hotplug/shpchp_sysfs.c @@ -43,7 +43,7 @@ static ssize_t show_ctrl (struct device *dev, struct device_attribute *attr, cha struct resource *res; struct pci_bus *bus; - pdev = container_of (dev, struct pci_dev, dev); + pdev = to_pci_dev(dev); bus = pdev->subordinate; out += sprintf(buf, "Free resources: memory\n"); diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index d1a7105..9356f90 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -1417,7 +1417,7 @@ struct pci_devres { static void pcim_release(struct device *gendev, void *res) { - struct pci_dev *dev = container_of(gendev, struct pci_dev, dev); + struct pci_dev *dev = to_pci_dev(gendev); struct pci_devres *this = res; int i;