From: Keith Busch <keith.busch@intel.com>
To: Dongdong Liu <liudongdong3@huawei.com>
Cc: helgaas@kernel.org, linux-pci@vger.kernel.org,
gabriele.paoloni@huawei.com, charles.chenxin@huawei.com,
linuxarm@huawei.com
Subject: Re: [PATCH V3 1/2] PCI/DPC: Add local struct device
Date: Thu, 17 Aug 2017 11:32:21 -0400 [thread overview]
Message-ID: <20170817153221.GM7233@localhost.localdomain> (raw)
In-Reply-To: <1502970505-89777-2-git-send-email-liudongdong3@huawei.com>
On Thu, Aug 17, 2017 at 07:48:24PM +0800, Dongdong Liu wrote:
> Use a local "struct device *dev" for brevity and consistency in DPC driver.
> No functional change intended.
I think there is a functional change here:
> @@ -119,10 +120,11 @@ static int dpc_probe(struct pcie_device *dev)
> {
> struct dpc_dev *dpc;
> struct pci_dev *pdev = dev->port;
> + struct device *device = &pdev->dev;
> int status;
> u16 ctl, cap;
>
> - dpc = devm_kzalloc(&dev->device, sizeof(*dpc), GFP_KERNEL);
> + dpc = devm_kzalloc(device, sizeof(*dpc), GFP_KERNEL);
> if (!dpc)
> return -ENOMEM;
We were using the pcie_device's device for the devres API, but now it's
the pci_dev's. That will change the lifetime of memory allocations. I'm
not sure that it matters at th emoment, but it's certainly different.
next prev parent reply other threads:[~2017-08-17 15:32 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-17 11:48 [PATCH V3 0/2] PCI/DPC: Add eDPC support Dongdong Liu
2017-08-17 11:48 ` [PATCH V3 1/2] PCI/DPC: Add local struct device Dongdong Liu
2017-08-17 15:32 ` Keith Busch [this message]
2017-08-17 16:34 ` Bjorn Helgaas
2017-08-18 1:55 ` Dongdong Liu
2017-08-17 11:48 ` [PATCH V3 2/2] PCI/DPC: Add eDPC support Dongdong Liu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170817153221.GM7233@localhost.localdomain \
--to=keith.busch@intel.com \
--cc=charles.chenxin@huawei.com \
--cc=gabriele.paoloni@huawei.com \
--cc=helgaas@kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=linuxarm@huawei.com \
--cc=liudongdong3@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.