From: David Laight <David.Laight@ACULAB.COM>
To: 'Alan Douglas' <adouglas@cadence.com>,
Wen Yang <wen.yang99@zte.com.cn>,
Kishon Vijay Abraham I <kishon@ti.com>,
Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>,
Bjorn Helgaas <bhelgaas@google.com>
Cc: "linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"zhong.weidong@zte.com.cn" <zhong.weidong@zte.com.cn>,
Bob Copeland <me@bobcopeland.com>,
Gustavo Pimentel <gustavo.pimentel@synopsys.com>,
Niklas Cassel <niklas.cassel@axis.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Cyrille Pitchen <cyrille.pitchen@free-electrons.com>
Subject: RE: [PATCH] PCI: endpoint: functions: Use kmemdup instead of duplicating its function
Date: Tue, 11 Dec 2018 14:22:12 +0000 [thread overview]
Message-ID: <a682d5066a964efc9e280e27231213b6@AcuMS.aculab.com> (raw)
In-Reply-To: <MWHPR07MB350216ECF82E2730CF87A7D2D8A90@MWHPR07MB3502.namprd07.prod.outlook.com>
From: Alan Douglas
> Sent: 06 December 2018 12:01
> Hi,
>
> On 06 December 2018 10:21, Wen Yang wrote:
> > kmemdup has implemented the function that kmalloc() + memcpy().
> > We prefer to kmemdup rather than code opened implementation.
...
> > diff --git a/drivers/pci/endpoint/functions/pci-epf-test.c b/drivers/pci/endpoint/functions/pci-epf-
> test.c
> > index 3e86fa3c7da3..6e42daa2a651 100644
> > --- a/drivers/pci/endpoint/functions/pci-epf-test.c
> > +++ b/drivers/pci/endpoint/functions/pci-epf-test.c
> > @@ -169,14 +169,12 @@ static int pci_epf_test_read(struct pci_epf_test *epf_test)
> > goto err_addr;
> > }
> >
> > - buf = kzalloc(reg->size, GFP_KERNEL);
> > + buf = kzalloc(src_addr, reg->size, GFP_KERNEL);
> Looks like a typo - kmemdup instead of kzalloc?
Which is why making butter (churning) like this is mostly pointless.
It is very easy to make silly mistakes.
David
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
next prev parent reply other threads:[~2018-12-11 14:22 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-06 10:21 Wen Yang
2018-12-06 12:00 ` Alan Douglas
2018-12-11 14:22 ` David Laight [this message]
2018-12-06 10:24 Wen Yang
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=a682d5066a964efc9e280e27231213b6@AcuMS.aculab.com \
--to=david.laight@aculab.com \
--cc=adouglas@cadence.com \
--cc=bhelgaas@google.com \
--cc=cyrille.pitchen@free-electrons.com \
--cc=gregkh@linuxfoundation.org \
--cc=gustavo.pimentel@synopsys.com \
--cc=kishon@ti.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=lorenzo.pieralisi@arm.com \
--cc=me@bobcopeland.com \
--cc=niklas.cassel@axis.com \
--cc=wen.yang99@zte.com.cn \
--cc=zhong.weidong@zte.com.cn \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®