Received: by 2002:a05:6a10:6006:0:0:0:0 with SMTP id w6csp1032523pxa; Fri, 28 Aug 2020 01:31:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxCO1LqE4e2lWOyxKkAxpPq6rtlMuzinZctqx7czxWgvqfBMreut/QJRuSnPhZajp5sc3v+ X-Received: by 2002:a50:bf01:: with SMTP id f1mr700872edk.369.1598603497210; Fri, 28 Aug 2020 01:31:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598603497; cv=none; d=google.com; s=arc-20160816; b=mA92cE419nCy7WptWJ2HiwIHI06Mq1336AfEG32c7l151780QoPB7HmOU0McPr5Uxm 9QAXs00/Ry7j5ByxYoGIsXz+WhFkHOmsI19H00RcolH0aW3qd7WhvjBaqQyk7EXKukOe AI/R+wjA3xv2ITW7DBmNU1+BVb/Bl7ytxlFsG/EnVGHb65MoUbs2Tre57yqgw9e5AjJH WSnjkzCLlVVmqXbjM63wjFlAuukCndRhGFKjI7eNXfCYCpOZZhR4Zbki0Sbg03m3B0dK yYQpag4pJDGqzTRzuY6D5TJNYRWMuFKEl8J389LZu3sGNGXrQ09s3udMGCONiexV0br+ rbBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=zDJCSRQqxmuBzOdim0ZpsVxleqNgwLrnL8/KvPnBAls=; b=U374HWJIkXlmDO+WxhFaf74mxP3QXmX9fSnPZgrPRxqnWQ8Fu+MpgLAuxZhMselgm9 xOf8ZPBQn4fLncejFBajCEwpREJogGP7tzIa63Q9D2cQLWob6CFPOe/SKi6hDCMgqgcN 0pbGk5VK5EGFNwPpZ1LM7QJcDskpndTV+5Qojs5UDjSOvfGMgvaRzLOnDD7+5DchIv5F OORlGwoOJ8B3ksGA6EGhIp07IxB8o5xDbl3/0GFI9cYTnd5mlHdXQKPWHuwchZMnylhd ctAPesIMmi5zP8dymoLm3Bttn17Ys3Au6CQ+/RSYOIJEaEDHTUSVLHl4AjScJjRv8Rg0 4NWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=dOOiQwAc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p24si193235ejf.495.2020.08.28.01.31.13; Fri, 28 Aug 2020 01:31:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=dOOiQwAc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728788AbgH1I23 (ORCPT + 99 others); Fri, 28 Aug 2020 04:28:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56086 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728759AbgH1I2D (ORCPT ); Fri, 28 Aug 2020 04:28:03 -0400 Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B084EC061264 for ; Fri, 28 Aug 2020 01:28:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=zDJCSRQqxmuBzOdim0ZpsVxleqNgwLrnL8/KvPnBAls=; b=dOOiQwAcq3nJ3bgpPCwenUa8f1 YpLTHHYkj1LeEyI4SnmRJD6I4ujdK6hL0IDc/HKiP5Y8RfHhlVpiJ3urGYbc8qVx+ExCJTfGmAOrh akplHkQb6bgwHIbNLkVs9/XR24D1pSHHIBLQt0yPdtoBLsT2pXvG6fM4YiJap2QjZubrrS0Dx7YL0 dQ+4xFOtoH0Inkj/ZFqnNRB6k68vPA3PCGs2rH7fHSCBGYBJi+uKNKFzqxbQn5HyLYaAf3gOXSsJc G9avJRKDplvU1MZKVgAq0R3vEMhmxbnwcrKtCJXJWslLZ9tXz/MSA4s1TfuDU24shiXaqGeRFzLOP XSokx2oA==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1kBZjo-0003QP-Ac; Fri, 28 Aug 2020 08:27:56 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 8F22D30015A; Fri, 28 Aug 2020 10:27:54 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 40F022C5F134A; Fri, 28 Aug 2020 10:27:54 +0200 (CEST) Date: Fri, 28 Aug 2020 10:27:54 +0200 From: peterz@infradead.org To: "Ahmed S. Darwish" Cc: Ingo Molnar , Will Deacon , Thomas Gleixner , "Sebastian A. Siewior" , "Paul E. McKenney" , Steven Rostedt , LKML Subject: Re: [PATCH v1 2/5] seqlock: Use unique prefix for seqcount_t property accessors Message-ID: <20200828082754.GN1362448@hirez.programming.kicks-ass.net> References: <20200519214547.352050-1-a.darwish@linutronix.de> <20200828010710.5407-1-a.darwish@linutronix.de> <20200828010710.5407-3-a.darwish@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200828010710.5407-3-a.darwish@linutronix.de> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 28, 2020 at 03:07:07AM +0200, Ahmed S. Darwish wrote: > Differentiate the first group by using "__seqcount_t_" as prefix. This > also conforms with the rest of seqlock.h naming conventions. > #define __seqprop_case(s, locktype, prop) \ > seqcount_##locktype##_t: __seqcount_##locktype##_##prop((void *)(s)) > > #define __seqprop(s, prop) _Generic(*(s), \ > - seqcount_t: __seqcount_##prop((void *)(s)), \ > + seqcount_t: __seqcount_t_##prop((void *)(s)), \ > __seqprop_case((s), raw_spinlock, prop), \ > __seqprop_case((s), spinlock, prop), \ > __seqprop_case((s), rwlock, prop), \ If instead you do: #define __seqprop_case(s, _lockname, prop) \ seqcount##_lockname##_t: __seqcount##_lockname##_##prop((void *)(s)) You can have: __seqprop_case((s), , prop), __seqprop_case((s), _raw_spinlock, prop), __seqprop_case((s), _spinlock, prop), __seqprop_case((s), _rwlock, prop), __seqprop_case((s), _mutex, prop), __seqprop_case((s), _ww_mutex, prop), And it's all good again. Although arguably we should do something like s/__seqcount/__seqprop/ over this lot.