From: zecke@selfish.org (Holger Hans Peter Freyther)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] irq: Check if someone is overwriting the irq chip data
Date: Fri, 10 Jun 2011 20:38:43 +0200 [thread overview]
Message-ID: <mailman.14.1307792983.24103.linux-arm-kernel@lists.infradead.org> (raw)
This tries to establish the semantic that one can either
set the chip data to NULL or if it is NULL to some value
but never overwrite a non NULL value.
Signed-off-by: Holger Hans Peter Freyther <zecke@selfish.org>
---
kernel/irq/chip.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c
index d5a3009..25e446d 100644
--- a/kernel/irq/chip.c
+++ b/kernel/irq/chip.c
@@ -123,6 +123,10 @@ int irq_set_chip_data(unsigned int irq, void *data)
if (!desc)
return -EINVAL;
+
+ BUG_ON(data && desc->irq_data.chip_data &&
+ data != desc->irq_data.chip_data);
+
desc->irq_data.chip_data = data;
irq_put_desc_unlock(desc, flags);
return 0;
--
1.7.4.1
reply other threads:[~2011-06-10 18:38 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=mailman.14.1307792983.24103.linux-arm-kernel@lists.infradead.org \
--to=zecke@selfish.org \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).