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: <68466850-ddb0-119a-ea82-636ec2c5368e@gmail.com>
Date:   Wed, 1 Feb 2023 17:59:49 +0100
From:   Matthias Brugger <matthias.bgg@...il.com>
To:     Balsam CHIHI <bchihi@...libre.com>,
        Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>
Cc:     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



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.

[...]

>>> +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.

[...]

>>> +
>>> +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.

Regards,
Matthias

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ