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]
Message-ID: <CY1PR0301MB0843D0E99E78F30D0DEBC8B783600@CY1PR0301MB0843.namprd03.prod.outlook.com>
Date:	Wed, 26 Aug 2015 19:05:18 +0000
From:	Shenwei Wang <Shenwei.Wang@...escale.com>
To:	Thomas Gleixner <tglx@...utronix.de>
CC:	"shawn.guo@...aro.org" <shawn.guo@...aro.org>,
	"jason@...edaemon.net" <jason@...edaemon.net>,
	"sudeep.holla@....com" <sudeep.holla@....com>,
	"linux-arm-kernel@...ts.infradead.org" 
	<linux-arm-kernel@...ts.infradead.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	Huang Anson <Anson.Huang@...escale.com>
Subject: RE: [PATCH 1/1] irqchip: imx-gpcv2: Simplify the implemenation



> -----Original Message-----
> From: Thomas Gleixner [mailto:tglx@...utronix.de]
> > > > +
> > > >  	if (sources)
> > > > -		*sources = imx_gpcv2_instance->wakeup_sources;
> > > > +		*sources = cd->wakeup_sources;
> > > >
> > > >  	return IMR_NUM;
> > >
> > > You do not need the intermediate storage at all.
> > >
> > > u32 imx_gpcv2_get_wakeup_source(u32 *sources) {
> > > 	if (sources) {
> > > 		for (i = 0; i < IMR_NUM; i++) {
> > > 			reg = cd->gpc_base + cd->cpu2wakeup + i * 4;
> > > 			sources[i] = readl_relaxed(reg);
> > > 		}
> > > 	}
> > > 	....
> >
> > Using the intermediate storage here can make the caller a little
> > easier, because the caller does not need to malloc the memory before the call.
> > Especially the caller does not even know how many memory to allocate
> > In the beginning.
> 
> Fair enough, but why do you need that case where sources can be NULL just to
> return IMR_NUM?

The intention is to get the IMR_NUM only. But so far no user uses this feature.

Thanks,
Shenwei

> Thanks,
> 
> 	tglx

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