Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp2038093pxm; Sun, 27 Feb 2022 09:31:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJzFFsZLrn0pS9bKtpac+RC3S1Akaf16m5CkjnIIfo3mMKNhtYG1B9cmGndG+mlggQ8oGdol X-Received: by 2002:aa7:874b:0:b0:4df:808f:2a1d with SMTP id g11-20020aa7874b000000b004df808f2a1dmr17653636pfo.68.1645983088042; Sun, 27 Feb 2022 09:31:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645983088; cv=none; d=google.com; s=arc-20160816; b=S2PfbgxGUFpdP/npPM47eB3p3Z2/vNAHuJ5O6dziI+ECLcWSlZGGYOyfG++8zyB7RR 2bSIFYyhsVUzVcj+ib4z55mHaI+aNBVQPtDLM17eaFDIyoEkdjtzEHXxE56qFM4RLMMp Gs/du99GOzmCy7fq6UK+wDasc4hamMT+kC85vzKCOcW/NB5k6Ag5cDj8eMdEmA0MYYCm dN5Gv03RiQZEabFPXMMsvlqqGXwPgeZDhvZ42LQOfYMdJn795SYvoRWy3dyGDXC/Ssir upwmjD867+6vObbqDO0qcbUvSiQspdMTCxcRrU/qEUJ1G4GCTuoRJcpSZEslcFy3nRlZ 2tzg== 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=yUIvZInQcbac+SiWi18mwj7EeO4z/g9KUf96hGdTAxNZ9FVIfCebwcy2hx2BRbOT5V FGV6nJTBndTAXGr+8/aFP57a/FefhVMgCPUGJnE8z+W3lx417ZMRXbkc3uN2Lv7kW1a/ QkxZlNX63LhncH1SY4ejyqZ846pxAKCUAdciblpxAtOEu+uhgZPRBozdrwENnm0zJvH3 II8jHHWe9HV2UmMC9I8yvo9nFPQf86oMO+EEbfQdnEacGE2by9aj5/sFNMbsYJs9UgkQ 26a0jfyaCqXkUU7g7k5MFiXhcoXuRTGyHm5SeavLJBHG6tHOBVPZxn7v/FZ7uQ4fTRDP P9+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=sixCoUWt; 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 b84-20020a621b57000000b004e12043af1esi6400893pfb.62.2022.02.27.09.31.10; Sun, 27 Feb 2022 09:31:28 -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=sixCoUWt; 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 S231620AbiB0Q3u (ORCPT + 99 others); Sun, 27 Feb 2022 11:29:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53254 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231237AbiB0Q3p (ORCPT ); Sun, 27 Feb 2022 11:29:45 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AE27F38D8A; Sun, 27 Feb 2022 08:29:07 -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 ams.source.kernel.org (Postfix) with ESMTPS id 64166B80CE6; Sun, 27 Feb 2022 16:29:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 17CC5C340F4; Sun, 27 Feb 2022 16:28:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1645979344; bh=D8NSeZOwHZfWKch1XSFYzS9F6hQ2BeqNwxH4vsfByPo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sixCoUWtnvv6Vlkkb7JF8FoXIcI8RJ9DNstlN9KCn7S1kvswAtNNcEP+yLht3SQve 3JVaGxKHMU1+BkaXNUV4Hn/s09U6q5/Ea0RAjPo55kCGRqoHpFbb5YQ0bxPYLBsuIN TsDaBUXKRL+Z4QmCldP4zg3Fh1/CMXuusx2BYmFvJZQjMDK3lkgFenBap6IFYvvpW7 uWRZA9w1+HxSAMVPCKv+iuQRjiowbV4zTEfMvreXUwf3k5hPbkz8R6oRgFYnITZaCR OpsZxHLFOzzW2G0dNlv0UXI77yS2td+BHPhmjWlAQSdSWBzNzzSnYofSLJueOIZFAV Kc2yF3nGL5yDw== 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 V7 01/20] uapi: simplify __ARCH_FLOCK{,64}_PAD a little Date: Mon, 28 Feb 2022 00:28:12 +0800 Message-Id: <20220227162831.674483-2-guoren@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220227162831.674483-1-guoren@kernel.org> References: <20220227162831.674483-1-guoren@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.5 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