From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38490) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YDqpn-0002mD-5q for qemu-devel@nongnu.org; Wed, 21 Jan 2015 03:40:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YDqpf-00089X-EK for qemu-devel@nongnu.org; Wed, 21 Jan 2015 03:40:19 -0500 Received: from e06smtp11.uk.ibm.com ([195.75.94.107]:55898) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YDqpf-00080Q-4y for qemu-devel@nongnu.org; Wed, 21 Jan 2015 03:40:11 -0500 Received: from /spool/local by e06smtp11.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 21 Jan 2015 08:40:06 -0000 Received: from b06cxnps3074.portsmouth.uk.ibm.com (d06relay09.portsmouth.uk.ibm.com [9.149.109.194]) by d06dlp02.portsmouth.uk.ibm.com (Postfix) with ESMTP id 90DAC219005C for ; Wed, 21 Jan 2015 08:40:03 +0000 (GMT) Received: from d06av07.portsmouth.uk.ibm.com (d06av07.portsmouth.uk.ibm.com [9.149.37.248]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t0L8e5S162324854 for ; Wed, 21 Jan 2015 08:40:05 GMT Received: from d06av07.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av07.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t0L8e4oP026614 for ; Wed, 21 Jan 2015 03:40:04 -0500 Date: Wed, 21 Jan 2015 09:40:02 +0100 From: Thomas Huth Message-ID: <20150121094002.6beed6a1@oc7435384737.ibm.com> In-Reply-To: <1420719588-8138-6-git-send-email-peter.maydell@linaro.org> References: <1420719588-8138-1-git-send-email-peter.maydell@linaro.org> <1420719588-8138-6-git-send-email-peter.maydell@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 5/6] linux-user/main.c: Mark end_exclusive() as possibly unused List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: Riku Voipio , qemu-devel@nongnu.org, patches@linaro.org On Thu, 8 Jan 2015 12:19:47 +0000 Peter Maydell wrote: > The function end_exclusive() isn't used on all targets; mark it as > such to avoid a clang warning. > > Signed-off-by: Peter Maydell > --- > linux-user/main.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/linux-user/main.c b/linux-user/main.c > index bbd1cfd..0fda51c 100644 > --- a/linux-user/main.c > +++ b/linux-user/main.c > @@ -169,7 +169,7 @@ static inline void start_exclusive(void) > } > > /* Finish an exclusive operation. */ > -static inline void end_exclusive(void) > +static inline void __attribute__((unused)) end_exclusive(void) > { > pending_cpus = 0; > pthread_cond_broadcast(&exclusive_resume); IMHO it might be better to add a proper #ifdef guard around that function. Consider that the calls to end_exclusive() might get removed completely one day, then you won't get a compiler warning about the unused function anymore if you used the attribute__((unused)) way. Thomas