Skip to contentSkip to conversation

thermal: int340x: processor_thermal: Fix warning for return value

PATCH Applied Srinivas Pandruvada 2 participants 3 messages Jun 28, 2021 – Jul 4, 2021 Thermal

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 thermal: int340x: processor_thermal: Fix warning for return value

Fix smatch warnings:
drivers/thermal/intel/int340x_thermal/processor_thermal_device_pci.c:258 proc_thermal_pci_probe() warn: missing error code 'ret'

Use PTR_ERR to return failure of thermal_zone_device_register().

---
 .../intel/int340x_thermal/processor_thermal_device_pci.c      | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/thermal/intel/int340x_thermal/processor_thermal_device_pci.c +3 -1
index fea4a3ffd838..99ac7994b8f4 100644
@@ -254,8 +254,10 @@ static int  proc_thermal_pci_probe(struct pci_dev *pdev, const struct pci_device
 	pci_info->tzone = thermal_zone_device_register("TCPU_PCI", 1, 1, pci_info,
 							&tzone_ops,
 							&tzone_params, 0, 0);
-	if (IS_ERR(pci_info->tzone))
+	if (IS_ERR(pci_info->tzone)) {
+		ret = PTR_ERR(pci_info->tzone);
 		goto err_ret_mmio;
+	}
 
 	/* request and enable interrupt */
 	ret = pci_alloc_irq_vectors(pdev, 1, 1, PCI_IRQ_ALL_TYPES);
Signature · 1 line
2.27.0
#1 lore raw

[thermal: thermal/next] thermal/drivers/int340x/processor_thermal: Fix warning for return value

The following commit has been merged into the thermal/next branch of thermal:

The following commit has been merged into the thermal/next branch of thermal:

Commit-ID:     447acc9decdc177f353fa13fb26208a89612d49c
Gitweb:        https://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux.git//447acc9decdc177f353fa13fb26208a89612d49c
Author:        Srinivas Pandruvada <[email protected]>
AuthorDate:    Mon, 28 Jun 2021 11:32:32 -07:00
Committer:     Daniel Lezcano <[email protected]>
CommitterDate: Tue, 29 Jun 2021 01:24:28 +02:00

thermal/drivers/int340x/processor_thermal: Fix warning for return value

Fix smatch warnings:
drivers/thermal/intel/int340x_thermal/processor_thermal_device_pci.c:258 proc_thermal_pci_probe() warn: missing error code 'ret'

Use PTR_ERR to return failure of thermal_zone_device_register().

---
 drivers/thermal/intel/int340x_thermal/processor_thermal_device_pci.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/thermal/intel/int340x_thermal/processor_thermal_device_pci.c +3 -1
index ad7e2e3..11dd2e8 100644
@@ -254,8 +254,10 @@ static int proc_thermal_pci_probe(struct pci_dev *pdev, const struct pci_device_
 	pci_info->tzone = thermal_zone_device_register("TCPU_PCI", 1, 1, pci_info,
 							&tzone_ops,
 							&tzone_params, 0, 0);
-	if (IS_ERR(pci_info->tzone))
+	if (IS_ERR(pci_info->tzone)) {
+		ret = PTR_ERR(pci_info->tzone);
 		goto err_ret_mmio;
+	}
 
 	/* request and enable interrupt */
 	ret = pci_alloc_irq_vectors(pdev, 1, 1, PCI_IRQ_ALL_TYPES);
#2 lore raw

[thermal: thermal/next] thermal/drivers/int340x/processor_thermal: Fix warning for return value

In reply to Srinivas Pandruvada
The following commit has been merged into the thermal/next branch of thermal:

The following commit has been merged into the thermal/next branch of thermal:

Commit-ID:     ad079d981db6a4047b60c576df6430bed36bcd7d
Gitweb:        https://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux.git//ad079d981db6a4047b60c576df6430bed36bcd7d
Author:        Srinivas Pandruvada <[email protected]>
AuthorDate:    Mon, 28 Jun 2021 11:32:32 -07:00
Committer:     Daniel Lezcano <[email protected]>
CommitterDate: Sun, 04 Jul 2021 18:28:04 +02:00

thermal/drivers/int340x/processor_thermal: Fix warning for return value

Fix smatch warnings:
drivers/thermal/intel/int340x_thermal/processor_thermal_device_pci.c:258 proc_thermal_pci_probe() warn: missing error code 'ret'

Use PTR_ERR to return failure of thermal_zone_device_register().

---
 drivers/thermal/intel/int340x_thermal/processor_thermal_device_pci.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/thermal/intel/int340x_thermal/processor_thermal_device_pci.c +3 -1
index ad7e2e3..11dd2e8 100644
@@ -254,8 +254,10 @@ static int proc_thermal_pci_probe(struct pci_dev *pdev, const struct pci_device_
 	pci_info->tzone = thermal_zone_device_register("TCPU_PCI", 1, 1, pci_info,
 							&tzone_ops,
 							&tzone_params, 0, 0);
-	if (IS_ERR(pci_info->tzone))
+	if (IS_ERR(pci_info->tzone)) {
+		ret = PTR_ERR(pci_info->tzone);
 		goto err_ret_mmio;
+	}
 
 	/* request and enable interrupt */
 	ret = pci_alloc_irq_vectors(pdev, 1, 1, PCI_IRQ_ALL_TYPES);