2020-07-13 13:28:32

by Saheed O. Bolarinwa

[permalink] [raw]
Subject: [RFC PATCH 09/35] nvme-pci: Change PCIBIOS_SUCCESSFUL to 0

In reference to the PCI spec (Chapter 2), PCIBIOS* is an x86 concept.
Their scope should be limited within arch/x86.

Change all PCIBIOS_SUCCESSFUL to 0

Signed-off-by: "Saheed O. Bolarinwa" <[email protected]>
---
drivers/nvme/host/pci.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
index b1d18f0633c7..d426efb53f44 100644
--- a/drivers/nvme/host/pci.c
+++ b/drivers/nvme/host/pci.c
@@ -1185,7 +1185,7 @@ static void nvme_warn_reset(struct nvme_dev *dev, u32 csts)

result = pci_read_config_word(to_pci_dev(dev->dev), PCI_STATUS,
&pci_status);
- if (result == PCIBIOS_SUCCESSFUL)
+ if (result == 0)
dev_warn(dev->ctrl.device,
"controller is down; will reset: CSTS=0x%x, PCI_STATUS=0x%hx\n",
csts, pci_status);
--
2.18.2


2020-07-13 16:45:26

by Rajashekar, Revanth

[permalink] [raw]
Subject: Re: [RFC PATCH 09/35] nvme-pci: Change PCIBIOS_SUCCESSFUL to 0

Hi,

On 7/13/2020 6:22 AM, Saheed O. Bolarinwa wrote:
> In reference to the PCI spec (Chapter 2), PCIBIOS* is an x86 concept.
> Their scope should be limited within arch/x86.
>
> Change all PCIBIOS_SUCCESSFUL to 0
>
> Signed-off-by: "Saheed O. Bolarinwa" <[email protected]>
> ---
> drivers/nvme/host/pci.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
> index b1d18f0633c7..d426efb53f44 100644
> --- a/drivers/nvme/host/pci.c
> +++ b/drivers/nvme/host/pci.c
> @@ -1185,7 +1185,7 @@ static void nvme_warn_reset(struct nvme_dev *dev, u32 csts)
>
> result = pci_read_config_word(to_pci_dev(dev->dev), PCI_STATUS,
> &pci_status);
> - if (result == PCIBIOS_SUCCESSFUL)
> + if (result == 0)
How about simplifying the check to if (!result)?
> dev_warn(dev->ctrl.device,
> "controller is down; will reset: CSTS=0x%x, PCI_STATUS=0x%hx\n",
> csts, pci_status);
Thanks!
Revanth

2020-07-13 17:25:15

by Saheed O. Bolarinwa

[permalink] [raw]
Subject: Re: [RFC PATCH 09/35] nvme-pci: Change PCIBIOS_SUCCESSFUL to 0


On 7/13/20 6:42 PM, Rajashekar, Revanth wrote:
> Hi,
>
> On 7/13/2020 6:22 AM, Saheed O. Bolarinwa wrote:
>> In reference to the PCI spec (Chapter 2), PCIBIOS* is an x86 concept.
>> Their scope should be limited within arch/x86.
>>
>> Change all PCIBIOS_SUCCESSFUL to 0
>>
>> Signed-off-by: "Saheed O. Bolarinwa" <[email protected]>
>> ---
>> drivers/nvme/host/pci.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
>> index b1d18f0633c7..d426efb53f44 100644
>> --- a/drivers/nvme/host/pci.c
>> +++ b/drivers/nvme/host/pci.c
>> @@ -1185,7 +1185,7 @@ static void nvme_warn_reset(struct nvme_dev *dev, u32 csts)
>>
>> result = pci_read_config_word(to_pci_dev(dev->dev), PCI_STATUS,
>> &pci_status);
>> - if (result == PCIBIOS_SUCCESSFUL)
>> + if (result == 0)
> How about simplifying the check to if (!result)?

Thank you for the review.  I did in PATCH 10/35. I will merge both.

I wanted to separate the goal from the fix but I see it's confusing.

- Saheed