From: Pavel Machek <pavel@ucw.cz>
To: Nick Hu <nickhu@andestech.com>
Cc: "Greentime Ying-Han Hu(胡英漢)" <greentime@andestech.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"arnd@arndb.de" <arnd@arndb.de>,
"deanbo422@gmail.com" <deanbo422@gmail.com>,
"rjw@rjwysocki.net" <rjw@rjwysocki.net>,
"tglx@linutronix.de" <tglx@linutronix.de>,
"jason@lakedaemon.net" <jason@lakedaemon.net>,
"marc.zyngier@arm.com" <marc.zyngier@arm.com>,
"Zong Zong-Xian Li(李宗憲)" <zong@andestech.com>,
"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
"Alan Quey-Liang Kao(高魁良)" <alankao@andestech.com>,
"green.hu@gmail.com" <green.hu@gmail.com>
Subject: Re: [PATCH 1/1] nds32: Power management for nds32
Date: Wed, 24 Oct 2018 11:46:13 +0200 [thread overview]
Message-ID: <20181024094613.GA25773@amd> (raw)
In-Reply-To: <20181024093843.GA18476@andestech.com>
[-- Attachment #1: Type: text/plain, Size: 1480 bytes --]
Hi!
> > Can we get rid of "is_bit_1" array here, and use normal bit operations
> > on another variable here?
> >
> Do you mean like this:
>
> static int nointc_set_wake(struct irq_data *data, unsigned int on) {
> unsigned long int_mask = __nds32__mfsr(NDS32_SR_INT_MASK);
> static unsigned long irq_orig_bit = 0;
> u32 bit = 1 << data->hwirq;
>
> if (on) {
> if (int_mask & bit)
> __assign_bit(data->hwirq, &irq_orig_bit, true);
> else
> __assign_bit(data->hwirq, &irq_orig_bit, false);
>
> __assign_bit(data->hwirq, &int_mask, true);
> __assign_bit(data->hwirq, &wake_mask, true);
>
> } else {
> if (!(irq_orig_bit & bit))
> __assign_bit(data->hwirq, &int_mask, false);
>
> __assign_bit(data->hwirq, &wake_mask, false);
> __assign_bit(data->hwirq, &irq_orig_bit, false);
> }
>
> __nds32__mtsr_dsb(int_mask, NDS32_SR_INT_MASK);
>
> return 0;
Yes, that is better. You don't need = 0 on static variable
afaict. (And may want to put it out of a function so it stands out).
You can add my Acked-by on resulting patch.
Thanks,
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]
prev parent reply other threads:[~2018-10-24 9:46 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-24 3:40 [PATCH 0/1] nds32: Power management Nickhu
2018-10-24 3:40 ` Nickhu
2018-10-24 3:40 ` [PATCH 1/1] nds32: Power management for nds32 Nickhu
2018-10-24 3:40 ` Nickhu
2018-10-24 6:51 ` Pavel Machek
2018-10-24 9:38 ` Nick Hu
2018-10-24 9:46 ` Pavel Machek [this message]
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=20181024094613.GA25773@amd \
--to=pavel@ucw.cz \
--cc=alankao@andestech.com \
--cc=arnd@arndb.de \
--cc=deanbo422@gmail.com \
--cc=green.hu@gmail.com \
--cc=greentime@andestech.com \
--cc=jason@lakedaemon.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=marc.zyngier@arm.com \
--cc=nickhu@andestech.com \
--cc=rjw@rjwysocki.net \
--cc=tglx@linutronix.de \
--cc=zong@andestech.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.