From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Jan Beulich" Subject: Re: [PATCH 2/8] xen/misc: Remove or annotate possibly-unused functions Date: Wed, 10 Feb 2016 06:06:51 -0700 Message-ID: <56BB43FB02000078000D08DB@prv-mh.provo.novell.com> References: <1455048108-5045-1-git-send-email-andrew.cooper3@citrix.com> <1455048108-5045-3-git-send-email-andrew.cooper3@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1455048108-5045-3-git-send-email-andrew.cooper3@citrix.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: Andrew Cooper Cc: Tim Deegan , Ian Campbell , Xen-devel List-Id: xen-devel@lists.xenproject.org >>> On 09.02.16 at 21:01, wrote: > --- a/xen/common/rcupdate.c > +++ b/xen/common/rcupdate.c > @@ -141,12 +141,6 @@ static inline int rcu_batch_before(long a, long b) > return (a - b) < 0; > } > > -/* Is batch a after batch b ? */ > -static inline int rcu_batch_after(long a, long b) > -{ > - return (a - b) > 0; > -} To me it is the nature of inline functions that they may or may not be used, regardless of whether they live in a header file (where I would have supposed Clang won't warn about, but the change below makes me assume I'm wrong) or in a source file. > --- a/xen/include/xen/compat.h > +++ b/xen/include/xen/compat.h > @@ -134,14 +134,16 @@ > #define CHECK_NAME_(k, n, tag) __check ## tag ## k ## _ ## n > > #define CHECK_TYPE(name) \ > -static inline int CHECK_NAME(name, T)(xen_ ## name ## _t *x, \ > - compat_ ## name ## _t *c) \ > +static inline int __maybe_unused \ > +CHECK_NAME(name, T)(xen_ ## name ## _t *x, \ > + compat_ ## name ## _t *c) \ > { \ > return x == c; \ > } > #define CHECK_TYPE_(k, n) \ > -static inline int CHECK_NAME_(k, n, T)(k xen_ ## n *x, \ > - k compat_ ## n *c) \ > +static inline int __maybe_unused \ > +CHECK_NAME_(k, n, T)(k xen_ ## n *x, \ > + k compat_ ## n *c) \ > { \ > return x == c; \ > } > @@ -154,14 +156,14 @@ static inline int CHECK_NAME_(k, n, T)(k xen_ ## n *x, \ > sizeof(k compat_ ## n)) * 2] > > #define CHECK_FIELD_COMMON(name, t, f) \ > -static inline int name(xen_ ## t ## _t *x, compat_ ## t ## _t *c) \ > +static inline int __maybe_unused name(xen_ ## t ## _t *x, compat_ ## t ## _t *c) \ > { \ > BUILD_BUG_ON(offsetof(xen_ ## t ## _t, f) != \ > offsetof(compat_ ## t ## _t, f)); \ > return &x->f == &c->f; \ > } > #define CHECK_FIELD_COMMON_(k, name, n, f) \ > -static inline int name(k xen_ ## n *x, k compat_ ## n *c) \ > +static inline int __maybe_unused name(k xen_ ## n *x, k compat_ ## n *c) \ > { \ > BUILD_BUG_ON(offsetof(k xen_ ## n, f) != \ > offsetof(k compat_ ## n, f)); \ So if these are all noticed to be unused, why would others in other header files not be? I think there's at the very least some aspect missing in the description, explaining what makes these stand out from the others. Jan