From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) (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 A3656227B94; Sat, 19 Jul 2025 09:52:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.51 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752918754; cv=none; b=pu1CYdAfH6LT5Pyjc0MTaxBgAiwDEJdTNzueiSrACmDBIS3RSFxKAdraFECg+Lbd2LPVZovhJz9+8qcfIHi0PduXWuq1XSq1u0KJ64mLdrDp2FebfSiCj2dNrGp6tLd68aAECa8bs4x8PzqWacbce/XXCZtcwxepBxiU//rRd+M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752918754; c=relaxed/simple; bh=oSt+1bwQznG4gMR3tFfughPMF0WDaB7Y07l3ebktgr4=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=tSZCiPfrl4LtCQXWvKSBFVFmbJ5CCmoNTbn73rs30MpzUC6Out1EPaGy3vvMnKuI/RIXIk6kBNKC1odfBPj/26GSsOrjegfHX2misgvNfbcmbXWk6cfBSk87b3YL2FAbpn12vu1FfVKUWubTyfbCUBZAsL7fY5vLw76Nmwsw9ew= 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=hKCtxXzR; arc=none smtp.client-ip=209.85.128.51 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="hKCtxXzR" Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-451d54214adso20612785e9.3; Sat, 19 Jul 2025 02:52:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1752918751; x=1753523551; 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=5pEXn5VHOGjD9SP45xNUPOGCXrKn0jYGF1BCukLPods=; b=hKCtxXzRTaCZm0wGBSkNIcxm4b4aq7S79pQXEA/aonYCm5GGHai5by6PtYCNvHGQiq nrPqX6+TNROHPSEWypuhFjMmyeodYslkei9EU/ngGFPRhQ0hdNctk+6sLIe4tu+YAd5y eBCXGeR2x3VPUc2k/fdoMIIyaDG3eIWjCjf330YWOYw0LxeDD3Wej4fYIETDjKwgXpyo LejBDeMXBZEnhxSSZoCRpjGWpYOaVHjG3aPnS7tg/Bz8D59mJviZcraH48LpXZLJ6Cea /85xOD0q9j4YBK439c8q9AahuYK8GSvsWsM/q2o8Sn69VBRRyan28fakqnLCtRtF2K8N iNSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752918751; x=1753523551; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5pEXn5VHOGjD9SP45xNUPOGCXrKn0jYGF1BCukLPods=; b=qAHiyyRCshbJJZUDg9hewod149Jo9SPrTBivp5eQF7UJRFyoCwejaBnDF7tDDsawIc vIKM5gEHi8aN3h+KHtp51+37AZryqDAhP4Wj/cvb29hFzmD8uK90u0/9aghFwiBfMv8N oJZK6u45VM5UYCNSsSF+rKtWw9+6RODUN7rVRa4LQ5tNhuHby2zLCfdBbtkHSwWvIEqO 9UHIsL+dqitKS+BxJerUDPRAjKTsgfxleU8a3DJDNqbYSdu2Sm7oz4xczk4p9E6K1SCR a0Y9xOzxoPhRKE7isUmUwMegCboOCAY5TLjTYCXrLijkf/6ytCestxkMSS21W4SaI2PS WKuA== X-Forwarded-Encrypted: i=1; AJvYcCUYTFNo89fqvd5m3Bd4gX6GPlB4BIhOiFKjbqQgBW4xL25SbKXVzHNmhjt+9FeV0TSUwAzttzbMfcoKIp1ZVErX@vger.kernel.org, AJvYcCV+hTnNQ5SZiZ3aFJnyQxAzd9S3AoArY92DLukxAGPhUvmyGiT/79ttuzwqxuHTmeUxyeo5qtXHhDklj3AJ@vger.kernel.org, AJvYcCVGNd/NRwazYBzrkL8dhy7WHmyaT2FDMEf4qSQDzfodEAxGkZlyJGSuBDUX2tHh+FHa3CYz22wWqNcu7dZ1@vger.kernel.org, AJvYcCX3BvTAS5xc6iqo4xIbKbYxRqqRZWHX94foq5KhpfsbfoxQCLCFAxDu4HOYKwtwe2R6DTneOzATlMx9WRlRTA==@vger.kernel.org, AJvYcCX5d8+8OHdWafoVYEzAcoLzzVfSzmJxF/iy1dl44e9V7uVyJJsDo6ERcj5+s6GJHuoXn+Q=@vger.kernel.org X-Gm-Message-State: AOJu0Ywgt/4U+BYa3PG00MHbAriBGPLqAHcSYhro2I56LjrG4OURztvI JHyhqLeULFG+UbpQUOJEwzHOzf1ksT13XiCeooXgYQi91ziJAjhdNda5 X-Gm-Gg: ASbGncu0GPUnk7EtkesxcwN5xWWGLvhSSC9+tqoOz4wga2KIWWV0EEuk5+V7TTc/OA2 m6BOy8RFv5l9MKCWdyyiirNqHwb2NKfTo9aH7UCIgbjBUoWbTOwFPV+faibebd0DqAxUjPrXN5+ YCQB9aS+5JZO3c23QfZDXLotmpab00GUdbrey3arf8ECaLt/rcnx8XxaKZXTkCWuFxSOCgYAkOV P8LQk1ruqG9Sy2y0tQ46IytS34C9it/6jBj7Wqbz29q2KCqx22TPRHeZ9rEkAgK6oGyvgFapf72 RlrDnaIdw/0G/FVDu4QsILKS3lPYv0k+yG5kEMzLB7VqWzJMxAVgivryygNhLQTP1FPy7DjtFsZ +0XOSw9m59FDOE0GBRto6uWVK5tSNbzf/vEkxBpR5j23Nsu3yxL4KsLbJ4U6o X-Google-Smtp-Source: AGHT+IGgS3eKZd0WOE5CaGVORMk8w7YbhfbUyHdCIflKLfBmlFtKqD0yPw9BMSfCnK1ze+Ow5Wktqw== X-Received: by 2002:a05:600c:3484:b0:456:1a41:f932 with SMTP id 5b1f17b1804b1-4563535d2ddmr77234825e9.22.1752918750524; Sat, 19 Jul 2025 02:52:30 -0700 (PDT) Received: from pumpkin (82-69-66-36.dsl.in-addr.zen.co.uk. [82.69.66.36]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4562e7f2bb4sm100634135e9.8.2025.07.19.02.52.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 19 Jul 2025 02:52:30 -0700 (PDT) Date: Sat, 19 Jul 2025 10:52:28 +0100 From: David Laight To: Linus Torvalds Cc: "H. Peter Anvin" , Eugenio =?UTF-8?B?UMOpcmV6?= , Ilpo =?UTF-8?B?SsOkcnZpbmVu?= , "Michael S. Tsirkin" , Al Viro , Alexei Starovoitov , Alexey Dobriyan , Andrew Morton , Andrii Nakryiko , Arnd Bergmann , Borislav Petkov , Cong Wang , Dan Williams , Daniel Borkmann , Dave Hansen , David Laight , David Lechner , Dinh Nguyen , Eduard Zingerman , Gatlin Newhouse , Hao Luo , Ingo Molnar , Jakub Sitnicki , Jan Hendrik Farr , Jason Wang , Jiri Olsa , John Fastabend , Jonathan Cameron , Josh Poimboeuf , KP Singh , Kees Cook , Luc Van Oostenryck , Marc Herbert , Martin KaFai Lau , Mateusz Guzik , Michal Luczaj , Miguel Ojeda , Mykola Lysenko , NeilBrown , Peter Zijlstra , Przemek Kitszel , Sami Tolvanen , Shuah Khan , Song Liu , Stanislav Fomichev , Thomas Gleixner , Thorsten Blum , Uros Bizjak , Xuan Zhuo , Yafang Shao , Ye Bin , Yonghong Song , Yufeng Wang , bpf@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-sparse@vger.kernel.org, virtualization@lists.linux.dev, x86@kernel.org Subject: Re: [PATCH 4/7] arch/nios: replace "__auto_type" with "auto" Message-ID: <20250719105228.1704538d@pumpkin> In-Reply-To: References: <20250718213252.2384177-1-hpa@zytor.com> <20250718213252.2384177-5-hpa@zytor.com> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; arm-unknown-linux-gnueabihf) Precedence: bulk X-Mailing-List: linux-sparse@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 Fri, 18 Jul 2025 14:49:41 -0700 Linus Torvalds wrote: ... > Side note: I think some coccinelle (or sed) script that replaces that > older form of > > typeof(x) Y = (typeof(x))(Z); ... > > with just > > auto Y = Z; > > is also worthwhile at some point. That one needs to keep the typeof() - but the cast might be spurious. It could be either: typeof(x) Y = Z; or: auto Y = (typeof(x))(Z); but the latter could hide compilation errors. I'm waiting for the next 'duck shoot' (after strings) to be casts. While casts of 'buffer' to/from 'void *' are fine (and not needed), casts to/from 'integer_type *' are definitely problematic. And 'random' casts of integer values could easily hide real bugs and most just aren't needed. Although you might want the compiler to make the result of 'u64_var & 0xffu' 'unsigned int'. David