From patchwork Sat Feb 24 17:42:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Ravnborg via B4 Relay X-Patchwork-Id: 205911 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp1252866dyb; Sat, 24 Feb 2024 09:43:26 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXYfOjGbkfNBzxKZidFMiDkhj06xaaah1dPi2g41SJRhoCh4TqZ/S+w+0mYJX/g/rA3M4XocMNiDDt9UX1uh2J3Tx5nlw== X-Google-Smtp-Source: AGHT+IEFFDMHPXVXi8FnKs3lKRqU/jqZZbt6dvtbp+nKdxrTIyvnjZGpjUgng0O+O/wU/B3KX6kP X-Received: by 2002:a05:6808:1996:b0:3c1:34f8:718e with SMTP id bj22-20020a056808199600b003c134f8718emr4062328oib.44.1708796606381; Sat, 24 Feb 2024 09:43:26 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708796606; cv=pass; d=google.com; s=arc-20160816; b=oQdB9cEprNm+rfCUZcsS0Uu3eFPzGHzeggywhnHDQcCBjpfYHBafrFpSzBxQ7h+AeU pyipEdRO+J5l8Thlz8rvCWG3OEdBR2hVubJZBMFazFdhzxe4IXkzbUYp2OwS/ih8LVSh O4hzlKNWAbBA0CRY04q6glOSAlXl2HisvGPma56ZbVdWf0k7v6eTsdcpLE7ksN9N0lA0 TfqIDABLQ5YrU3ZjLy3XKYI5efkSV+m89m2bDTwlfMHHOjisu09hM1s5vQri3x8gPVqe xqniOOruIL1PTtdlo/cEtJyMvYcZ79/G+XINsyIKqq3YAxDY/jz26AtYNB0W7IPmKB+R uWZQ== 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=as1vhJnTJ+EuPoSBCrbF/MlzfpRRk/+1GsLtSk5qlmk=; fh=axaiTczyEibQIAZR7tL5HdXpt5eDXppl7AUtI52L8OM=; b=wr7VN7AUOlIau6HJEQrF9Eq1cp6/PiEf46gicDGF5qwyT1UNah4t7uDO2SS783DC7l bmD64Z5BnBcc2pVZsgbqG63TGrNtoSXOTpEm1BFP6npVfQVQecC63comt6CnwjwukFOl Rfu/hIeLFnxVVi052DqnPQl/UkrhYfklPtfuaWPk1YFssNTgs3vHf+oQTiFvZzwOzWPz jOeXIZBtt4ZptR/q3lzB9V4GAu0yOqmYcJYC6ugk5MlS7KK2sm3bNSyWems+E5hlGIQG +c+rOg56/vddkhQnJrWiLxZOEPeu0pcNhDpJBTBSKgN8GsvHKx39O9lm+7WQNkRTU5f8 tSXw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=vKBq28rD; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-79764-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-79764-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id kd28-20020a056214401c00b0068d1501ebb9si1503420qvb.458.2024.02.24.09.43.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Feb 2024 09:43:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-79764-ouuuleilei=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=vKBq28rD; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-79764-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-79764-ouuuleilei=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 0FDE51C20C6B for ; Sat, 24 Feb 2024 17:43:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5A9DD4D9E5; Sat, 24 Feb 2024 17:42:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="vKBq28rD" 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 4138947A7D; Sat, 24 Feb 2024 17:42:27 +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=1708796547; cv=none; b=ECNXw0Xg8jCdFP4PihgyZ+++rr9ILKEoYfBCP7TTSL7i+EjDniheWvLSMtcLT2DIM+vaFTmS7LzA68HuPwR/ch3arub1SxiwcRX1k5fRbmYLy0mHSYP5uoPaMBJ71vaUyC0xjdnx4R6/rAEkAM/hbSTmv8PNQeFe3QAphU2WZzw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708796547; c=relaxed/simple; bh=KhibXx79KhV4Nn5Ac7moITyyyPysThl4fpScNz8Pr/M=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=DrhjAhYgfKOrGLdFmES+fQLvewQOoBLVuWZ0SngqYeTQUhZnAeF6g0PPnq1G0vgl7nESlqJ4ZgmDKX65Mm0IU5FEfsw09mj1arYmXEdogX20/zdojpjsRyw0xgpAL1y4ILUkwOLHqJ4xCos7jf3fEw0gbMbeZ5n8qxzJ0ngYl5o= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=vKBq28rD; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPS id E5B20C433C7; Sat, 24 Feb 2024 17:42:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708796546; bh=KhibXx79KhV4Nn5Ac7moITyyyPysThl4fpScNz8Pr/M=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=vKBq28rDLYBxWS+6wdcz3Ro6DeCqynaZXnZgYW9pifNgbUAldTOOJrElePN7r/583 5FjNG14v+PULmhB4HC4olHOxqM2yPmyBCobKXtVzMncaO6/478HUdvYQERDZePjTWJ Slc9drLkTWSGDothmavQWfJWNB7SUj5nvcFolS6Oow9CO7x86/gauxxCboux+16PIx LNd4uHOIKT0d0iz68VuihNCSTjRuDcAqGQMzzKTio1/r3OI5BtavbGMU7pnXVvy62A NZZeqb2sGXkZ3Phr9D5WCXjpNtKUnrDr0A3RuiDnAw7G4SH0lAxsWxq66MmS00iO7k bdaLavbDEZ5rw== 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 D4CF1C48BF6; Sat, 24 Feb 2024 17:42:26 +0000 (UTC) From: Sam Ravnborg via B4 Relay Date: Sat, 24 Feb 2024 18:42:22 +0100 Subject: [PATCH v2 1/7] 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 Message-Id: <20240224-sam-fix-sparc32-all-builds-v2-1-1f186603c5c4@ravnborg.org> References: <20240224-sam-fix-sparc32-all-builds-v2-0-1f186603c5c4@ravnborg.org> In-Reply-To: <20240224-sam-fix-sparc32-all-builds-v2-0-1f186603c5c4@ravnborg.org> To: "Maciej W. Rozycki" , sparclinux@vger.kernel.org, Andreas Larsson , Randy Dunlap Cc: Miquel Raynal , linux-parport@lists.infradead.org, "David S. Miller" , Arnd Bergmann , linux-kernel@vger.kernel.org, Sam Ravnborg X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=ed25519-sha256; t=1708796545; l=3720; i=sam@ravnborg.org; s=20230107; h=from:subject:message-id; bh=J7PFWlRTGPOE40ffjTuq4qFkXa+HB/VYE+coSnVem7c=; =?utf-8?q?b=3DvbgHBac6mbEY?= =?utf-8?q?rKMqmpY/6A/xQZQwbFq2qJIc/DAzPT9BwFc2LOH7g4a6bo2kBYCR6oflCdIeHFdn?= r3Zmm3YPC8JijWXAcCsTfvRh+UV4vm59dTk7YY+6QFT67fdRb6ej 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: X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791803109954958060 X-GMAIL-MSGID: 1791803109954958060 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 Fixes: 0fcb70851fbf ("Makefile.extrawarn: turn on missing-prototypes globally") Reviewed-by: Randy Dunlap Tested-by: Randy Dunlap # build-tested Reviewed-by: Maciej W. Rozycki Tested-by: Maciej W. Rozycki # build-tested 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);