Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752063AbdGGGWl (ORCPT ); Fri, 7 Jul 2017 02:22:41 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:58856 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751659AbdGGGWk (ORCPT ); Fri, 7 Jul 2017 02:22:40 -0400 Date: Fri, 7 Jul 2017 08:22:22 +0200 (CEST) From: Thomas Gleixner To: Shivappa Vikas cc: Vikas Shivappa , x86@kernel.org, linux-kernel@vger.kernel.org, hpa@zytor.com, peterz@infradead.org, ravi.v.shankar@intel.com, tony.luck@intel.com, fenghua.yu@intel.com, andi.kleen@intel.com Subject: Re: [PATCH 14/21] x86/intel_rdt/cqm: Add mon_data In-Reply-To: Message-ID: References: <1498503368-20173-1-git-send-email-vikas.shivappa@linux.intel.com> <1498503368-20173-15-git-send-email-vikas.shivappa@linux.intel.com> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 827 Lines: 32 On Thu, 6 Jul 2017, Shivappa Vikas wrote: > On Sun, 2 Jul 2017, Thomas Gleixner wrote: > > > +static bool __mon_event_count(u32 rmid, struct rmid_read *rr) > > > +{ > > > + u64 tval; > > > + > > > + tval = __rmid_read(rmid, rr->evtid); > > > + if (tval & (RMID_VAL_ERROR | RMID_VAL_UNAVAIL)) { > > > + rr->val = tval; > > > + return false; > > > + } > > > + switch (rr->evtid) { > > > + case QOS_L3_OCCUP_EVENT_ID: > > > + rr->val += tval; > > > + return true; > > > + default: > > > + return false; > > > > I have no idea what that return code means. > > false for the invalid event id and all errors for __rmid_read. (IOW all errors > for __mon_event-read) Sure, but why bool? What's wrong with proper error return codes, so issues can be distinguished and potentially propagated in the callchain? Thanks, tglx