From mboxrd@z Thu Jan 1 00:00:00 1970 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 C46A81D79A3; Thu, 19 Dec 2024 22:51:11 +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=1734648672; cv=none; b=qMzcoQv9h8X5kvUN5+ksKHlcUfDC8xtojly5SGfyo3F1BHYczqiKNrFVgcKQzmUdZkB3JKniigr1sBFCJ8UFlXiDgpRuXJyQEX1FT6wZSHdCvi7I+VB/TIKazVOvKfqvVlWJvJPyXcY0tAhQIumELz4g5Ks2PHsjfoxycl3sWtM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734648672; c=relaxed/simple; bh=vn2Y7HOGnDiERqHrmWj9W5nFrgVwON2deCzXDJZ+tIw=; h=Date:From:To:Cc:Subject:Message-Id:In-Reply-To:References: Mime-Version:Content-Type; b=Nte2wqMOU8bDneMdPdq2IiDrXtscWmHRYJRXFSv3nv5BSjfj4PMPBJnhPx1LpAqB2NSmPDE2uW8iZ3nFCjQjZgZPKL6cLM3QPtpp7NZdM5QsuQ4Q4o+fGlBCmyfs8OIrlHayVtXA/kz6G7G1Eul5ymdBSfSLf6LWUuiybFptUzI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=t0rhhzjp; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="t0rhhzjp" Received: by smtp.kernel.org (Postfix) with ESMTPSA id EBE18C4CECE; Thu, 19 Dec 2024 22:51:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1734648671; bh=vn2Y7HOGnDiERqHrmWj9W5nFrgVwON2deCzXDJZ+tIw=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=t0rhhzjpz1vdogEA28Fuz6THqQkcz06UXa/pxjoJwkMHEOkW2Hoc0+OlDTF1h93YH kXPOg9U0/QVr1oW9unJNYie8W/5guioFlUO/vGigsJsCVETXNdy4yRVsOUoNUkUpAu H7efylqhoOToOqhPLENNK395OTBawe7wI9jBDNg8= Date: Thu, 19 Dec 2024 14:51:10 -0800 From: Andrew Morton To: Uros Bizjak Cc: Gal Pressman , Dennis Zhou , Tejun Heo , Christoph Lameter , Nathan Chancellor , Nick Desaulniers , Bill Wendling , Justin Stitt , linux-mm@kvack.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev, netdev@vger.kernel.org Subject: Re: [PATCH] percpu: Remove intermediate variable in PERCPU_PTR() Message-Id: <20241219145110.a4815019ca69d6d5c36f1fdf@linux-foundation.org> In-Reply-To: References: <20241219121828.2120780-1-gal@nvidia.com> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; x86_64-pc-linux-gnu) 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 Thu, 19 Dec 2024 18:03:47 +0100 Uros Bizjak wrote: > > Actually, you can simplify the above a bit by writing it as: > > > > #define PERCPU_PTR(__p) \ > > ((typeof(*(__p)) __force __kernel *)(__force unsigned long)(__p)) \ > > Andrew, please find attached a substitute patch "[PATCH 4/6] percpu: > Use TYPEOF_UNQUAL() in *_cpu_ptr() accessors" for your MM tree > relative to the above hotfix. The whole patch series (+ hotfix) has > been re-tested against the current mainline defconfig (+ KASAN), > compiled once with gcc-11.4.1 and once with gcc-14.2.1. Updated, thanks. > #define PERCPU_PTR(__p) \ > - ((typeof(*(__p)) __force __kernel *)(__force unsigned long)(__p)) \ > + ((TYPEOF_UNQUAL(*(__p)) __force __kernel *)(__force unsigned long)(__p)) \ > I removed that final " \".