Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp1388334pxm; Thu, 24 Feb 2022 02:03:23 -0800 (PST) X-Google-Smtp-Source: ABdhPJzz3MrbHUkME8mABeUBE++WS1VLXXjCH9v9IVxaJBOB3sn0QI/mU++4lpvsCcmUZChFUi3c X-Received: by 2002:a17:906:8a5b:b0:6ce:2a05:813b with SMTP id gx27-20020a1709068a5b00b006ce2a05813bmr1633265ejc.589.1645697002400; Thu, 24 Feb 2022 02:03:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645697002; cv=none; d=google.com; s=arc-20160816; b=U042PJRNvYgSUCGf0WsiOMMrIA3jx0uh70KnP0OrOY+WLj61bs7xvogk/opMbT3ivZ 778nUWPeO+u99dJp8QB/nWK9oXqEJ3j7jTwhK4MEMqeoEjRJyUsHEKeTgS/oXYVQMC32 0cGN7nfqICOC/80JYO7mwz1uGBdx4cKiMGBjpBCz8ZDQVSrfGUHhzEyr8uhjPzTvPmZG stBM4djL34+txzrcSVCTMQFunNDl5+lVM+VpgH4MnGlSI7jpsRXDYdHpYhrWZy0ZkqOa zZStMjmOOeGgIKbn/VwkOraGh8xIRdxSjF/YGQGpB2KTieRDoe4xLygDWocRw6hmCKqh V8Xg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=sAADT88gI+pPszcIBMRqA1zCZ7wZekWzcMHe0oq8By8=; b=V3f5zW6rVSFXi3VgAnDXsaAh90kO2LzXpfBXlktZ8ag0tNKU5JXCY9UYniy+Q0RBHh MhOitL4nd6jRFR0+Ga0+Qbra6KQ1iw1BDb9yFHs4tCcJPAqtByneFBms6Ci6aLUJW0e+ 372/wANdxCyfJQbofTlfgclP7hMfd5U7mtqQwfO/e8QCaITSR7lrhDpGix3aVn1tYcFA ZtbZ0XSz3wkzNnGG50vGSUL/P8LOpI7frtZX5rbm5c1i1LwVqLn9PopTluUGal0DPvJM ciaj54erurSwKHuLKwfQp9aa9r0qbM2jzSZWL50jcNfUDtewjwiw3DIsCSuAdDQYAsPy tLNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=tPnxIqTl; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id jz26si1144076ejc.96.2022.02.24.02.02.56; Thu, 24 Feb 2022 02:03:22 -0800 (PST) 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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=tPnxIqTl; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231392AbiBXIzo (ORCPT + 99 others); Thu, 24 Feb 2022 03:55:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42554 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230119AbiBXIzg (ORCPT ); Thu, 24 Feb 2022 03:55:36 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2EE8C165C04; Thu, 24 Feb 2022 00:55:06 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id C061661AF3; Thu, 24 Feb 2022 08:55:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5572DC340F3; Thu, 24 Feb 2022 08:54:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1645692905; bh=D8NSeZOwHZfWKch1XSFYzS9F6hQ2BeqNwxH4vsfByPo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tPnxIqTlKWRmNIYm2BGpRG17Ke4i44+BoLew6kahoE4JbU/nDfSuZDRjaeqZTrw2c uYr93qgW1nv9O1NkuUQdFpRFaIn68a63AwvRNrp2rJw+tjQ80ED4GgpJcSJT29MTod YZBUbafAW0KvE/c04sjLJTcy7I34Kx41mFJOsHnPSJy9OjjKS/HhZhTyRwzOK9WDX0 kyP0vp50EtBZBJL6++OzXuxWgs+VMxMsmXGVk9SQwJsSOR4TUqDE30QF9amhzuyqlp zuPQLIpQLTz0UsVykQukjYiqsD760H9rlKer9IcAFZoKMNX//dL38Ce3sYPVy1hgAc SflOSDXAiO2aw== From: guoren@kernel.org To: guoren@kernel.org, palmer@dabbelt.com, arnd@arndb.de, anup@brainfault.org, gregkh@linuxfoundation.org, liush@allwinnertech.com, wefu@redhat.com, drew@beagleboard.org, wangjunqiang@iscas.ac.cn, hch@lst.de Cc: linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, linux-csky@vger.kernel.org, linux-s390@vger.kernel.org, sparclinux@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-parisc@vger.kernel.org, linux-mips@vger.kernel.org, linux-arm-kernel@lists.infradead.org, x86@kernel.org Subject: [PATCH V6 01/20] uapi: simplify __ARCH_FLOCK{,64}_PAD a little Date: Thu, 24 Feb 2022 16:53:51 +0800 Message-Id: <20220224085410.399351-2-guoren@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220224085410.399351-1-guoren@kernel.org> References: <20220224085410.399351-1-guoren@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 From: Christoph Hellwig Don't bother to define the symbols empty, just don't use them. That makes the intent a little more clear. Remove the unused HAVE_ARCH_STRUCT_FLOCK64 define and merge the 32-bit mips struct flock into the generic one. Add a new __ARCH_FLOCK_EXTRA_SYSID macro following the style of __ARCH_FLOCK_PAD to avoid having a separate definition just for one architecture. Signed-off-by: Christoph Hellwig Signed-off-by: Guo Ren Reviewed-by: Arnd Bergmann --- arch/mips/include/uapi/asm/fcntl.h | 26 +++----------------------- include/uapi/asm-generic/fcntl.h | 19 +++++++------------ tools/include/uapi/asm-generic/fcntl.h | 19 +++++++------------ 3 files changed, 17 insertions(+), 47 deletions(-) diff --git a/arch/mips/include/uapi/asm/fcntl.h b/arch/mips/include/uapi/asm/fcntl.h index 42e13dead543..9e44ac810db9 100644 --- a/arch/mips/include/uapi/asm/fcntl.h +++ b/arch/mips/include/uapi/asm/fcntl.h @@ -50,30 +50,10 @@ #define F_SETLKW64 35 #endif -/* - * The flavours of struct flock. "struct flock" is the ABI compliant - * variant. Finally struct flock64 is the LFS variant of struct flock. As - * a historic accident and inconsistence with the ABI definition it doesn't - * contain all the same fields as struct flock. - */ - #if _MIPS_SIM != _MIPS_SIM_ABI64 - -#include - -struct flock { - short l_type; - short l_whence; - __kernel_off_t l_start; - __kernel_off_t l_len; - long l_sysid; - __kernel_pid_t l_pid; - long pad[4]; -}; - -#define HAVE_ARCH_STRUCT_FLOCK - -#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */ +#define __ARCH_FLOCK_EXTRA_SYSID long l_sysid; +#define __ARCH_FLOCK_PAD long pad[4]; +#endif #include diff --git a/include/uapi/asm-generic/fcntl.h b/include/uapi/asm-generic/fcntl.h index ecd0f5bdfc1d..77aa9f2ff98d 100644 --- a/include/uapi/asm-generic/fcntl.h +++ b/include/uapi/asm-generic/fcntl.h @@ -192,25 +192,19 @@ struct f_owner_ex { #define F_LINUX_SPECIFIC_BASE 1024 -#ifndef HAVE_ARCH_STRUCT_FLOCK -#ifndef __ARCH_FLOCK_PAD -#define __ARCH_FLOCK_PAD -#endif - struct flock { short l_type; short l_whence; __kernel_off_t l_start; __kernel_off_t l_len; __kernel_pid_t l_pid; - __ARCH_FLOCK_PAD -}; +#ifdef __ARCH_FLOCK_EXTRA_SYSID + __ARCH_FLOCK_EXTRA_SYSID #endif - -#ifndef HAVE_ARCH_STRUCT_FLOCK64 -#ifndef __ARCH_FLOCK64_PAD -#define __ARCH_FLOCK64_PAD +#ifdef __ARCH_FLOCK_PAD + __ARCH_FLOCK_PAD #endif +}; struct flock64 { short l_type; @@ -218,8 +212,9 @@ struct flock64 { __kernel_loff_t l_start; __kernel_loff_t l_len; __kernel_pid_t l_pid; +#ifdef __ARCH_FLOCK64_PAD __ARCH_FLOCK64_PAD -}; #endif +}; #endif /* _ASM_GENERIC_FCNTL_H */ diff --git a/tools/include/uapi/asm-generic/fcntl.h b/tools/include/uapi/asm-generic/fcntl.h index ac190958c981..99bc9b15ce2b 100644 --- a/tools/include/uapi/asm-generic/fcntl.h +++ b/tools/include/uapi/asm-generic/fcntl.h @@ -187,25 +187,19 @@ struct f_owner_ex { #define F_LINUX_SPECIFIC_BASE 1024 -#ifndef HAVE_ARCH_STRUCT_FLOCK -#ifndef __ARCH_FLOCK_PAD -#define __ARCH_FLOCK_PAD -#endif - struct flock { short l_type; short l_whence; __kernel_off_t l_start; __kernel_off_t l_len; __kernel_pid_t l_pid; - __ARCH_FLOCK_PAD -}; +#ifdef __ARCH_FLOCK_EXTRA_SYSID + __ARCH_FLOCK_EXTRA_SYSID #endif - -#ifndef HAVE_ARCH_STRUCT_FLOCK64 -#ifndef __ARCH_FLOCK64_PAD -#define __ARCH_FLOCK64_PAD +#ifdef __ARCH_FLOCK_PAD + __ARCH_FLOCK_PAD #endif +}; struct flock64 { short l_type; @@ -213,8 +207,9 @@ struct flock64 { __kernel_loff_t l_start; __kernel_loff_t l_len; __kernel_pid_t l_pid; +#ifdef __ARCH_FLOCK64_PAD __ARCH_FLOCK64_PAD -}; #endif +}; #endif /* _ASM_GENERIC_FCNTL_H */ -- 2.25.1