devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@denx.de>
To: Josh Cartwright <joshc@ni.com>
Cc: atull@opensource.altera.com, gregkh@linuxfoundation.org,
	jgunthorpe@obsidianresearch.com, hpa@zytor.com, monstr@monstr.eu,
	michal.simek@xilinx.com, rdunlap@infradead.org,
	Moritz Fischer <moritz.fischer@ettus.com>,
	linux-kernel@vger.kernel.org, devicetree@vger.kernel.org,
	pantelis.antoniou@konsulko.com, robh+dt@kernel.org,
	grant.likely@linaro.org, iws@ovro.caltech.edu,
	linux-doc@vger.kernel.org, broonie@kernel.org,
	philip@balister.org, rubini@gnudd.com, s.trumtrar@pengutronix.de,
	jason@lakedaemon.net, kyle.teske@ni.com, nico@linaro.org,
	balbi@ti.com, m.chehab@samsung.com, davidb@codeaurora.org,
	rob@landley.net, davem@davemloft.net, cesarb@cesarb.net,
	sameo@linux.intel.com, akpm@linux-foundation.org,
	linus.walleij@linaro.org, pawel.moll@arm.com,
	mark.rutland@arm.com, ijc+devicetree@hellion.org.uk,
	galak@codeaurora.org, devel@driverdev.osuosl.org,
	Petr Cvek <petr.cvek@tul>
Subject: Re: [PATCH v11 3/4] add FPGA manager core
Date: Wed, 23 Sep 2015 15:23:54 +0200	[thread overview]
Message-ID: <20150923132354.GB31253@amd> (raw)
In-Reply-To: <20150922222929.GA26335@jcartwri.amer.corp.natinst.com>

Hi!

> > +++ b/drivers/fpga/fpga-mgr.c
> > @@ -0,0 +1,382 @@
> [..]
> > +int fpga_mgr_buf_load(struct fpga_manager *mgr, u32 flags, const char *buf,
> > +		      size_t count)
> > +{
> > +	struct device *dev = &mgr->dev;
> > +	int ret;
> > +
> > +	if (!mgr)
> > +		return -ENODEV;
> 
> This seems overly defensive.
> 
> [..]
> > +int fpga_mgr_firmware_load(struct fpga_manager *mgr, u32 flags,
> > +			   const char *image_name)
> > +{
> > +	struct device *dev = &mgr->dev;
> > +	const struct firmware *fw;
> > +	int ret;
> > +
> > +	if (!mgr)
> > +		return -ENODEV;
> 
> Again; I'm of the opinion this is needlessly defensive.

Not only that, it can never happen. mgr is already dereferenced above.

									Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

  reply	other threads:[~2015-09-23 13:23 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-22 15:21 [PATCH v11 0/4] FPGA Manager Framework atull
2015-09-22 15:21 ` [PATCH v11 1/4] usage documentation for FPGA manager core atull
2015-09-23  0:50   ` Moritz Fischer
2015-09-22 15:21 ` [PATCH v11 2/4] fpga manager: add sysfs interface document atull
     [not found]   ` <1442935271-10375-3-git-send-email-atull-yzvPICuk2ABMcg4IHK0kFoH6Mc4MB0Vx@public.gmane.org>
2015-09-23  0:52     ` Moritz Fischer
2015-09-22 15:21 ` [PATCH v11 3/4] add FPGA manager core atull
     [not found]   ` <1442935271-10375-4-git-send-email-atull-yzvPICuk2ABMcg4IHK0kFoH6Mc4MB0Vx@public.gmane.org>
2015-09-22 22:29     ` Josh Cartwright
2015-09-23 13:23       ` Pavel Machek [this message]
2015-09-23 14:11         ` Dan Carpenter
2015-09-23 16:15           ` atull
2015-09-24  7:49             ` Dan Carpenter
2015-09-24 20:47               ` atull
2015-09-24 21:13                 ` Pavel Machek
2015-09-25 10:00                 ` Dan Carpenter
2015-09-23 17:10       ` atull
2015-09-23 23:03         ` Josh Cartwright
2015-09-24 20:24           ` atull
2015-09-22 15:21 ` [PATCH v11 4/4] fpga manager: add driver for socfpga fpga manager atull
2015-09-22 22:47   ` Josh Cartwright
  -- strict thread matches above, loose matches on Subject: below --
2015-10-07 15:36 [PATCH v11 0/4] FPGA Manager Framework atull
2015-10-07 15:36 ` [PATCH v11 3/4] add FPGA manager core atull

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=20150923132354.GB31253@amd \
    --to=pavel@denx.de \
    --cc=akpm@linux-foundation.org \
    --cc=atull@opensource.altera.com \
    --cc=balbi@ti.com \
    --cc=broonie@kernel.org \
    --cc=cesarb@cesarb.net \
    --cc=davem@davemloft.net \
    --cc=davidb@codeaurora.org \
    --cc=devel@driverdev.osuosl.org \
    --cc=devicetree@vger.kernel.org \
    --cc=galak@codeaurora.org \
    --cc=grant.likely@linaro.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=hpa@zytor.com \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=iws@ovro.caltech.edu \
    --cc=jason@lakedaemon.net \
    --cc=jgunthorpe@obsidianresearch.com \
    --cc=joshc@ni.com \
    --cc=kyle.teske@ni.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=m.chehab@samsung.com \
    --cc=mark.rutland@arm.com \
    --cc=michal.simek@xilinx.com \
    --cc=monstr@monstr.eu \
    --cc=moritz.fischer@ettus.com \
    --cc=nico@linaro.org \
    --cc=pantelis.antoniou@konsulko.com \
    --cc=pawel.moll@arm.com \
    --cc=petr.cvek@tul \
    --cc=philip@balister.org \
    --cc=rdunlap@infradead.org \
    --cc=rob@landley.net \
    --cc=robh+dt@kernel.org \
    --cc=rubini@gnudd.com \
    --cc=s.trumtrar@pengutronix.de \
    --cc=sameo@linux.intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).