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] [day] [month] [year] [list]
Message-ID: <20181024094613.GA25773@amd>
Date:   Wed, 24 Oct 2018 11:46:13 +0200
From:   Pavel Machek <pavel@....cz>
To:     Nick Hu <nickhu@...estech.com>
Cc:     Greentime Ying-Han Hu(胡英漢) 
        <greentime@...estech.com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "arnd@...db.de" <arnd@...db.de>,
        "deanbo422@...il.com" <deanbo422@...il.com>,
        "rjw@...ysocki.net" <rjw@...ysocki.net>,
        "tglx@...utronix.de" <tglx@...utronix.de>,
        "jason@...edaemon.net" <jason@...edaemon.net>,
        "marc.zyngier@....com" <marc.zyngier@....com>,
        Zong Zong-Xian Li(李宗憲) 
        <zong@...estech.com>,
        "linux-pm@...r.kernel.org" <linux-pm@...r.kernel.org>,
        Alan Quey-Liang Kao(高魁良) 
        <alankao@...estech.com>, "green.hu@...il.com" <green.hu@...il.com>
Subject: Re: [PATCH 1/1] nds32: Power management for nds32

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

Download attachment "signature.asc" of type "application/pgp-signature" (182 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ