diff mbox series

[2/3] thermal: qoriq: Simplify the 'site' variable assignment

Message ID 1532805471-19593-2-git-send-email-festevam@gmail.com (mailing list archive)
State Accepted
Delegated to: Eduardo Valentin
Headers show
Series [1/3] thermal: qoriq: Use devm_thermal_zone_of_sensor_register() | expand

Commit Message

Fabio Estevam July 28, 2018, 7:17 p.m. UTC
From: Fabio Estevam <fabio.estevam@nxp.com>

There is no need to assign zero to the variable 'site' and then
perform a compound bitwise OR operation afterwards.

Make it simpler by assigning the final 'site' value directly.

Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
---
 drivers/thermal/qoriq_thermal.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Daniel Lezcano Aug. 1, 2018, 3:54 p.m. UTC | #1
On 28/07/2018 21:17, Fabio Estevam wrote:
> From: Fabio Estevam <fabio.estevam@nxp.com>
> 
> There is no need to assign zero to the variable 'site' and then
> perform a compound bitwise OR operation afterwards.
> 
> Make it simpler by assigning the final 'site' value directly.
> 
> Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
> ---

Reviewed-by: Daniel Lezcano <daniel.lezcano@linaro.org>
diff mbox series

Patch

diff --git a/drivers/thermal/qoriq_thermal.c b/drivers/thermal/qoriq_thermal.c
index e32d6ac..f807e4d 100644
--- a/drivers/thermal/qoriq_thermal.c
+++ b/drivers/thermal/qoriq_thermal.c
@@ -197,7 +197,7 @@  static int qoriq_tmu_probe(struct platform_device *pdev)
 	int ret;
 	struct qoriq_tmu_data *data;
 	struct device_node *np = pdev->dev.of_node;
-	u32 site = 0;
+	u32 site;
 
 	if (!np) {
 		dev_err(&pdev->dev, "Device OF-Node is NULL");
@@ -244,7 +244,7 @@  static int qoriq_tmu_probe(struct platform_device *pdev)
 	}
 
 	/* Enable monitoring */
-	site |= 0x1 << (15 - data->sensor_id);
+	site = 0x1 << (15 - data->sensor_id);
 	tmu_write(data, site | TMR_ME | TMR_ALPF, &data->regs->tmr);
 
 	return 0;