lkml.org 
[lkml]   [2021]   [Jun]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH net-next v2] net: gemini: Use devm_platform_get_and_ioremap_resource()
On Mon, Jun 7, 2021 at 3:05 AM Yang Yingliang <yangyingliang@huawei.com> wrote:
> On 2021/6/5 23:17, Linus Walleij wrote:
> > On Sat, Jun 5, 2021 at 2:32 PM Yang Yingliang <yangyingliang@huawei.com> wrote:
> >
> >> Use devm_platform_get_and_ioremap_resource() to simplify
> >> code.
> >>
> >> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
> > (...)
> >> - dmares = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> >> - gmacres = platform_get_resource(pdev, IORESOURCE_MEM, 1);
> > Should you not also delete the local variables
> > dmares and gmacres? I doubt they are used
> > after this.
>
> They are used to print message before returning gemini_ethernet_port_probe()
> static int gemini_ethernet_port_probe(struct platform_device *pdev)

Yes and after this they will print something undefined since you never
assign them anything, so the dmares and gmacres prints need to be
removed too. (Which is fine.)

Yours,
Linus Walleij

\
 
 \ /
  Last update: 2021-06-07 08:51    [W:0.077 / U:0.228 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site