lkml.org 
[lkml]   [2020]   [Sep]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 4/5 V2] PCI: only return true when dev io state is really changed
From
Date
On Sat, 2020-09-26 at 23:28 -0400, Ethan Zhao wrote:
> simplify the pci_dev_set_io_state() function to only return true
> when dev->error_state is changed.
[]
> diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h
[]
> @@ -362,35 +362,11 @@ static inline bool pci_dev_set_io_state(struct pci_dev *dev,
> bool changed = false;
[]
> + if (dev->error_state == new)
> + return changed;
> +
> + dev->error_state = new;
> + changed = true;
> return changed;
> }

This would be simpler removing the unnecessary
changed automatic

...

if (dev->error_state == new)
return false;

dev->error_state = new;

return true;
}


\
 
 \ /
  Last update: 2020-09-27 06:17    [W:0.117 / U:6.592 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site