[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150923132354.GB31253@amd>
Date: Wed, 23 Sep 2015 15:23:54 +0200
From: Pavel Machek <pavel@...x.de>
To: Josh Cartwright <joshc@...com>
Cc: atull@...nsource.altera.com, gregkh@...uxfoundation.org,
jgunthorpe@...idianresearch.com, hpa@...or.com, monstr@...str.eu,
michal.simek@...inx.com, rdunlap@...radead.org,
Moritz Fischer <moritz.fischer@...us.com>,
linux-kernel@...r.kernel.org, devicetree@...r.kernel.org,
pantelis.antoniou@...sulko.com, robh+dt@...nel.org,
grant.likely@...aro.org, iws@...o.caltech.edu,
linux-doc@...r.kernel.org, broonie@...nel.org, philip@...ister.org,
rubini@...dd.com, s.trumtrar@...gutronix.de, jason@...edaemon.net,
kyle.teske@...com, nico@...aro.org, balbi@...com,
m.chehab@...sung.com, davidb@...eaurora.org, rob@...dley.net,
davem@...emloft.net, cesarb@...arb.net, sameo@...ux.intel.com,
akpm@...ux-foundation.org, linus.walleij@...aro.org,
pawel.moll@....com, mark.rutland@....com,
ijc+devicetree@...lion.org.uk, galak@...eaurora.org,
devel@...verdev.osuosl.org, Petr Cvek <petr.cvek@....cz>,
delicious.quinoa@...il.com, dinguyen@...nsource.altera.com
Subject: Re: [PATCH v11 3/4] add FPGA manager core
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists