Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp2294800imw; Wed, 6 Jul 2022 03:34:10 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uBajGDByiX3xzn83Xf7GkLG5ECQOkFhMwm+b3eSid4qxGGqlQwDOA5fG04L9ujfG8XcfIL X-Received: by 2002:aa7:cd91:0:b0:438:33a1:d5aa with SMTP id x17-20020aa7cd91000000b0043833a1d5aamr47908376edv.157.1657103649880; Wed, 06 Jul 2022 03:34:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657103649; cv=none; d=google.com; s=arc-20160816; b=Nqw5hAGpn+EaJ1wBlgC00ezKGfJcNv/qIMvXQ162KoqYuTHwjUlXByb/94P2zMh8Me JMu6OT12pq9IzurjjB1yi2E9f2E1bld+aOX7wM5MArfNAxxIi3Ias6YmvrWgPdBmGNDa 4KL6MVaz7HHqqaO9fBiILP8OKV2mQJ6MyT7XuIXsxX+j3jnlkw0EgU8hy7TzEmj7cEFK 1HiMajpnMEJJjBd8KzfDDYbTYhNLs3t6KmSlblXip3y5GmAsFbSeTTnObp+8Og/WX47v g8rmhh8RIHlJDuQX07WUhuUgvUee7jIR4V9wN6sCrZSvaXAqhR3voDNXtf3IqxKVj4Ep +jnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=kx69JRXRHaP9bPHWeCJjLQ/KjVRjWJF5OqT3P9q0cBs=; b=OOZ9/f4D4T4AW+BJD5brMAD+mkxhfiNrZj9JoXa42CpLnZm5jCbFhwSWNsdFdKl/W6 Z2GThOYGw77t+ccD6j5gt/updNYQXfRTjUCQEYeJUIQETblzXL8Z0wj+GMSPpuaji1J9 AyxRhM302FcfXp2GFHayQrbn2OR2EH/66hn/To8LG4/LkKBy/562wz5vB9Jrva8criVO 9LA/barp6kbrPJuTx7A6fVOufuS3wkOHVLO2aiuDdse3R5KAGpPVT4rmDymqYa3laZtb vy0A82QqqY7GKTXbB6jmQu8X3lsJEj9/dyCLhmzFvRGhezXvx8opS68RsWCD+kNrwrfE AlhQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q27-20020a056402249b00b0043a1efc97adsi3258710eda.220.2022.07.06.03.33.45; Wed, 06 Jul 2022 03:34:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232816AbiGFKK1 (ORCPT + 99 others); Wed, 6 Jul 2022 06:10:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46468 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232532AbiGFKJu (ORCPT ); Wed, 6 Jul 2022 06:09:50 -0400 Received: from mail-qt1-f176.google.com (mail-qt1-f176.google.com [209.85.160.176]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ED099A467; Wed, 6 Jul 2022 03:09:46 -0700 (PDT) Received: by mail-qt1-f176.google.com with SMTP id c13so17480565qtq.10; Wed, 06 Jul 2022 03:09:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=kx69JRXRHaP9bPHWeCJjLQ/KjVRjWJF5OqT3P9q0cBs=; b=lAzdRd1By0sHsBk/HkiVBJYiSBscgl0i1ZLAsUpFAIe8qAFmd4kDffUF8y1jY0FzOQ vVQfqo0DLW7HANISepVttWLbihN1jcWLZBXtujKa69KSjCNBQbl+XqnRi2/a+OCql/Tc G8X6soaObeyIiRaLHtBaDSvM4cEzvyuPysp+OQZs4wHtBIWH/haIhn4mW1FvFW+t+ti0 qBHP0Vmz2rWXotho0cLXnoEcZVjtPVWLkVQDIOQaZYE5+Ub0Ua9c2gW8CKiGhkL+io3k qVkdq0txxNz1x/GETY20MSUDfZmIuHQf2qN1c1YuF5B4VJ9m9c4sskMn3wC6HuqqW6ET 4sEA== X-Gm-Message-State: AJIora+fQVLRC2JPBJguYfUYsik9hV+zeKmHAXEqN5WBunFzox/ZpMxo yPE6Majlkyis7OxP4gCWrdsz3ayypng1TNvl X-Received: by 2002:a05:622a:4cc:b0:31d:26a1:2538 with SMTP id q12-20020a05622a04cc00b0031d26a12538mr31085549qtx.498.1657102185760; Wed, 06 Jul 2022 03:09:45 -0700 (PDT) Received: from mail-yw1-f169.google.com (mail-yw1-f169.google.com. [209.85.128.169]) by smtp.gmail.com with ESMTPSA id d71-20020a379b4a000000b006a6a1e4aec2sm28819484qke.49.2022.07.06.03.09.44 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 06 Jul 2022 03:09:44 -0700 (PDT) Received: by mail-yw1-f169.google.com with SMTP id 00721157ae682-31c86fe1dddso87249647b3.1; Wed, 06 Jul 2022 03:09:44 -0700 (PDT) X-Received: by 2002:a81:5404:0:b0:31c:c24d:94b0 with SMTP id i4-20020a815404000000b0031cc24d94b0mr10209449ywb.502.1657102184115; Wed, 06 Jul 2022 03:09:44 -0700 (PDT) MIME-Version: 1.0 References: <20220624121313.2382500-1-alexandr.lobakin@intel.com> <20220624121313.2382500-4-alexandr.lobakin@intel.com> In-Reply-To: <20220624121313.2382500-4-alexandr.lobakin@intel.com> From: Geert Uytterhoeven Date: Wed, 6 Jul 2022 12:09:33 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v5 3/9] bitops: unify non-atomic bitops prototypes across architectures To: Alexander Lobakin Cc: Arnd Bergmann , Yury Norov , Andy Shevchenko , Mark Rutland , Matt Turner , Brian Cain , Yoshinori Sato , Rich Felker , "David S. Miller" , Kees Cook , "Peter Zijlstra (Intel)" , Marco Elver , Borislav Petkov , Tony Luck , Maciej Fijalkowski , Jesse Brandeburg , Greg Kroah-Hartman , Nathan Chancellor , Nick Desaulniers , Tom Rix , kernel test robot , alpha , "open list:QUALCOMM HEXAGON..." , "linux-ia64@vger.kernel.org" , linux-m68k , Linux-sh list , sparclinux , Linux-Arch , llvm@lists.linux.dev, Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 24, 2022 at 2:13 PM Alexander Lobakin wrote: > Currently, there is a mess with the prototypes of the non-atomic > bitops across the different architectures: > > ret bool, int, unsigned long > nr int, long, unsigned int, unsigned long > addr volatile unsigned long *, volatile void * > > Thankfully, it doesn't provoke any bugs, but can sometimes make > the compiler angry when it's not handy at all. > Adjust all the prototypes to the following standard: > > ret bool retval can be only 0 or 1 > nr unsigned long native; signed makes no sense > addr volatile unsigned long * bitmaps are arrays of ulongs > > Next, some architectures don't define 'arch_' versions as they don't > support instrumentation, others do. To make sure there is always the > same set of callables present and to ease any potential future > changes, make them all follow the rule: > * architecture-specific files define only 'arch_' versions; > * non-prefixed versions can be defined only in asm-generic files; > and place the non-prefixed definitions into a new file in > asm-generic to be included by non-instrumented architectures. > > Finally, add some static assertions in order to prevent people from > making a mess in this room again. > I also used the %__always_inline attribute consistently, so that > they always get resolved to the actual operations. > > Suggested-by: Andy Shevchenko > Signed-off-by: Alexander Lobakin > Acked-by: Mark Rutland > Reviewed-by: Yury Norov > Reviewed-by: Andy Shevchenko > arch/m68k/include/asm/bitops.h | 49 ++++++++++----- Reviewed-by: Geert Uytterhoeven Acked-by: Geert Uytterhoeven Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds