Re: [PATCH] Fix erroneous double negation in conditional

2020-05-07 Thread Michael S. Tsirkin
On Tue, Apr 28, 2020 at 12:04:29AM -0400, Raphael Norwitz wrote: > In vhost_migration_log() there is the following check: > if(!!enable == dev->log_enabled) { > return 0; > } > > The double negative “!!” is unnecessary and bad coding style. It converts the value to bool. > This >

Re: [PATCH] Fix erroneous double negation in conditional

2020-05-07 Thread Eric Blake
On 5/7/20 3:06 PM, Raphael Norwitz wrote: In vhost_migration_log() there is the following check: if(!!enable == dev->log_enabled) { return 0; } The double negative “!!” is unnecessary and bad coding style. This change removes it. !!int or !!ptr is not bad coding style - it i

[PATCH] Fix erroneous double negation in conditional

2020-05-07 Thread Raphael Norwitz
In vhost_migration_log() there is the following check: if(!!enable == dev->log_enabled) { return 0; } The double negative “!!” is unnecessary and bad coding style. This change removes it. Signed-off-by: Raphael Norwitz --- hw/virtio/vhost.c | 2 +- 1 file changed, 1 insertion(+)