From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from intranet.asianux.com (intranet.asianux.com [58.214.24.6]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id BE8E42C00D0 for ; Thu, 25 Jul 2013 16:31:33 +1000 (EST) Message-ID: <51F0C606.9090702@asianux.com> Date: Thu, 25 Jul 2013 14:30:30 +0800 From: Chen Gang MIME-Version: 1.0 To: Benjamin Herrenschmidt Subject: Re: [PATCH v2] powerpc: kernel: remove useless code which related with 'max_cpus' References: <51ECCA10.7010709@asianux.com> <51ECCEA8.5040406@linux.vnet.ibm.com> <51ECD0BF.8080605@asianux.com> <51ECD3D4.9020405@asianux.com> <51ECD664.7040708@linux.vnet.ibm.com> <20130723134431.GF31944@concordia> <51EF1F97.3070409@asianux.com> <20130724011640.GA6042@concordia> <51EF375D.9060006@asianux.com> <20130725031501.GA15673@concordia> <1374729381.6142.59.camel@pasglop> <51F0B68F.4000402@asianux.com> <1374731505.6142.64.camel@pasglop> <1374732225.6142.66.camel@pasglop> In-Reply-To: <1374732225.6142.66.camel@pasglop> Content-Type: text/plain; charset=UTF-8 Cc: chenhui.zhao@freescale.com, "paulus@samba.org" , "Srivatsa S. Bhat" , Thomas Gleixner , "linuxppc-dev@lists.ozlabs.org" List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On 07/25/2013 02:03 PM, Benjamin Herrenschmidt wrote: > On Thu, 2013-07-25 at 15:51 +1000, Benjamin Herrenschmidt wrote: >> On Thu, 2013-07-25 at 13:24 +0800, Chen Gang wrote: >>> For an extern function, if the performance is not sensible, better to >>> have the return value which can indicate the failure with the negative >>> number. >> >> The return value is meaningless. >> >> We don't have a good way to handle it. It has no defined semantics. What >> does "failure" means in that case ? Nothing ! >> >> So just remove it. > > Note: If you want to create a concept of smp_ops->probe() failing, then > not only you need to check all the implementations, but *also* add > something sensible to do when it fails ... such as disabling bringup of > CPUs. > Hmm... if critical, use BUG(), else (none critical), just print a warning message ? > In this case however, we have put the burden of doing whatever makes > sense in the probe() function itself. If can adjust the possible map if > it fails. > Excuse me, my English is not quite well, I guss your meaning is: "it can be fail in internal implementation, but has no effect with the final result to caller", is it correct ? If what I understand is correct, it needn't let caller know about it. Thanks. -- Chen Gang