Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp58006rbb; Fri, 23 Feb 2024 11:37:24 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVzqY8Na9Uf0RJ9sbZfx0ztQHFTBEm1CFppGjXw5zypr5BG52zB3sdpGzeIxSjVU0oJZ2CF2d5ZsbwQoc+jEzIL1kYeBUOcvBJ3BhFEVw== X-Google-Smtp-Source: AGHT+IFP9zO0zyYwA08Gb5WWc92mKnm2wJkEbxiPRPNsreTXAuS2xP8ZoezFLGOL23fD+a6qwnjt X-Received: by 2002:ac8:7c41:0:b0:42e:6d4b:f26f with SMTP id o1-20020ac87c41000000b0042e6d4bf26fmr129180qtv.53.1708717044424; Fri, 23 Feb 2024 11:37:24 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708717044; cv=pass; d=google.com; s=arc-20160816; b=pjqhri2YL+IpMd2Uz//VfUoPpzdMHLukMHi41+T2P+qkxDU3ekqgn0H+3vbOImgeoZ UO8GV+au2cJcBujLhjBv8tYPLDuHr6DqIKjXDhf2G4exE+SSbS9mTJ+DWa+Ak4RVi06m Xa+HDQzVz6Q0aRYKdPCeWvfBZGEiD+2I6d/gSnroXNKNlJmCr8bqmEUlyYTeRzJIbdNv wNqqmh9pH92kUYxs9lw9lYOTjSPr/cGpV7yDiw4PamoC3Wo1aZ1LZA2Yv+XiNqLdULpf G9deJJRCcx+TdBhNzeU98rR0vxNMzPEzXcl3SGfUOfgqkI0Emr22LW3GUUhVzgU2qZSv B6rg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=reply-to:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:subject:date:from:dkim-signature; bh=NAb6fy9qFmKZNv0ceM0ydA/nVXBH5BJh5KrbvQNL/Cw=; fh=CL4VwMdqDkOjIVq5vfpiK/zgFazi/Qclr+95A1i2dPU=; b=FOzlr9jrNh53l9rFigPGFQqUCMwzupr6sgmeuj/oYJz87MIXQmWRMr0iiVztZhY73w aloCZzoVJhM2PyD3mF4ZRFvNvJKY5gpg6RTv9NBLb6XylU0OKLoYnE3biMRI0MKVTO2F wcxNZOKfyPb2RqvjM/SuxUhQCulbVu822srCRExVOP7dcPGYLypBfZYXbAvKQWcY5gCX DU+pf3conXVFRTHnyldnn+JulfAaloR6LAPPujXImNhE8YOCN268JDMiHghlAZRBcxG/ ngGfmcPxCcMiRxtg10NMlFswptpqEk6JVCBkOxY75Or511ei1HrFQBVqPNsSoQOcfdp9 TaXA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=VSsEw+jr; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-79032-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-79032-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id z21-20020ac84555000000b0042dbe70836dsi14765151qtn.489.2024.02.23.11.37.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Feb 2024 11:37:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-79032-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=VSsEw+jr; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-79032-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-79032-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 2CB241C21F53 for ; Fri, 23 Feb 2024 19:37:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E1654146005; Fri, 23 Feb 2024 19:37:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="VSsEw+jr" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F22B71420B7; Fri, 23 Feb 2024 19:37:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708717025; cv=none; b=oSHNmq9jvd8QxPobC1T6h/bYrKvbQR9rSnsYf0Yzyje9F8mhuqEv3yRKU5GxbVdoVKQhDwkzATYzGjxbYL/UmfEWWekI4AMaMKNCrWIXDmr6smBeYSYfRXKk0LrQSCHfcvMm+t1xpT3RMtNsHZAAj5hqBUiOjxcRHiPkU0aexA8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708717025; c=relaxed/simple; bh=Y3ySrz1oDy2VdIWP8KqhKgzBK85YCNmxVjOAZb69QGc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=TI1zR55euTlkFo8igFXo9ndTGItIZezNFGQHs6niFhSRr4Z1gvD32ntyoXtmirPhJnWVOf5bpgIO64qosiFfWr0WBD10s7K0BIw2RJUzsDlhRPZbioivH/BwKYQmtCog4D2OoITlB/QSxw6458cCsIGywZ73ctY17EYFLQMtIWU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=VSsEw+jr; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPS id A7DCCC433C7; Fri, 23 Feb 2024 19:37:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708717024; bh=Y3ySrz1oDy2VdIWP8KqhKgzBK85YCNmxVjOAZb69QGc=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=VSsEw+jrZDzhkgMEgV4+Gcw+7KVsCDNEEs5P/s4HAxxTLlfStp2dMMzF/BPKpUAJx T/y7YvdsGkPPc24f4WYTDeCkhr2nTTqfvAlXNEu1XHUEPpvly5EyN+sN//UPv6P/h5 moSUCzwrbkKhT1wjbScM7tZm/4UkT4hzXEuavhLmxFP2fd6VGKjh8GA98b3YfqSXKC ZgbHObR1Hq6ozJzRwifjPNf4CXcBAXJGvurwpzCmKnN94HquXGzs1xk3W5NUxdeS59 rSjWSpfqKID5LGZc2Ky7CuTKWHjzPFDohYsXeF6LP/djX8P6ZuCwx+M1nc9ZJst4P0 SGCYhCUeOzlyw== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8A932C54E49; Fri, 23 Feb 2024 19:37:04 +0000 (UTC) From: Sam Ravnborg via B4 Relay Date: Fri, 23 Feb 2024 20:36:47 +0100 Subject: [PATCH 1/6] sparc32: Use generic cmpdi2/ucmpdi2 variants Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240223-sam-fix-sparc32-all-builds-v1-1-5c60fd5c9250@ravnborg.org> References: <20240223-sam-fix-sparc32-all-builds-v1-0-5c60fd5c9250@ravnborg.org> In-Reply-To: <20240223-sam-fix-sparc32-all-builds-v1-0-5c60fd5c9250@ravnborg.org> To: Miquel Raynal , "Maciej W. Rozycki" Cc: sparclinux@vger.kernel.org, linux-parport@lists.infradead.org, "David S. Miller" , Andreas Larsson , Randy Dunlap , Arnd Bergmann , linux-kernel@vger.kernel.org, Sam Ravnborg X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=ed25519-sha256; t=1708717023; l=3407; i=sam@ravnborg.org; s=20230107; h=from:subject:message-id; bh=29TdsRP/R2LmI+LIbEQqDi2Bdx01Dq7gEBtiS6nu5bo=; =?utf-8?q?b=3DEZRSjOFa3fv5?= =?utf-8?q?8gfK6zprK0eC07yJzc8FhmSdLTMB2lUFaZrffJQk4aajMyG/Syy5Fsvf8tIGe0Dj?= ZlaRS+PXAJ24fFkMWQugmp4S2FzISQY22UdAByym++h54YDBEtT4 X-Developer-Key: i=sam@ravnborg.org; a=ed25519; pk=R0+pqV7BRYOAeOIGkyOrSNke7arx5y3LkEuNi37YEyU= X-Endpoint-Received: by B4 Relay for sam@ravnborg.org/20230107 with auth_id=22 X-Original-From: Sam Ravnborg Reply-To: From: Sam Ravnborg Use the generic variants - the implementation is the same. As a nice side-effect fix the following warnings: cmpdi2.c: warning: no previous prototype for '__cmpdi2' [-Wmissing-prototypes] ucmpdi2.c: warning: no previous prototype for '__ucmpdi2' [-Wmissing-prototypes] Signed-off-by: Sam Ravnborg Cc: "David S. Miller" Cc: Andreas Larsson --- arch/sparc/Kconfig | 2 ++ arch/sparc/lib/Makefile | 4 ++-- arch/sparc/lib/cmpdi2.c | 28 ---------------------------- arch/sparc/lib/ucmpdi2.c | 20 -------------------- 4 files changed, 4 insertions(+), 50 deletions(-) diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig index b087d4fe00af..734f23daecca 100644 --- a/arch/sparc/Kconfig +++ b/arch/sparc/Kconfig @@ -57,6 +57,8 @@ config SPARC32 select CLZ_TAB select DMA_DIRECT_REMAP select GENERIC_ATOMIC64 + select GENERIC_LIB_CMPDI2 + select GENERIC_LIB_UCMPDI2 select HAVE_UID16 select LOCK_MM_AND_FIND_VMA select OLD_SIGACTION diff --git a/arch/sparc/lib/Makefile b/arch/sparc/lib/Makefile index 59669ebddd4e..ee5091dd67ed 100644 --- a/arch/sparc/lib/Makefile +++ b/arch/sparc/lib/Makefile @@ -14,7 +14,7 @@ lib-$(CONFIG_SPARC32) += divdi3.o udivdi3.o lib-$(CONFIG_SPARC32) += copy_user.o locks.o lib-$(CONFIG_SPARC64) += atomic_64.o lib-$(CONFIG_SPARC32) += lshrdi3.o ashldi3.o -lib-$(CONFIG_SPARC32) += muldi3.o bitext.o cmpdi2.o +lib-$(CONFIG_SPARC32) += muldi3.o bitext.o lib-$(CONFIG_SPARC64) += multi3.o lib-$(CONFIG_SPARC64) += fls.o lib-$(CONFIG_SPARC64) += fls64.o @@ -51,5 +51,5 @@ lib-$(CONFIG_SPARC64) += copy_in_user.o memmove.o lib-$(CONFIG_SPARC64) += mcount.o ipcsum.o xor.o hweight.o ffs.o obj-$(CONFIG_SPARC64) += iomap.o -obj-$(CONFIG_SPARC32) += atomic32.o ucmpdi2.o +obj-$(CONFIG_SPARC32) += atomic32.o obj-$(CONFIG_SPARC64) += PeeCeeI.o diff --git a/arch/sparc/lib/cmpdi2.c b/arch/sparc/lib/cmpdi2.c deleted file mode 100644 index 333367fe7353..000000000000 --- a/arch/sparc/lib/cmpdi2.c +++ /dev/null @@ -1,28 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -#include - -#include "libgcc.h" - -word_type __cmpdi2(long long a, long long b) -{ - const DWunion au = { - .ll = a - }; - const DWunion bu = { - .ll = b - }; - - if (au.s.high < bu.s.high) - return 0; - else if (au.s.high > bu.s.high) - return 2; - - if ((unsigned int) au.s.low < (unsigned int) bu.s.low) - return 0; - else if ((unsigned int) au.s.low > (unsigned int) bu.s.low) - return 2; - - return 1; -} - -EXPORT_SYMBOL(__cmpdi2); diff --git a/arch/sparc/lib/ucmpdi2.c b/arch/sparc/lib/ucmpdi2.c deleted file mode 100644 index 82c1cccb1264..000000000000 --- a/arch/sparc/lib/ucmpdi2.c +++ /dev/null @@ -1,20 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -#include -#include "libgcc.h" - -word_type __ucmpdi2(unsigned long long a, unsigned long long b) -{ - const DWunion au = {.ll = a}; - const DWunion bu = {.ll = b}; - - if ((unsigned int) au.s.high < (unsigned int) bu.s.high) - return 0; - else if ((unsigned int) au.s.high > (unsigned int) bu.s.high) - return 2; - if ((unsigned int) au.s.low < (unsigned int) bu.s.low) - return 0; - else if ((unsigned int) au.s.low > (unsigned int) bu.s.low) - return 2; - return 1; -} -EXPORT_SYMBOL(__ucmpdi2); -- 2.34.1