From: "Jan Beulich" Subject: Re: [PATCH v2 1/7] x86: clean up psr boot parameter parsing Date: Fri, 20 Mar 2015 16:47:27 +0000 Message-ID: <550C5D2F020000780006C306@mail.emea.novell.com> References: <1426761695-12545-1-git-send-email-chao.p.peng@linux.intel.com> <1426761695-12545-2-git-send-email-chao.p.peng@linux.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1426761695-12545-2-git-send-email-chao.p.peng@linux.intel.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Chao Peng Cc: wei.liu2@citrix.com, Ian.Campbell@citrix.com, stefano.stabellini@eu.citrix.com, andrew.cooper3@citrix.com, Ian.Jackson@eu.citrix.com, xen-devel@lists.xen.org, will.auld@intel.com, keir@xen.org, dgdegra@tycho.nsa.gov List-Id: xen-devel@lists.xenproject.org >>> On 19.03.15 at 11:41, wrote: > +static void __init parse_psr_bool(char* s, char* value, char* feature, int bit) > +{ > + if ( !strcmp(s, feature) ) > + { > + if ( !value ) > + opt_psr |= bit; > + else > + { > + int val_int = parse_bool(value); > + > + if ( val_int == 1 ) > + opt_psr |= bit; > + else if ( val_int != 0 ) > + printk("PSR: unknown %s value: %s\n", feature, value); > + } Even more so that now you try to consolidate and re-use this, you should honor the "off" case as much as the "on" one, i.e. explicitly disable a feature if it was requested to be off. Jan