lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAGuA+oq1jZvDUK01rX-jJH7-5waWA4JnytoBmCeD7+SbndPgrw@mail.gmail.com>
Date:   Fri, 3 Feb 2023 11:35:15 +0100
From:   Balsam CHIHI <bchihi@...libre.com>
To:     Matthias Brugger <matthias.bgg@...il.com>
Cc:     Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>,
        daniel.lezcano@...aro.org, angelogioacchino.delregno@...labora.com,
        rafael@...nel.org, amitk@...nel.org, rui.zhang@...el.com,
        robh+dt@...nel.org, krzysztof.kozlowski+dt@...aro.org,
        rdunlap@...radead.org, ye.xingchen@....com.cn,
        p.zabel@...gutronix.de, linux-pm@...r.kernel.org,
        linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
        linux-mediatek@...ts.infradead.org, devicetree@...r.kernel.org,
        khilman@...libre.com, james.lo@...iatek.com,
        rex-bc.chen@...iatek.com
Subject: Re: [PATCH v12] thermal: drivers: mediatek: Add the Low Voltage
 Thermal Sensor driver

Hi Matthias,

On Wed, Feb 1, 2023 at 5:59 PM Matthias Brugger <matthias.bgg@...il.com> wrote:
>
>
>
> On 01/02/2023 17:46, Balsam CHIHI wrote:
> > Hi Krzysztof,
> >
> > Thank you very much for the review!
> >
> > On Wed, Feb 1, 2023 at 8:55 AM Krzysztof Kozlowski
> > <krzysztof.kozlowski@...aro.org> wrote:
> >>
> >> On 31/01/2023 16:38, bchihi@...libre.com wrote:
> >>> From: Balsam CHIHI <bchihi@...libre.com>
> >>>
>
> [...]
>
> >>> +
> >>> +static irqreturn_t lvts_ctrl_irq_handler(struct lvts_ctrl *lvts_ctrl)
> >>> +{
> >>> +     irqreturn_t iret = IRQ_NONE;
> >>> +     u32 value, masks[] = {
> >>
> >> Don't mix different types in one declaration. u32 and a pointer are
> >> quite different types.
> >
> > I'm not sure to understand.
> > LVTS_INT_SENSORx are not pointers but register values.
> >
>
> u32 mask[] is a pointer to a array of u32 values of undefined length.
>

I will change this to :
u32 value;
u32 masks[] = {

> [...]
>
> >>> +static int __init lvts_golden_temp_init(struct device *dev, u32 *value)
> >>
> >> You did not test it, right? Build with section mismatch analysis...
> >
> > I'm not sure to fully understand this comment.
> > Would you explain, please?
> >
>
> AFAIU:
>
> lvts_golden_temp_init() and lvts_ctrl_init() are called from a function that is
> not in __init section:
> lvts_domain_init()
>
> So if you free up the first to functions after init but not the callers, things
> can explote.
>

__init will be removed for all functions.

> [...]
>
> >>> +
> >>> +static int lvts_probe(struct platform_device *pdev)
> >>> +{
> >>> +     struct lvts_data *lvts_data;
> >>> +     struct lvts_domain *lvts_td;
> >>> +     struct device *dev = &pdev->dev;
> >>> +     struct resource *res;
> >>> +     int irq, ret;
> >>> +
> >>> +     lvts_td = devm_kzalloc(dev, sizeof(*lvts_td), GFP_KERNEL);
> >>> +     if (!lvts_td)
> >>> +             return -ENOMEM;
> >>> +
> >>> +     lvts_data = (struct lvts_data *)of_device_get_match_data(dev);
> >>
> >> Why do you need case?
> >
> > Would you explain, please?
> >
>
> Typo by Krysztof, he meant the cast.
> lvts_data = of_device_get_match_data(dev);
> should be good enough.
>

OK,
It will be like you suggested.

> Regards,
> Matthias

Thank you for the review!

Best regards,
Balsam

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ