Re: [PATCH v11 3/4] add FPGA manager core

2015-09-25 Thread Dan Carpenter
On Thu, Sep 24, 2015 at 03:47:26PM -0500, atull wrote: > Interesting. The amount of code bloat here compiles down to about two > machine instructions (in two places). Actually a little more since I should > be using IS_ERR_OR_NULL. But the main question is whether I should do > it at all. >

Re: [PATCH v11 3/4] add FPGA manager core

2015-09-25 Thread Dan Carpenter
On Thu, Sep 24, 2015 at 03:47:26PM -0500, atull wrote: > Interesting. The amount of code bloat here compiles down to about two > machine instructions (in two places). Actually a little more since I should > be using IS_ERR_OR_NULL. But the main question is whether I should do > it at all. >

Re: [PATCH v11 3/4] add FPGA manager core

2015-09-24 Thread Pavel Machek
Hi! > > Of course, the maintainer gets the last word regardless of what anyone > > else thinks. > > > > Generally, minimal code is better. Trying to future proof code is a > > waste of time because you can't predict what will happen in the future. > > It's way more likely that some pointer you

Re: [PATCH v11 3/4] add FPGA manager core

2015-09-24 Thread atull
On Thu, 24 Sep 2015, Dan Carpenter wrote: > Of course, the maintainer gets the last word regardless of what anyone > else thinks. > > Generally, minimal code is better. Trying to future proof code is a > waste of time because you can't predict what will happen in the future. > It's way more

Re: [PATCH v11 3/4] add FPGA manager core

2015-09-24 Thread atull
On Wed, 23 Sep 2015, Josh Cartwright wrote: > On Wed, Sep 23, 2015 at 12:10:13PM -0500, atull wrote: > > On Tue, 22 Sep 2015, Josh Cartwright wrote: > [..] > > > > +struct fpga_manager *of_fpga_mgr_get(struct device_node *node) > > > > +{ > > > > + struct fpga_manager *mgr; > > > > +

Re: [PATCH v11 3/4] add FPGA manager core

2015-09-24 Thread Dan Carpenter
Of course, the maintainer gets the last word regardless of what anyone else thinks. Generally, minimal code is better. Trying to future proof code is a waste of time because you can't predict what will happen in the future. It's way more likely that some pointer you never expected to be NULL

Re: [PATCH v11 3/4] add FPGA manager core

2015-09-24 Thread Dan Carpenter
Of course, the maintainer gets the last word regardless of what anyone else thinks. Generally, minimal code is better. Trying to future proof code is a waste of time because you can't predict what will happen in the future. It's way more likely that some pointer you never expected to be NULL

Re: [PATCH v11 3/4] add FPGA manager core

2015-09-24 Thread atull
On Wed, 23 Sep 2015, Josh Cartwright wrote: > On Wed, Sep 23, 2015 at 12:10:13PM -0500, atull wrote: > > On Tue, 22 Sep 2015, Josh Cartwright wrote: > [..] > > > > +struct fpga_manager *of_fpga_mgr_get(struct device_node *node) > > > > +{ > > > > + struct fpga_manager *mgr; > > > > +

Re: [PATCH v11 3/4] add FPGA manager core

2015-09-24 Thread Pavel Machek
Hi! > > Of course, the maintainer gets the last word regardless of what anyone > > else thinks. > > > > Generally, minimal code is better. Trying to future proof code is a > > waste of time because you can't predict what will happen in the future. > > It's way more likely that some pointer you

Re: [PATCH v11 3/4] add FPGA manager core

2015-09-24 Thread atull
On Thu, 24 Sep 2015, Dan Carpenter wrote: > Of course, the maintainer gets the last word regardless of what anyone > else thinks. > > Generally, minimal code is better. Trying to future proof code is a > waste of time because you can't predict what will happen in the future. > It's way more

Re: [PATCH v11 3/4] add FPGA manager core

2015-09-23 Thread Josh Cartwright
On Wed, Sep 23, 2015 at 12:10:13PM -0500, atull wrote: > On Tue, 22 Sep 2015, Josh Cartwright wrote: [..] > > > +struct fpga_manager *of_fpga_mgr_get(struct device_node *node) > > > +{ > > > + struct fpga_manager *mgr; > > > + struct device *dev; > > > + > > > + if (!node) > > > + return

Re: [PATCH v11 3/4] add FPGA manager core

2015-09-23 Thread atull
Hi Josh, Thanks for the review. This is all at the tail end of a long (>2 years) discussion on this. I hope that the way this has shaped out still meets the needs of the people who have been in this discussion the most and have had the strongest feelings (due to being current users of FPGAs

Re: [PATCH v11 3/4] add FPGA manager core

2015-09-23 Thread atull
On Wed, 23 Sep 2015, Dan Carpenter wrote: > On Wed, Sep 23, 2015 at 03:23:54PM +0200, Pavel Machek wrote: > > > > +int fpga_mgr_firmware_load(struct fpga_manager *mgr, u32 flags, > > > > + const char *image_name) > > > > +{ > > > > + struct device *dev = >dev; > > >

Re: [PATCH v11 3/4] add FPGA manager core

2015-09-23 Thread Dan Carpenter
On Wed, Sep 23, 2015 at 03:23:54PM +0200, Pavel Machek wrote: > > > +int fpga_mgr_firmware_load(struct fpga_manager *mgr, u32 flags, > > > +const char *image_name) > > > +{ > > > + struct device *dev = >dev; > > > + const struct firmware *fw; > > > + int ret; > > > + > > > + if

Re: [PATCH v11 3/4] add FPGA manager core

2015-09-23 Thread Pavel Machek
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 = >dev; > > + int ret; > > + > > + if (!mgr) > > + return

Re: [PATCH v11 3/4] add FPGA manager core

2015-09-23 Thread Pavel Machek
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 = >dev; > > + int ret; > > + > > + if (!mgr) > > + return

Re: [PATCH v11 3/4] add FPGA manager core

2015-09-23 Thread Dan Carpenter
On Wed, Sep 23, 2015 at 03:23:54PM +0200, Pavel Machek wrote: > > > +int fpga_mgr_firmware_load(struct fpga_manager *mgr, u32 flags, > > > +const char *image_name) > > > +{ > > > + struct device *dev = >dev; > > > + const struct firmware *fw; > > > + int ret; > > > + > > > + if

Re: [PATCH v11 3/4] add FPGA manager core

2015-09-23 Thread atull
Hi Josh, Thanks for the review. This is all at the tail end of a long (>2 years) discussion on this. I hope that the way this has shaped out still meets the needs of the people who have been in this discussion the most and have had the strongest feelings (due to being current users of FPGAs

Re: [PATCH v11 3/4] add FPGA manager core

2015-09-23 Thread atull
On Wed, 23 Sep 2015, Dan Carpenter wrote: > On Wed, Sep 23, 2015 at 03:23:54PM +0200, Pavel Machek wrote: > > > > +int fpga_mgr_firmware_load(struct fpga_manager *mgr, u32 flags, > > > > + const char *image_name) > > > > +{ > > > > + struct device *dev = >dev; > > >

Re: [PATCH v11 3/4] add FPGA manager core

2015-09-23 Thread Josh Cartwright
On Wed, Sep 23, 2015 at 12:10:13PM -0500, atull wrote: > On Tue, 22 Sep 2015, Josh Cartwright wrote: [..] > > > +struct fpga_manager *of_fpga_mgr_get(struct device_node *node) > > > +{ > > > + struct fpga_manager *mgr; > > > + struct device *dev; > > > + > > > + if (!node) > > > + return

Re: [PATCH v11 3/4] add FPGA manager core

2015-09-22 Thread Josh Cartwright
On Tue, Sep 22, 2015 at 10:21:10AM -0500, at...@opensource.altera.com wrote: > From: Alan Tull > > API to support programming FPGA's. > > The following functions are exported as GPL: > * fpga_mgr_buf_load >Load fpga from image in buffer > > * fpga_mgr_firmware_load >Request firmware

Re: [PATCH v11 3/4] add FPGA manager core

2015-09-22 Thread Josh Cartwright
On Tue, Sep 22, 2015 at 10:21:10AM -0500, at...@opensource.altera.com wrote: > From: Alan Tull > > API to support programming FPGA's. > > The following functions are exported as GPL: > * fpga_mgr_buf_load >Load fpga from image in buffer > > *