mbox series

[v5,0/3] Fix find_first_zero_bit() usage

Message ID 20171214130147.1790-1-niklas.cassel@axis.com
Headers show
Series Fix find_first_zero_bit() usage | expand

Message

Niklas Cassel Dec. 14, 2017, 1:01 p.m. UTC
find_first_zero_bit()'s parameter 'size' is defined in bits,
not in bytes.

Calling find_first_zero_bit() with the wrong size unit
will lead to insidious bugs.

Fix all uses of find_first_zero_bit() called with
sizeof() as size argument in drivers/pci.

Niklas Cassel (3):
  PCI: designware-ep: Fix find_first_zero_bit() usage
  PCI: endpoint: Populate func_no before calling pci_epc_add_epf()
  PCI: endpoint: Fix find_first_zero_bit() usage

 drivers/pci/dwc/pcie-designware-ep.c | 34 ++++++++++++++++++++++++++--------
 drivers/pci/dwc/pcie-designware.h    |  8 ++++++--
 drivers/pci/endpoint/pci-ep-cfs.c    | 19 ++++++++++---------
 3 files changed, 42 insertions(+), 19 deletions(-)

Comments

Lorenzo Pieralisi Dec. 15, 2017, 1:25 p.m. UTC | #1
On Thu, Dec 14, 2017 at 02:01:43PM +0100, Niklas Cassel wrote:
> find_first_zero_bit()'s parameter 'size' is defined in bits,
> not in bytes.
> 
> Calling find_first_zero_bit() with the wrong size unit
> will lead to insidious bugs.
> 
> Fix all uses of find_first_zero_bit() called with
> sizeof() as size argument in drivers/pci.
> 
> Niklas Cassel (3):
>   PCI: designware-ep: Fix find_first_zero_bit() usage
>   PCI: endpoint: Populate func_no before calling pci_epc_add_epf()
>   PCI: endpoint: Fix find_first_zero_bit() usage
> 
>  drivers/pci/dwc/pcie-designware-ep.c | 34 ++++++++++++++++++++++++++--------
>  drivers/pci/dwc/pcie-designware.h    |  8 ++++++--
>  drivers/pci/endpoint/pci-ep-cfs.c    | 19 ++++++++++---------
>  3 files changed, 42 insertions(+), 19 deletions(-)

Applied to pci/endpoint for v4.16 (updated some commit logs)
with Kishon's ACKs.

Thanks,
Lorenzo