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] [day] [month] [year] [list]
Date:   Mon, 3 Feb 2020 07:46:21 +0000
From:   Lee Jones <lee.jones@...aro.org>
To:     Hsin-hsiung Wang <hsin-hsiung.wang@...iatek.com>
Cc:     Rob Herring <robh+dt@...nel.org>,
        Alexandre Belloni <alexandre.belloni@...e-electrons.com>,
        Matthias Brugger <matthias.bgg@...il.com>,
        Mark Rutland <mark.rutland@....com>,
        Eddie Huang <eddie.huang@...iatek.com>,
        Sean Wang <sean.wang@...iatek.com>,
        Alessandro Zummo <a.zummo@...ertech.it>,
        Tianping Fang <tianping.fang@...iatek.com>,
        Thomas Gleixner <tglx@...utronix.de>,
        Josef Friedl <josef.friedl@...ed.at>,
        Kate Stewart <kstewart@...uxfoundation.org>,
        Ran Bi <ran.bi@...iatek.com>,
        Frank Wunderlich <frank-w@...lic-files.de>,
        devicetree@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
        linux-mediatek@...ts.infradead.org, linux-kernel@...r.kernel.org,
        linux-rtc@...r.kernel.org, srv_heupstream@...iatek.com
Subject: Re: [PATCH v7 3/6] mfd: Add support for the MediaTek MT6358 PMIC

On Wed, 22 Jan 2020, Hsin-hsiung Wang wrote:

> Hi,
> 
> On Mon, 2019-12-16 at 15:17 +0000, Lee Jones wrote:
> > On Wed, 11 Dec 2019, Hsin-Hsiung Wang wrote:
> > 
> > > This adds support for the MediaTek MT6358 PMIC. This is a
> > > multifunction device with the following sub modules:
> > > 
> > > - Regulator
> > > - RTC
> > > - Codec
> > > - Interrupt
> > > 
> > > It is interfaced to the host controller using SPI interface
> > > by a proprietary hardware called PMIC wrapper or pwrap.
> > > MT6358 MFD is a child device of the pwrap.
> > > 
> > > Signed-off-by: Hsin-Hsiung Wang <hsin-hsiung.wang@...iatek.com>
> > > ---
> > >  drivers/mfd/Makefile                 |   2 +-
> > >  drivers/mfd/mt6358-irq.c             | 224 ++++++++++++++++++++++++++++
> > >  drivers/mfd/mt6397-core.c            |  45 +++++-
> > >  include/linux/mfd/mt6358/core.h      | 158 ++++++++++++++++++++
> > >  include/linux/mfd/mt6358/registers.h | 282 +++++++++++++++++++++++++++++++++++
> > >  include/linux/mfd/mt6397/core.h      |   3 +
> > >  6 files changed, 712 insertions(+), 2 deletions(-)
> > >  create mode 100644 drivers/mfd/mt6358-irq.c
> > >  create mode 100644 include/linux/mfd/mt6358/core.h
> > >  create mode 100644 include/linux/mfd/mt6358/registers.h

[...]

> > > +int mt6358_irq_init(struct mt6397_chip *chip)
> > > +{
> > > +	int i, j, ret;
> > > +	struct pmic_irq_data *irqd;
> > > +
> > > +	irqd = devm_kzalloc(chip->dev, sizeof(struct pmic_irq_data *),
> > > +			    GFP_KERNEL);
> > > +	if (!irqd)
> > > +		return -ENOMEM;
> > > +
> > > +	chip->irq_data = irqd;
> > > +
> > > +	mutex_init(&chip->irqlock);
> > > +	irqd->top_int_status_reg = MT6358_TOP_INT_STATUS0;
> > > +	irqd->num_pmic_irqs = MT6358_IRQ_NR;
> > > +	irqd->num_top = ARRAY_SIZE(mt6358_ints);
> > > +
> > > +	irqd->enable_hwirq = devm_kcalloc(chip->dev,
> > > +					  irqd->num_pmic_irqs,
> > > +					  sizeof(bool),
> > 
> > This is fragile.  What if the type changes elsewhere?
> > 
> 
> Thanks for your comment.
> Do you mean using 'sizeof(*irqd->enable_hwirq)' instead of
> 'sizeof(bool)'?

Yes please.

-- 
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ