[RFC PATCH 11/17] intel_th: pci: Drop uses of pci_read_config_*() return value

Saheed O. Bolarinwa
2020-08-01T12:25:04Z

drivers/hwtracing/intel_th/pci.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/hwtracing/intel_th/pci.c b/drivers/hwtracing/intel_th/pci.c
index 21fdf0b93516..176c9088038e 100644
--- a/drivers/hwtracing/intel_th/pci.c
+++ b/drivers/hwtracing/intel_th/pci.c
@@ -32,13 +32,13 @@ static int intel_th_pci_activate(struct intel_th *th)
{
struct pci_dev *pdev = to_pci_dev(th->dev);
u32 npkdsc;
- int err;
+ int err = -ENODEV;

if (!INTEL_TH_CAP(th, tscu_enable))
return 0;

- err = pci_read_config_dword(pdev, PCI_REG_NPKDSC, &npkdsc);
- if (!err) {
+ pci_read_config_dword(pdev, PCI_REG_NPKDSC, &npkdsc);
+ if (npkdsc != (u32)~0) {
npkdsc |= NPKDSC_TSACT;
err = pci_write_config_dword(pdev, PCI_REG_NPKDSC, npkdsc);
}
@@ -53,13 +53,13 @@ static void intel_th_pci_deactivate(struct intel_th *th)
{
struct pci_dev *pdev = to_pci_dev(th->dev);
u32 npkdsc;
- int err;
+ int err = -ENODEV;

if (!INTEL_TH_CAP(th, tscu_enable))
return;

- err = pci_read_config_dword(pdev, PCI_REG_NPKDSC, &npkdsc);
- if (!err) {
+ pci_read_config_dword(pdev, PCI_REG_NPKDSC, &npkdsc);
+ if (npkdsc != (u32)~0) {
npkdsc |= NPKDSC_TSACT;
err = pci_write_config_dword(pdev, PCI_REG_NPKDSC, npkdsc);
}
--
2.18.4