Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp2130979lqt; Mon, 22 Apr 2024 02:15:42 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVp+b80a9w3oMCu0WCekWpiG1fvbj+34Yhi6095mi+IfFn2UMS37bFgUQ7IVGAQv0XU2cppJOUEnvfAuonCsosvFEQbUA4ML8QlK/mIdQ== X-Google-Smtp-Source: AGHT+IG1rkJ/eZzb7RDYTA4/ny6D2YXn1frQhfIOkyWTkwHcEtoxWcGf0eM1L+xG6aSLJYmuunh+ X-Received: by 2002:a17:90b:3d0:b0:2ac:eb19:280f with SMTP id go16-20020a17090b03d000b002aceb19280fmr5044777pjb.35.1713777342604; Mon, 22 Apr 2024 02:15:42 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713777342; cv=pass; d=google.com; s=arc-20160816; b=PtceoafVZowv/Q0SnrwZd9JPJS7HZ0Wxo9h2bZfvi8BAFDWhs/ZL6EEmmAddcArTdJ lpYzIZagvOoJmB9WK5Jg+PUeV9jav8UCSe4X8uRsuxJyjErJimGF5mKMUkG/IEPgUjpA mQWSWM1syM+6iZzvvHfuv9gZrKYhhIyFkvJlg5wjgiDD9r/SOgCiAJoBUZ5M8CSZl8xO 5J/ar/g2S2w1/sXua0dNHuWPME+397ekWG2EWHbVDTZP4GVTtjl0xZ/J8YbQRUEcpqbN iat0WGYo9YDX5qry8KvIDDOTsdioKl3hDkC5Ohcx/dWQ9FwNvvh9y07d0BpgKIyEkx2k PiNQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:dkim-signature; bh=b/wu88jA9YdxZN0vncf57S6bbFuU12MW/xuCRw6CPIc=; fh=yxUJWbb1ozJ72pxSQppG7O2m00xHuwNtngK152u4rSo=; b=uK/l4pZrm66kLq8YmJcT6ZBJWv990f8I+659S9ifSPWrpoyWuoMoIULbIhNOlpo2WC ZeDIKiw9MANPrJopUV2rvwVRjHt5dWLjXmjG5TdkLYug3JsaR8Jo3b894OeTYs0Klx3Y BDC9nnyLLGde+9kfESEQ1HYchDlZd0OJ5l0k+4jdbQPyMlRuTuLQqY68rJm8L/GDTXyL rYm5AS11P45HcRcCjJw39l9HWQZQ6Y0wffiB0R/hOsFbc1CU993a+gxpCMh+varjwvv6 PBf2RbNU0lik4f/1xe7m2u8xIVlbAwcVfR4PQxxduY8RZBJ4Ph1XZIU31lbzF3m8MRlJ jt5A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@toblux-com.20230601.gappssmtp.com header.s=20230601 header.b=RDqBOJtW; arc=pass (i=1 dkim=pass dkdomain=toblux-com.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-153073-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-153073-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id n19-20020a17090ade9300b002a234558ec3si4727547pjv.152.2024.04.22.02.15.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Apr 2024 02:15:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-153073-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@toblux-com.20230601.gappssmtp.com header.s=20230601 header.b=RDqBOJtW; arc=pass (i=1 dkim=pass dkdomain=toblux-com.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-153073-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-153073-linux.lists.archive=gmail.com@vger.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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 3FB7A281018 for ; Mon, 22 Apr 2024 09:15:42 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6FB5153816; Mon, 22 Apr 2024 09:15:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=toblux-com.20230601.gappssmtp.com header.i=@toblux-com.20230601.gappssmtp.com header.b="RDqBOJtW" Received: from mail-ed1-f42.google.com (mail-ed1-f42.google.com [209.85.208.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3C4BC4C66 for ; Mon, 22 Apr 2024 09:15:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.42 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713777333; cv=none; b=d8V1ElPK2AyyNFp6mTGwlpcheljsvyOhHlSkL97oyE2qHY4t5YCArQcXyLIOF6oUpSZpOM2zjS4BOY46akR6JXyy67QEQI4FisxBfh2ubFVGcbMCBEReMp6V/o2tTwJgphv32xEmfLLNMFUjqKbWw9EnCEHgDVkRc9eYmuBXVLo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713777333; c=relaxed/simple; bh=b/wu88jA9YdxZN0vncf57S6bbFuU12MW/xuCRw6CPIc=; h=Content-Type:Mime-Version:Subject:From:In-Reply-To:Date:Cc: Message-Id:References:To; b=BF9CrdF8KJTESys/qwIacht9GBGadeL2h8VY0PANT2/atldIviMRPhdKuAaVbxdvv838looIa2/0jWK1yJyMtpNxj746j0HjnUhylboPK8mgIarxPAned6X73ZLJ+GhYS8FNsVNLZ8kJTCVYr1t5JRaBY7Sj28rTwiw7yBz7gBg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=toblux.com; spf=none smtp.mailfrom=toblux.com; dkim=pass (2048-bit key) header.d=toblux-com.20230601.gappssmtp.com header.i=@toblux-com.20230601.gappssmtp.com header.b=RDqBOJtW; arc=none smtp.client-ip=209.85.208.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=toblux.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=toblux.com Received: by mail-ed1-f42.google.com with SMTP id 4fb4d7f45d1cf-571e3f40e31so1548775a12.2 for ; Mon, 22 Apr 2024 02:15:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=toblux-com.20230601.gappssmtp.com; s=20230601; t=1713777330; x=1714382130; darn=vger.kernel.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=b/wu88jA9YdxZN0vncf57S6bbFuU12MW/xuCRw6CPIc=; b=RDqBOJtWr2Pk57ZFfNBWbGabCvsULDnIVFKz8TBjvCza5XhRAhTKRPgVYfDKuVmw7+ d8GIePLCp8VIUmk52U2gCUf6BP8Po0KkEPogiy9+0AreI3r0DE7dJjtMFvEjD1tAZsZQ 5fYkjW8XR2sLJNCRj6glJJ3Crut7rGUc4FefaHVCqME2uSnraPVGUjdkwm+66il7UZL8 U7DmsyU1dl2lY9jpYuDux9eC88IcIOzGmZ0+ViVuOfk+wKbQE0Owbc6V1Oa2uFW4EqDB Ldz8p1VMyXb2b7pnDsnq7dCY88JOfe+wsSGxz8B0EYBy1X+zj13XiTNHdHud1pYT2XDR e4Zg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713777330; x=1714382130; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=b/wu88jA9YdxZN0vncf57S6bbFuU12MW/xuCRw6CPIc=; b=CMw44m1rat1h0XRCbB2OeHx3uaK/k6R8Z+Vdl6XkV1QKlhDWChbnRLbSYrMzPx7sad OETjKmtPtHZRxpAi78E54lFeGtuSv3Y90gNKL5i68duJAn27v/UV034VhvzXVV212xSl HYcSJ08WXpDkw5KxfiHt7Lpx82JcjDcoyU4Ydnxzpej8tA+pWI17C5pzZBh+cbGEghVn trtE0YF1qPBXn2IwCEVyBn7iN78vznp2Z0VlGtNzhoef60fmNX5BUxtdtzRRhV4jUXTX 04gPyfzFsvGO0eGZUsCQXd1yHErwgmFYPhITYAIaZyPclONH8Orsfq2xzlxCUBzQCU7H eNJQ== X-Forwarded-Encrypted: i=1; AJvYcCVhiIvNGl2WH+od4Zi6bdH0sIJwqzBunRPLZ5L8UTLwHwCZbr7m6dq5kZ8VcLytMJ/EqEzeLDRLQM52gms06ttgpLFcIEETLcBqrRPX X-Gm-Message-State: AOJu0YzJ2mRdt2xsnH7MITIhSjM5QEyRCI540r5NOu5xWmv5fZqU/eTF ZINxYsi9UY77Z0YpQMAOtBy9ls6lejUH69JePURX/c9Hn0FAd8jLJYJ9mtHslPQ= X-Received: by 2002:a50:cd12:0:b0:56e:2c1d:1174 with SMTP id z18-20020a50cd12000000b0056e2c1d1174mr6653782edi.4.1713777330577; Mon, 22 Apr 2024 02:15:30 -0700 (PDT) Received: from smtpclient.apple ([2001:a61:10c6:ce01:7d:af2:ac50:1252]) by smtp.gmail.com with ESMTPSA id f11-20020a056402194b00b005720cefe0d2sm931590edz.52.2024.04.22.02.15.29 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 22 Apr 2024 02:15:30 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.500.171.1.1\)) Subject: Re: [PATCH] bitops: Change function return types from long to int From: Thorsten Blum In-Reply-To: Date: Mon, 22 Apr 2024 11:15:18 +0200 Cc: Arnd Bergmann , Palmer Dabbelt , Charlie Jenkins , Namhyung Kim , Huacai Chen , Youling Tang , Tiezhu Yang , Jinyang He , "linux-arch@vger.kernel.org" , "linux-kernel@vger.kernel.org" Content-Transfer-Encoding: quoted-printable Message-Id: <4BD934DC-5657-41E1-A9D6-226886D2AA8B@toblux.com> References: <20240420223836.241472-1-thorsten.blum@toblux.com> To: "Wang, Xiao W" X-Mailer: Apple Mail (2.3774.500.171.1.1) On 22. Apr 2024, at 07:24, Wang, Xiao W wrote: >=20 > Could we change the return types to "int", instead of "unsigned int"? > https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html says that these = __builtin_* > functions return "int". We could, but changing the signedness breaks assertions in other modules = and=20 drivers (e.g., where min() and max() are used) and has quite a few side = effects. >> With GCC 13 and defconfig, these changes reduced the size of a test >> kernel image by 5,432 bytes on arm64 and by 248 bytes on riscv; there >> were no changes in size on x86_64, powerpc, or m68k. >=20 > I guess your test is based on 64bit arch, right? Yes, except for m68k.=