Re: [PATCH 3/7] hwmon/coretemp: Handle large core id value

From: Zhang Rui
Date: Sat Aug 13 2022 - 13:24:22 EST


Hi, Guenter,

On Fri, 2022-08-12 at 10:16 -0700, Guenter Roeck wrote:
>
> > -       /* The core id is too big, just return */
> > -       indx = TO_ATTR_NO(cpu);
> > -       if (indx > MAX_CORE_DATA - 1)
> > +       pd = platform_get_drvdata(pdev);
> > +
> > +       for (i = 0; i < NUM_REAL_CORES; i++) {
> > +               if (pd->cpu_map[i] == topology_core_id(cpu)) {
> > +                       indx = i + BASE_SYSFS_ATTR_NO;
> > +                       break;
> > +               }
> > +       }
> > +
> > +       /* Too many cores and this core is not pupolated, just
> > return */
>
> populated
>
> Other than that looks good.
>
> Acked-by: Guenter Roeck <linux@xxxxxxxxxxxx>

Thanks for reviewing, will fix in next version.

thanks,
rui