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: <4656BEB6164FC34F8171C6538F1A595B2E99254E@SHSMSX101.ccr.corp.intel.com>
Date:	Wed, 17 Sep 2014 06:47:35 +0000
From:	"Chen, Alvin" <alvin.chen@...el.com>
To:	Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
CC:	Linus Walleij <linus.walleij@...aro.org>,
	Alexandre Courbot <gnurou@...il.com>,
	Grant Likely <grant.likely@...aro.org>,
	Rob Herring <robh+dt@...nel.org>,
	atull <atull@...nsource.altera.com>,
	"linux-gpio@...r.kernel.org" <linux-gpio@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
	"Ong, Boon Leong" <boon.leong.ong@...el.com>,
	"Kweh, Hock Leong" <hock.leong.kweh@...el.com>,
	Darren Hart <dvhart@...ux.intel.com>,
	Sebastian Andrzej Siewior <sebastian@...akpoint.cc>,
	"Westerberg, Mika" <mika.westerberg@...el.com>,
	Arnd Bergmann <arnd@...db.de>
Subject: RE: [PATCH 3/4 v4] GPIO: gpio-dwapb: Support Debounce

> > +	struct bgpio_chip *bgc = to_bgpio_chip(gc);
> > +	struct dwapb_gpio_port *port =
> > +			container_of(bgc, struct dwapb_gpio_port, bgc);
> 
> Does it make sense to introduce an inline helper like
> 
> static inline struct dwapb_gpio_port *to_dwapb_gpio_port(struct bgpio_chip
> *gc) {...}
> 
> ?

OK.

> There is also another place where it could be used.
> 
> > +	struct dwapb_gpio *gpio = port->gpio;
> > +	unsigned long flags, val_deb;
> > +	unsigned long mask = bgc->pin2mask(bgc, offset);
> > +
> > +	spin_lock_irqsave(&bgc->lock, flags);
> > +
> > +	val_deb = dwapb_read(gpio, GPIO_PORTA_DEBOUNCE);
> > +	if (debounce)
> > +		dwapb_write(gpio, GPIO_PORTA_DEBOUNCE, mask | val_deb);
> 
> May you put value on the first place? Like 'val_deb | mask'.

OK.

> > +	else
> > +		dwapb_write(gpio, GPIO_PORTA_DEBOUNCE, ~mask & val_deb);
> 
> Ditto.
> 
OK.
> > +

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ