Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp374620ima; Wed, 24 Oct 2018 02:48:10 -0700 (PDT) X-Google-Smtp-Source: AJdET5dIZmeNxi3AOWIE2QBihGFYX2wVEFAyZhGFt/ArsGOgsKQdQI3hsLtEkDxATAvY2amxyEH+ X-Received: by 2002:a17:902:b485:: with SMTP id y5-v6mr1807537plr.122.1540374490909; Wed, 24 Oct 2018 02:48:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540374490; cv=none; d=google.com; s=arc-20160816; b=NnZENpV8J69p1/Iix9h0Lt8vOhUR69AK7CAU7Y7t4FhbXI6BxB/ruEEthAiuYu7wmZ Mc7AUwikx4OS4tlyVYWhCxtL73b6v68I+GgteCYMkJMxUT+a6CcTltzGMMIfs/DtkM6Z kGpIg7968Qr1A9xskbPcukrE0dKBHfwopHXUJm4xV0fu7Piqo8C2EPmCWdglYx2XQ7zC eglEOZHao6uztsQUBFsrTrAenatF1d7EeE8yNLDqdbFdM4bYnl7+0Kw61Vqfo5Iz2Kvb T1ePsT93/7dYR326U4AnirDqSYEDklGBTnFxlcjrBPf5nBGxUXUmmB/xOLs6qojNISQd 4IxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=MKWzTzG16ACv8/vyr48TpjIca/zvbWcyxosiQu3u9b0=; b=oa28J/NOtjw0eLig5mzZC6U3vYHFn1xjhZ6f02x/mw+7f8oiqUltvOks4oQclEb2m3 pjgRbl9bkXGI+go9ayoLr5PPLRWvMTEKOjhrZfwiq5X5LFEUXduF7HVGOu2mDSBFsBNW iIbyLmEfP7InoK5WpW1hcXxp+P8oH9SUDTzAat+40+GSgdy0tiGbywJ3AQP8Jz/yUX5c s9p+t3k5NVOiC5YkeLA2e2B3AhHknWALPueBGBTAw0h/+a2OD//EslkPis2y47IXc2K5 36oHigI/MliX3gPWmp+6E8hymRr23vPmU8KRMFMiTd+pPfhJgoLWDZ9Y3U1/goN777EX d4wA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p20-v6si4132940pgm.192.2018.10.24.02.47.55; Wed, 24 Oct 2018 02:48:10 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727061AbeJXSNl (ORCPT + 99 others); Wed, 24 Oct 2018 14:13:41 -0400 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:50114 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726426AbeJXSNl (ORCPT ); Wed, 24 Oct 2018 14:13:41 -0400 Received: by atrey.karlin.mff.cuni.cz (Postfix, from userid 512) id 3BA9380765; Wed, 24 Oct 2018 11:46:13 +0200 (CEST) Date: Wed, 24 Oct 2018 11:46:13 +0200 From: Pavel Machek To: Nick Hu Cc: Greentime Ying-Han =?utf-8?B?SHUo6IOh6Iux5ryiKQ==?= , "linux-kernel@vger.kernel.org" , "arnd@arndb.de" , "deanbo422@gmail.com" , "rjw@rjwysocki.net" , "tglx@linutronix.de" , "jason@lakedaemon.net" , "marc.zyngier@arm.com" , Zong Zong-Xian =?utf-8?B?TGko5p2O5a6X5oayKQ==?= , "linux-pm@vger.kernel.org" , Alan Quey-Liang =?utf-8?B?S2FvKOmrmOmtgeiJryk=?= , "green.hu@gmail.com" Subject: Re: [PATCH 1/1] nds32: Power management for nds32 Message-ID: <20181024094613.GA25773@amd> References: <20181024065117.GA18779@amd> <20181024093843.GA18476@andestech.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="FL5UXtIhxfXey3p5" Content-Disposition: inline In-Reply-To: <20181024093843.GA18476@andestech.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --FL5UXtIhxfXey3p5 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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: >=20 > static int nointc_set_wake(struct irq_data *data, unsigned int on) { > unsigned long int_mask =3D __nds32__mfsr(NDS32_SR_INT_MASK); > static unsigned long irq_orig_bit =3D 0; > u32 bit =3D 1 << data->hwirq; >=20 > if (on) { > if (int_mask & bit) > __assign_bit(data->hwirq, &irq_orig_bit, true); > else > __assign_bit(data->hwirq, &irq_orig_bit, false); > =20 > __assign_bit(data->hwirq, &int_mask, true); > __assign_bit(data->hwirq, &wake_mask, true); >=20 > } else { > if (!(irq_orig_bit & bit)) > __assign_bit(data->hwirq, &int_mask, false); >=20 > __assign_bit(data->hwirq, &wake_mask, false); > __assign_bit(data->hwirq, &irq_orig_bit, false); > } >=20 > __nds32__mtsr_dsb(int_mask, NDS32_SR_INT_MASK); > =20 > return 0; Yes, that is better. You don't need =3D 0 on static variable afaict. (And may want to put it out of a function so it stands out).=20 You can add my Acked-by on resulting patch. Thanks, Pavel --=20 (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blo= g.html --FL5UXtIhxfXey3p5 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlvQP2UACgkQMOfwapXb+vJXwACfSdiA+90qawZRRQRvxxDC0LK2 U74An0bjc/fSIkbk2JG3erC5eZSr/PDu =PSUH -----END PGP SIGNATURE----- --FL5UXtIhxfXey3p5--