[dpdk-dev] [PATCH v5 01/21] lib/librte_ethdev: change eth-dev-ops API to return int

Stephen Hemminger stephen at networkplumber.org
Mon May 21 08:52:37 CEST 2018


On Sun, 20 May 2018 02:43:58 +0000
Shreyansh Jain <shreyansh.jain at nxp.com> wrote:

> > > This doesn't feel correct. A counter, especially the number of  
> > descriptors in a queue, doesn't have a negative value. So, 1) this is
> > an unnatural return and 2) we litter the code with unnecessary
> > typecast.  
> > >
> > > In fact, even in the above change, the debug messages continue to  
> > print unsigned values. So, another typecast would be required there.  
> > >
> > > I don't agree with this change - at least not until some strong gcc 8  
> > warning reason is triggering this. Can you please point me to some
> > conversation on mailing list which enforces this?  
> > >  
> > 
> > hmmmmm.... no, it's not my idea.
> > 
> > If you don't like it, don't do it, I don't mind either way.  I sent a
> > patch that just solved the compiler error only already, and was told on
> > the list it would be cooler if these things returned an int instead.
> > 
> > There's no point challenging me about the wisdom of it, although it
> > seems reasonable to me.  I sent a patch, list guy $1 says do X instead,
> > I do X and then list guy $2 says EXPLAIN YOURSELF.  
> 
> That is what a community is. Consensus has to be built, not expected automagically. If you touch a line, you are responsible for it (also, because in future git blame would point *you* out for a change).


My comment was a suggestion, not a "you must do it this way".
The reason was it was cleaner change for Gcc fix
and it allowed for possibility that some driver might not detect an error
(for example if device was removed by hot plug).


More information about the dev mailing list