24/10/2019 17:30, Andrew Rybchenko: > On 10/24/19 6:17 PM, Thomas Monjalon wrote: > > 24/10/2019 16:47, Andrew Rybchenko: > >> On 10/24/19 11:29 AM, Ori Kam wrote: > >>> Hi Andrew, > >>> > >>> When writing the new function I thought about using bool, but > >>> I decided against it for the following reasons: > >>> 1. There is no use of bool any where in the code, and there is not > >>> special reason to add it now. > >> rte_ethdev.c includes stdbool.h and uses bool > >> > >>> 2. Other functions of this kind already returns int. for example > >>> (rte_eth_dev_is_valid_port / rte_eth_is_valid_owner_id) > > I agree with Ori here for 2 reasons: > > 1. It is better to be consistent in the API > > 2. I remember having some issues with some drivers when introducing stdbool > > in the API. > > > > I think it may be nice to convert all such API to bool in one patch, > > and check if there are some remaining issues with bool usage in drivers or > > with PPC. > > But I suggest to do such API change in DPDK 20.11. > > OK, no problem. Does it prevent to avoid comparison == 1? Just to > avoid changes in these lines in the future.
Yes probably better to avoid explicit comparison, but prefer boolean operator (!).