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:	Tue, 17 Aug 2010 12:28:45 +0300
From:	Felipe Balbi <felipe.balbi@...ia.com>
To:	"ext hvaibhav@...com" <hvaibhav@...com>
Cc:	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"akpm@...ux-foundation.org" <akpm@...ux-foundation.org>,
	"byron.bbradley@...il.com" <byron.bbradley@...il.com>,
	"linux-omap@...r.kernel.org" <linux-omap@...r.kernel.org>
Subject: Re: [PATCH 1/3] RTC:s35390a: Add Alarm interrupt support

On Tue, Aug 17, 2010 at 10:48:39AM +0200, ext hvaibhav@...com wrote:
>From: Vaibhav Hiremath <hvaibhav@...com>

you need a description here.

>Signed-off-by: Vaibhav Hiremath <hvaibhav@...com>

[snip]

>+static void s35390a_work(struct work_struct *work)
>+{
>+	struct s35390a *s35390a;
>+	struct i2c_client *client;
>+	char buf[1];
>+
>+	s35390a = container_of(work, struct s35390a, work);
>+	if (!s35390a)
>+		return;

container_of() will never return NULL. You can remove this check. You 
won't need this, actually after converting to threaded_irq, see below.

>+static irqreturn_t s35390a_irq(int irq, void *client)
>+{
>+	struct s35390a *s35390a;

all the other drivers will do:

static irqreturn_t s35390a_irq(int irq, void *_s35390a)
{
	struct s35390a	*s35390a = _s35390a

	[...]

>+	if (!client)
>+		return IRQ_HANDLED;

if client is NULL, you should let this oops.

>+	schedule_work(&s35390a->work);

please don't use workqueue. Use threaded IRQ.

>@@ -261,15 +447,30 @@ static int s35390a_probe(struct i2c_client *client,
> 	if (s35390a_get_datetime(client, &tm) < 0)
> 		dev_warn(&client->dev, "clock needs to be set\n");
>
>+	INIT_WORK(&s35390a->work, s35390a_work);
>+
>+	if (client->irq > 0) {

irq 0 is a valid number.

>+		err = request_irq(client->irq, s35390a_irq, IRQF_TRIGGER_LOW,
>+				client->name, client);

instead of the i2c client, you can pass s35390. Also use 
request_threaded_irq();

-- 
balbi

DefectiveByDesign.org
--
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