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: <8984936f9e914442995d79039543cb58@BL2PR03MB338.namprd03.prod.outlook.com>
Date:	Wed, 26 Mar 2014 07:08:28 +0000
From:	Yao Yuan <yao.yuan@...escale.com>
To:	Marek Vasut <marex@...x.de>
CC:	"wsa@...-dreams.de" <wsa@...-dreams.de>,
	"mark.rutland@....com" <mark.rutland@....com>,
	"shawn.guo@...aro.org" <shawn.guo@...aro.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"linux-arm-kernel@...ts.infradead.org" 
	<linux-arm-kernel@...ts.infradead.org>,
	"linux-i2c@...r.kernel.org" <linux-i2c@...r.kernel.org>
Subject: RE: [PATCH v3 1/2] i2c: add DMA support for freescale i2c driver

On Wednesday, March 26, 2014 at 02:27:46 PM, Marek Vasut wrote:
> On Wednesday, March 26, 2014 at 06:56:34 AM, Yao Yuan wrote:
> > On Wednesday, March 26, 2014 at 11:43:27 AM, Marek Vasut wrote:
> > > On Wednesday, March 26, 2014 at 04:08:27 AM, Yao Yuan wrote:
> > >
> > > [...]
> > >
> > > > > > +		i2c_imx->use_dma = false;
> > > > > > +	} else if (i2c_imx_dma_request(i2c_imx,
> > > > > > +(dma_addr_t)phy_addr))
> > >
> > > {
> > >
> > > > > > +		dev_info(&pdev->dev,
> > > > > > +				"can't request dma chan, faild use dma.
> \n");
> > > > > > +		i2c_imx->use_dma = false;
> > > > > > +	} else {
> > > > > > +		i2c_imx->use_dma = true;
> > > > > > +	}
> > > > >
> > > > > Can you not just check if i2c_imx->dma is valid pointer or NULL
> > >
> > > pointer ?
> > >
> > > > > Then you won't need a separate variable, for this purpose ...
> right ?
> > > >
> > > > Sorry and I think what I know is just to check whether it is NULL.
> > > > Then for the second question, maybe there are some other ways, But
> > > > I think it is more tidy and easier understanding for using a
> > > > separate variable, for this purpose.
> > >
> > > You are just wasting space and duplicating data, unless I am wrong.
> >
> > Well, Do you have a better idea? Although I think it's necessary.
> 
> I think we disconnected here, sorry. Why can you not use (i2c_imx->dma !=
> NULL) instead of (i2c_imx->use_dma == true) please ?
> 

But there are two judge conditions. But only the "i2c_imx->dma", but also whether "i2c_imx_dma_request" success.

"i2c_imx->use_dma == true" be equivalent to "i2c_imx->dma != NULL && !i2c_imx_dma_request()" 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ