From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932294AbcIBOgD (ORCPT ); Fri, 2 Sep 2016 10:36:03 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38658 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753332AbcIBOgC (ORCPT ); Fri, 2 Sep 2016 10:36:02 -0400 Subject: Re: [PATCH 3/5] u64_stats: Introduce IRQs disabled helpers To: Frederic Weisbecker , LKML References: <1472824985-22947-1-git-send-email-fweisbec@gmail.com> <1472824985-22947-4-git-send-email-fweisbec@gmail.com> Cc: Peter Zijlstra , Wanpeng Li , Eric Dumazet , Ingo Molnar , Mike Galbraith , Rik van Riel From: Paolo Bonzini Message-ID: Date: Fri, 2 Sep 2016 16:35:54 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <1472824985-22947-4-git-send-email-fweisbec@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Fri, 02 Sep 2016 14:36:02 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/09/2016 16:03, Frederic Weisbecker wrote: > static inline unsigned int u64_stats_fetch_begin(const struct u64_stats_sync *syncp) > { > -#if BITS_PER_LONG==32 && defined(CONFIG_SMP) > - return read_seqcount_begin(&syncp->seq); > -#else > -#if BITS_PER_LONG==32 > +#if BITS_PER_LONG==32 && !defined(CONFIG_SMP) > preempt_disable(); > +#else This should be #endif, or this side ends without a "return" statement. > + return __u64_stats_fetch_begin(syncp); > #endif > - return 0; > +} ... > > static inline bool u64_stats_fetch_retry(const struct u64_stats_sync *syncp, > unsigned int start) > { > -#if BITS_PER_LONG==32 && defined(CONFIG_SMP) > - return read_seqcount_retry(&syncp->seq, start); > -#else > -#if BITS_PER_LONG==32 > +#if BITS_PER_LONG==32 && !defined(CONFIG_SMP) > preempt_enable(); > -#endif > - return false; > +#else Same here. > + return __u64_stats_fetch_retry(syncp, start); > #endif > } ... > > - return read_seqcount_begin(&syncp->seq); > -#else > -#if BITS_PER_LONG==32 > +#if BITS_PER_LONG==32 && !defined(CONFIG_SMP) > local_irq_disable(); > -#endif > - return 0; > +#else Same here. > + return __u64_stats_fetch_begin(syncp); > #endif > > -#if BITS_PER_LONG==32 && defined(CONFIG_SMP) > - return read_seqcount_retry(&syncp->seq, start); > -#else > -#if BITS_PER_LONG==32 > +#if BITS_PER_LONG==32 && !defined(CONFIG_SMP) > local_irq_enable(); > -#endif > - return false; > +#else Same here. > + return __u64_stats_fetch_retry(syncp, start); > #endif Thanks, Paolo