From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) (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 C774C28D8DB for ; Tue, 9 Dec 2025 10:36:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.68 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765276586; cv=none; b=hvrvOLzBzaEBOc+frOpII8McnGdhDnGTMfFRnBOwexrousFAK8k97IhmDLR/4n1azB3DjlZR8OS1S8JAp50e689r7KulPS7aquCdvGGT20p3xz74yn8CV1DxCJc9wjVTEn1V6tFwICQDsKd28H4pc6R9R1XEWHUSt2uN9Eih6QY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765276586; c=relaxed/simple; bh=lMF0egJjlq3xAL+hAsO0sIoVt1a5R4W/EzgzPOaxxno=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=lorce1J5p3I0gKipm9OcmL83bHGXyJC1+iOH7NVyGzHOV27NCvJiQLvFGMgjDj32GFDkbN6HwDKCGFfBBx7AZW9hx6EJwNTmFm66aF/nE3aeNHAc5YknNzwiFtyHC/n5l3O8O2htasgZigYhSiMScEs9CRCXPeskvFXLtMuQ7zM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=XTu86gN5; arc=none smtp.client-ip=209.85.221.68 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="XTu86gN5" Received: by mail-wr1-f68.google.com with SMTP id ffacd0b85a97d-42b3669ca3dso2542115f8f.0 for ; Tue, 09 Dec 2025 02:36:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1765276583; x=1765881383; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=fv7PBdO3hgpUW0vcVSdnRgEgToyYluEyJcVyXFEQJS8=; b=XTu86gN5dND0EJwcag6OwqXmKrha5A26eG4vxK75kE1atPwA9zotuX47t5MJm6H+if mVk3KNRt5C6feeejifB5jdqpMjhUMm3xSqyraA2pmjcmZ6kZf7Bk90su7VZ2bfrlq/SX cZMW2HI/FFLs4/LOzUIBXExH7wKqfFeuxvbpKQfPlAndvQD8gVLjNDzpMFcJpcWLzT3c iPVux5t2Vwkvs12j4/wWAYO8cSGzDax+30q3rEXnqkLWi2E4KjgNP2FsElRXDNyG7BK7 0YtMaPVc0ZHsAdSrbVyGpaOM7feyWRRGXOLKuJjbdy1TWb6pzJeOscPIfSmWcPk7/7RH /ZBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765276583; x=1765881383; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=fv7PBdO3hgpUW0vcVSdnRgEgToyYluEyJcVyXFEQJS8=; b=QFzi8G+WLTCn9AgA5SL+H7pbhW3R6ZKx52Sba8aVKhWynShubaHnS1dqHCkZOkusqj HD50/rPPyjOo8GwMCiaLQh1nlxA5aFIAasHPqGSGnOa/KEc/nsX6ID/Rl/uUjva6C3Fy JkDbCkCmpYveKP5LBsck1cibwqgAMMCONRY2ui64dUduPLDpT7A4PYEuaf8ewHEA1OZZ QKYfZqkdcFlTM0/Csr06cU1iF/WhXQzyDUu6LHqkQiTGMKEEHbhQ38Z2L1yh0GgX3hUC JCK9dbimaVj62cVmbpD/4q6ngCIW3x9bOi5bU1ky8OyOm/VTNwGWmqrKVMpR7z/4utg2 EVuw== X-Forwarded-Encrypted: i=1; AJvYcCVLFigJgcdHxLnlnMMywY1mbpAr3jU/ye6xTvMTOKUvRpLh6t8iHDGyZwo9lRbtGrFHKdZdR3tHTbZyuS0=@vger.kernel.org X-Gm-Message-State: AOJu0YzinvDkLQJWTlYvomp0d3uFqXgxXC0C5m/LcRKFTTdef25rdn18 8mAqn5DRYxxQ+aoORhTycGScpM0v6mzSb+qzsbwL28b/VwWjOSES8H0O X-Gm-Gg: ASbGncsk51UiLruH9CS84QLZeWfRNZNjBX7vphbCnHEKxVa9I2n3t5AP4TFncQNH5F+ zy6Y2HV02I6w1OsQI8vlb0oV7RZgFrOP3JPoF6vhEGkIKdoGAqHH+knl5gakX+oG/fX+Uj4rROY xnfIh8fix+Fvvx8QoFEqyHpcXY/ewUWIsfpHdqX3vluVAYnPqqpkSJwKCKCpKronEEH7XjJQZcJ ExTiqd5wXyjkDrly1f0SHaQf61UMYmuMotXHpAj9RRuHmBSjeo5/AMVzyrzj4doS8Ocbg06v9md 8GA2JkfJqJFmz7IlES2QkXQg3qGzbo4/LYf/HWJ7JVmnptW+VTtbpCsBUxEJnBH0aozGeOBikMH zR0aZsCl52Dmk7tvR2ir4c0RCGbJ6FzvRZ1HFIIGTsa4W7o8vo4Yn1hZ/MJobQys0lKHNQvoeWI 7c9f/EuN8sz/XuzA7ihSctCJjJhwNKcVevsDuPkknQwCIUxz+j80u+ X-Google-Smtp-Source: AGHT+IGFAgehTmw8PLHj4QJJjd7Gf/VVDyG7X98wpx4H0KiE7+sLs6BmknhUqgwIOLm/fXWIK5/x2g== X-Received: by 2002:a05:6000:208a:b0:42b:2e39:6d50 with SMTP id ffacd0b85a97d-42f89f12808mr11214524f8f.19.1765276582774; Tue, 09 Dec 2025 02:36:22 -0800 (PST) Received: from pumpkin (82-69-66-36.dsl.in-addr.zen.co.uk. [82.69.66.36]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-42f7cbfee50sm30637673f8f.14.2025.12.09.02.36.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Dec 2025 02:36:22 -0800 (PST) Date: Tue, 9 Dec 2025 10:36:21 +0000 From: David Laight To: Greg KH Cc: Yury Norov , Rasmus Villemoes , linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, Geert Uytterhoeven Subject: Re: [PATCH 2/9] thunderblot: Don't pass a bitfield to FIELD_GET Message-ID: <20251209103621.7e6922ab@pumpkin> In-Reply-To: <2025120944-grudge-machine-720c@gregkh> References: <20251208224250.536159-1-david.laight.linux@gmail.com> <20251208224250.536159-3-david.laight.linux@gmail.com> <2025120944-grudge-machine-720c@gregkh> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; arm-unknown-linux-gnueabihf) 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=US-ASCII Content-Transfer-Encoding: 7bit On Tue, 9 Dec 2025 07:56:35 +0900 Greg KH wrote: > On Mon, Dec 08, 2025 at 10:42:43PM +0000, david.laight.linux@gmail.com wrote: > > From: David Laight > > > > FIELD_GET needs to use __auto_type to get the value of the 'reg' > > parameter, this can't be used with bifields. > > > > FIELD_GET also want to verify the size of 'reg' so can't add zero > > to force the type to int. > > > > So add a zero here. > > > > Signed-off-by: David Laight > > --- > > drivers/thunderbolt/tb.h | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/drivers/thunderbolt/tb.h b/drivers/thunderbolt/tb.h > > index e96474f17067..7ca2b5a0f01e 100644 > > --- a/drivers/thunderbolt/tb.h > > +++ b/drivers/thunderbolt/tb.h > > @@ -1307,7 +1307,7 @@ static inline struct tb_retimer *tb_to_retimer(struct device *dev) > > */ > > static inline unsigned int usb4_switch_version(const struct tb_switch *sw) > > { > > - return FIELD_GET(USB4_VERSION_MAJOR_MASK, sw->config.thunderbolt_version); > > + return FIELD_GET(USB4_VERSION_MAJOR_MASK, sw->config.thunderbolt_version + 0); > > This is going to be very confusing to people who see this line only. > Can we add a comment here to explain why we have to do a "+ 0" and why > it can't be removed? Otherwise I'm going to get a bunch of "cleanup" > patches attempting to "fix" this over the next few years. I've added a comment for v2 (but not the resend I did for the cc 'issue'). I've also fixed the subject blot => bolt. I also noticed that the 'int thunderbolt_version:8' seems to be in a structure that maps something read from the hardware. That isn't going to be right on any BE system, and isn't guaranteed on LE ones. David > > thanks, > > greg k-h