public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] soc: loongson: use resource_size() helper function
@ 2022-12-22 21:32 Deepak R Varma
  2023-01-07 20:10 ` Deepak R Varma
  0 siblings, 1 reply; 3+ messages in thread
From: Deepak R Varma @ 2022-12-22 21:32 UTC (permalink / raw)
  To: Yinbo Zhu, loongarch, linux-kernel
  Cc: Saurabh Singh Sengar, Praveen Kumar, drv

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.

Signed-off-by: Deepak R Varma <drv@mailo.com>
---
Note: Proposed change is compile tested only.

 drivers/soc/loongson/loongson2_guts.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/soc/loongson/loongson2_guts.c b/drivers/soc/loongson/loongson2_guts.c
index bace4bc8e03b..aba4f8832805 100644
--- a/drivers/soc/loongson/loongson2_guts.c
+++ b/drivers/soc/loongson/loongson2_guts.c
@@ -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




^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] soc: loongson: use resource_size() helper function
  2022-12-22 21:32 [PATCH] soc: loongson: use resource_size() helper function Deepak R Varma
@ 2023-01-07 20:10 ` Deepak R Varma
       [not found]   ` <CAAhV-H6cYv=PC76Rsimncoy2udZ4erTzRyy6cMK7zcmeJqO1Ng@mail.gmail.com>
  0 siblings, 1 reply; 3+ messages in thread
From: Deepak R Varma @ 2023-01-07 20:10 UTC (permalink / raw)
  To: Yinbo Zhu, loongarch, linux-kernel
  Cc: Saurabh Singh Sengar, Praveen Kumar, Deepak R Varma

On Fri, Dec 23, 2022 at 03:02:17AM +0530, Deepak R Varma wrote:
> 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.
>
> Signed-off-by: Deepak R Varma <drv@mailo.com>
> ---

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

Thank you,
./drv



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] soc: loongson: use resource_size() helper function
       [not found]   ` <CAAhV-H6cYv=PC76Rsimncoy2udZ4erTzRyy6cMK7zcmeJqO1Ng@mail.gmail.com>
@ 2023-03-01 19:38     ` Deepak R Varma
  0 siblings, 0 replies; 3+ messages in thread
From: Deepak R Varma @ 2023-03-01 19:38 UTC (permalink / raw)
  To: Huacai Chen
  Cc: Arnd Bergmann, Yinbo Zhu, loongarch, linux-kernel,
	Saurabh Singh Sengar, Praveen Kumar, soc

On Sun, Jan 08, 2023 at 08:57:48PM +0800, Huacai Chen wrote:
> On Sun, Jan 8, 2023 at 4:10 AM Deepak R Varma <drv@mailo.com> wrote:
> >
> > On Fri, Dec 23, 2022 at 03:02:17AM +0530, Deepak R Varma wrote:
> > > 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.
> > >
> > > Signed-off-by: Deepak R Varma <drv@mailo.com>
> > > ---
> >
> > Hello,
> > Requesting a review and feedback on this patch proposal?
> Reviewed-by: Huacai Chen <chenhuacai@loongson.cn>
> But I think this should be merged through soc@kernel.org 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

> 
> Huacai
> >
> > Thank you,
> > ./drv
> >
> >
> >



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-03-01 19:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-22 21:32 [PATCH] soc: loongson: use resource_size() helper function Deepak R Varma
2023-01-07 20:10 ` Deepak R Varma
     [not found]   ` <CAAhV-H6cYv=PC76Rsimncoy2udZ4erTzRyy6cMK7zcmeJqO1Ng@mail.gmail.com>
2023-03-01 19:38     ` Deepak R Varma

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox