Skip to contentSkip to conversation

soc: loongson: use resource_size() helper function

PATCH In review Deepak R Varma 2 participants 4 messages Dec 22, 2022 – Mar 1, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 soc: loongson: use resource_size() helper function

Use the resource_size() function instead of a open coded computation resource size. It makes the code more readable.

Issue identified using resource_size.cocci coccinelle semantic patch.

---
Note: Proposed change is compile tested only.

 drivers/soc/loongson/loongson2_guts.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/soc/loongson/loongson2_guts.c +1 -1
index bace4bc8e03b..aba4f8832805 100644
@@ -107,7 +107,7 @@ static int loongson2_guts_probe(struct platform_device *pdev)
 	guts->little_endian = of_property_read_bool(np, "little-endian");
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	guts->regs = ioremap(res->start, res->end - res->start + 1);
+	guts->regs = ioremap(res->start, resource_size(res));
 	if (IS_ERR(guts->regs))
 		return PTR_ERR(guts->regs);
 

--
2.34.1

#1 lore raw
Quoted 7 lines · Deepak R Varma

Use the resource_size() function instead of a open coded computation resource size. It makes the code more readable.

Issue identified using resource_size.cocci coccinelle semantic patch.

---

Hello,
Requesting a review and feedback on this patch proposal?

Thank you,
./drv

maintainer Reviewed-by
#2 lore raw
Quoted 5 lines · Deepak R Varma
Quoted 3 lines · Deepak R Varma

Use the resource_size() function instead of a open coded computation resource size. It makes the code more readable.

Quoted 7 lines
Quoted 4 lines

Issue identified using resource_size.cocci coccinelle semantic patch.

---

Hello,
Requesting a review and feedback on this patch proposal?

But I think this should be merged through [email protected] maintained by Arnd.

Huacai

Quoted 6 lines

Thank you,
./drv

#3 lore raw
Quoted 8 lines · Huacai Chen
Quoted 7 lines · Deepak R Varma
Quoted 5 lines · Deepak R Varma

Use the resource_size() function instead of a open coded computation resource size. It makes the code more readable.

Issue identified using resource_size.cocci coccinelle semantic patch.

Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

---

Hello,
Requesting a review and feedback on this patch proposal?

But I think this should be merged through [email protected] maintained by Arnd.

Thank you Huacai. Appreciate your time.

Hello Arnd,
Can you please tell me if I need to do anything further to have this merged as suggested by Huacai?

Thanks,
./drv

Quoted 8 lines

Huacai

Quoted 6 lines

Thank you,
./drv