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:	Mon, 5 Dec 2011 12:27:11 +0800
From:	Ming Lei <ming.lei@...onical.com>
To:	"Aguirre, Sergio" <saaguirre@...com>
Cc:	Mauro Carvalho Chehab <mchehab@...radead.org>,
	Tony Lindgren <tony@...mide.com>,
	Sylwester Nawrocki <snjw23@...il.com>,
	Greg KH <greg@...ah.com>, Alan Cox <alan@...rguk.ukuu.org.uk>,
	linux-omap@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
	linux-kernel@...r.kernel.org, linux-media@...r.kernel.org
Subject: Re: [RFC PATCH v1 2/7] omap4: build fdif omap device from hwmod

Hi,

On Sat, Dec 3, 2011 at 12:28 AM, Aguirre, Sergio <saaguirre@...com> wrote:
> Hi Ming,
>
> Thanks for the patches.

Thanks for your review.

> On Fri, Dec 2, 2011 at 9:02 AM, Ming Lei <ming.lei@...onical.com> wrote:
>> Signed-off-by: Ming Lei <ming.lei@...onical.com>
>> ---
>>  arch/arm/mach-omap2/devices.c |   33 +++++++++++++++++++++++++++++++++
>>  1 files changed, 33 insertions(+), 0 deletions(-)
>>
>> diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
>> index 1166bdc..a392af5 100644
>> --- a/arch/arm/mach-omap2/devices.c
>> +++ b/arch/arm/mach-omap2/devices.c
>> @@ -728,6 +728,38 @@ void __init omap242x_init_mmc(struct omap_mmc_platform_data **mmc_data)
>>
>>  #endif
>>
>> +static struct platform_device* __init omap4_init_fdif(void)
>> +{
>> +       int id = -1;
>
> You could remove this , as it is being used only once, and never changed.

Yes.

>
>> +       struct platform_device *pd;
>> +       struct omap_hwmod *oh;
>> +       const char *dev_name = "fdif";
>> +
>> +       oh = omap_hwmod_lookup("fdif");
>> +       if (!oh) {
>> +               pr_err("Could not look up fdif hwmod\n");
>> +               return NULL;
>> +       }
>> +
>> +       pd = omap_device_build(dev_name, id, oh, NULL, 0, NULL, 0, 0);
>
> Just do:
>
> pd = omap_device_build(dev_name, -1, oh, NULL, 0, NULL, 0, 0);
>
>> +       WARN(IS_ERR(pd), "Can't build omap_device for %s.\n",
>> +                               dev_name);
>> +       return pd;
>> +}
>> +
>> +static void __init omap_init_fdif(void)
>> +{
>> +       if (cpu_is_omap44xx()) {
>> +               struct platform_device *pd;
>> +
>> +               pd = omap4_init_fdif();
>> +               if (!pd)
>> +                       return;
>> +
>> +               pm_runtime_enable(&pd->dev);
>> +       }
>> +}
>
> IMHO, you could reduce 1 level of indentation here, like this:
>
> static void __init omap_init_fdif(void)
> {
>        struct platform_device *pd;
>
>        if (!cpu_is_omap44xx())
>                return;
>
>        pd = omap4_init_fdif();
>        if (!pd)
>                return;
>
>        pm_runtime_enable(&pd->dev);
> }

OK, will take this.

thanks,
--
Ming Lei
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ