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]
Date:   Thu, 2 Jun 2022 20:07:08 +0800
From:   szuni chen <szunichen@...il.com>
To:     Andy Shevchenko <andy.shevchenko@...il.com>
Cc:     ChiaEn Wu <peterwu.pub@...il.com>,
        Lee Jones <lee.jones@...aro.org>,
        Daniel Thompson <daniel.thompson@...aro.org>,
        Jingoo Han <jingoohan1@...il.com>, Pavel Machek <pavel@....cz>,
        Rob Herring <robh+dt@...nel.org>,
        Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
        Matthias Brugger <matthias.bgg@...il.com>,
        Sebastian Reichel <sre@...nel.org>,
        Chunfeng Yun <chunfeng.yun@...iatek.com>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Jonathan Cameron <jic23@...nel.org>,
        Lars-Peter Clausen <lars@...afoo.de>,
        Liam Girdwood <lgirdwood@...il.com>,
        Mark Brown <broonie@...nel.org>,
        Guenter Roeck <linux@...ck-us.net>,
        "Krogerus, Heikki" <heikki.krogerus@...ux.intel.com>,
        Helge Deller <deller@....de>, cy_huang@...htek.com,
        alice_chen@...htek.com, chiaen_wu@...htek.com,
        dri-devel <dri-devel@...ts.freedesktop.org>,
        Linux LED Subsystem <linux-leds@...r.kernel.org>,
        devicetree <devicetree@...r.kernel.org>,
        linux-arm Mailing List <linux-arm-kernel@...ts.infradead.org>,
        "moderated list:ARM/Mediatek SoC support" 
        <linux-mediatek@...ts.infradead.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Linux PM <linux-pm@...r.kernel.org>,
        USB <linux-usb@...r.kernel.org>,
        linux-iio <linux-iio@...r.kernel.org>,
        "open list:FRAMEBUFFER LAYER" <linux-fbdev@...r.kernel.org>
Subject: Re: [PATCH 07/14] leds: flashlight: mt6370: Add Mediatek MT6370
 flashlight support

Thank you for the valuable suggestion.

Andy Shevchenko <andy.shevchenko@...il.com> 於 2022年6月1日 週三 下午5:57寫道:
>
> On Tue, May 31, 2022 at 1:32 PM ChiaEn Wu <peterwu.pub@...il.com> wrote:
> >
> > From: Alice Chen <alice_chen@...htek.com>
> >
> > Add Mediatek MT6370 flashlight support
>
> Same comments about the commit message.
>
> ...
>
> > +#include <linux/platform_device.h>
> > +#include <linux/property.h>
> > +#include <linux/regmap.h>
>
> + blank line?
Thanks, this will be refined in the new version.
>
> > +#include <media/v4l2-flash-led-class.h>
>
> + blank line
Thanks, this will be refined in the new version.
>
> > +enum {
> > +       MT6370_LED_FLASH1,
> > +       MT6370_LED_FLASH2,
> > +       MT6370_MAX_LEDS
> > +};
>
> ...
>
> > +       struct mt6370_led *led = container_of(fl_cdev, struct mt6370_led,
> > +                                             flash);
>
> > +       struct mt6370_led *led = container_of(fl_cdev, struct mt6370_led,
> > +                                             flash);
>
> Make a helper out of this
>
>   #define to_mt637_led()  container_of()
>
> and reuse.
Thanks, this will be refined in the new version.
>
> ...
>
> > +       /*
> > +        * For the flash turn on/off, HW rampping up/down time is 5ms/500us,
>
> ramping
>
> > +        * respectively
>
> Period!
Thanks, this will be refined in the new version.
>
> > +        */
>
> ...
>
> > +       const char * const states[] = { "off", "keep", "on" };
> > +       const char *str;
> > +       int ret;
> > +
> > +       if (!fwnode_property_read_string(init_data->fwnode,
> > +                                        "default-state", &str)) {
> > +               ret = match_string(states, ARRAY_SIZE(states), str);
> > +               if (ret < 0)
> > +                       ret = STATE_OFF;
> > +
> > +               led->default_state = ret;
> > +       }
>
> fwnode_property_match_string()?
Sorry, but I think the use of this function is different from my target.
I want to read the string of the "default-state" property and figure
out if the string is in the states array.
But the fwnode_property_match_string aimed to figure out if the state
in the property array.
One is a property array and another one is a state array.
>
> ...
>
> > +       if (!count || count > MT6370_MAX_LEDS) {
> > +               dev_err(&pdev->dev,
> > +               "No child node or node count over max led number %lu\n", count);
> > +               return -EINVAL;
>
> return dev_err_probe(...);
Thanks, will refine in the new version
>
> > +       }
>
>
> --
> With Best Regards,
> Andy Shevchenko
>
>
Sincerely,
Alice Chen

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ