From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7CB4CEA4FAE for ; Mon, 23 Feb 2026 11:23:49 +0000 (UTC) Received: from kara.freedesktop.org (unknown [131.252.210.166]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5771110E36B; Mon, 23 Feb 2026 11:23:49 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.b="gUL+xGe3"; dkim-atps=neutral Received: from kara.freedesktop.org (localhost [127.0.0.1]) by kara.freedesktop.org (Postfix) with ESMTP id 715C943493; Mon, 23 Feb 2026 11:13:49 +0000 (UTC) ARC-Seal: i=1; cv=none; a=rsa-sha256; d=lists.freedesktop.org; s=20240201; t=1771845229; b=b3WfCCJHilYaVcRV+Z7lX9mW+DbUtRrP5gLT6Gsos7XRlQuD3uaIUE5Z3Od/IEkXB6Vpw OFjIeaKP91uUxUOSeOI/v6ywLSdVdRZ1YkFOtjt03Lx/JSgJmIpf7Trfd+3B9OkazuAdoix 3p2JurW5HEKvKKWE3f+UL3aPiTibJtMB9SpyTVvsmXv/St1QMF/idDAjHZz4V5Jcj6Brbem NN19fXoiFxZhUpPS6ueecctoUMr1ql1Q8WGJtKhlMJCXVJL3YwG39CUwzLizur7uhN5hfYJ 52Pjwc7PsraNwZKTTl86ac4yFrL9j9O1wuPjVX57SfatutrSls/2Z0C1SaQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=lists.freedesktop.org; s=20240201; t=1771845229; h=from : sender : reply-to : subject : date : message-id : to : cc : mime-version : content-type : content-transfer-encoding : content-id : content-description : resent-date : resent-from : resent-sender : resent-to : resent-cc : resent-message-id : in-reply-to : references : list-id : list-help : list-unsubscribe : list-subscribe : list-post : list-owner : list-archive; bh=N5sqVBklMNFd+AwWdw1mQppSBmesqWMHAjeKbhCCvH0=; b=JSfHVu2p5HjZZjBePEoGXNUMGcwmyGZCFQO17GiaRGJc+uCJ/NDmqDfBJal/A6xcc+laj AegA19lMkONJA+U33q2xZQ6EPPdmsTXMsFtOQd74Sq1GbCVLyQzzymU5Ye/E3qgaKU3dkHj nAHikyfKIBWNS5wtifv4dctX3f44nMSIk51+55GYVIwbygBh9Jc6yhcq0na2cxOm9AOWsLH XPTUMIgioEqYVF8MHtsCLkyhcMVIreGNLs57lq0sehWrYs/ZPKUmRuO1QB4T9qo+769BazH dPuGJc0SxEBtYkQ87OmLfFD+y+/7EYwCO7U1Dw6BTSPCPZE0ITbFfNL2pwiw== ARC-Authentication-Results: i=1; mail.freedesktop.org; dkim=pass header.d=google.com; arc=none (Message is not ARC signed); dmarc=pass (Used From Domain Record) header.from=google.com policy.dmarc=reject Authentication-Results: mail.freedesktop.org; dkim=pass header.d=google.com; arc=none (Message is not ARC signed); dmarc=pass (Used From Domain Record) header.from=google.com policy.dmarc=reject Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by kara.freedesktop.org (Postfix) with ESMTPS id CDCB040ACE for ; Mon, 23 Feb 2026 11:13:46 +0000 (UTC) Received: from mail-wm1-f73.google.com (mail-wm1-f73.google.com [209.85.128.73]) by gabe.freedesktop.org (Postfix) with ESMTPS id 863B710E37C for ; Mon, 23 Feb 2026 11:23:46 +0000 (UTC) Received: by mail-wm1-f73.google.com with SMTP id 5b1f17b1804b1-4832c4621c2so42976585e9.3 for ; Mon, 23 Feb 2026 03:23:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1771845825; x=1772450625; darn=lists.freedesktop.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=N5sqVBklMNFd+AwWdw1mQppSBmesqWMHAjeKbhCCvH0=; b=gUL+xGe31Jo9B3KtcRlCpU4Wr69KLnWMBw2EiVkFZ3leMRqz8vOpwCVAkVUSgTfA+P FiVtN1VaopoccGwmPsX3ZOOHWt6H6vBKO+BokJIe8y8IMUIFu3WaZPuHyOfzsZ/ZP0P2 7O+vVFeLzEyTUyjKYBwbDmg3j8OaoQHxtCvN9h4vRQE3Pn4bavzYRmUPhyqXCavM/YRR 208xce8iTNwwIxPJt4Pn1svlZFB5o+8etTEYzWoxUi6pCHeqW3+vtJyVHICL6143rFHd AUUtRpj6JW9yQnqklMB9PwTgPCpG/7UwXDtu8iWrVNYdlFg5UMiWS7JgUR6TUQNayJMB pdBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771845825; x=1772450625; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=N5sqVBklMNFd+AwWdw1mQppSBmesqWMHAjeKbhCCvH0=; b=buJ36EnrXDIPGAq7qSUn5P77vjOJjjOQlTJg3OQRMNkETFqknlKHypMj16ks1hqAjV YnX0HxO/Hc4j7W+jZAx853UGEckWriT1Bu9gTrOb0ahJZgAGBLqfm5AIrNqr2G/U6gep HoJy2om3/NhSN+xviOkSLdlSjkVjiD7Nd1rLp4sg22vJLRbg7+rq8/k/Rsd7jLSRCH1E HdqR+xy0gcWQOx6RdNGF1TVwUGtf09xVTqYQA5dREu4uUD67EiKe61NCZoVOF0wlOD8C VipXTazmk8DGXk/69cQdpkn88aYnCGsGuSFLD8vjbVl8ue5p4WNbka5xSBbEkWTI/T+e mPjg== X-Forwarded-Encrypted: i=1; AJvYcCUrSgK0r8+RuhCdzDhO2Kl6TnLxoOe5lbIMieMJk+crvZoB+5g7p65aIGRMV710rAaG9WqZPmj4@lists.freedesktop.org X-Gm-Message-State: AOJu0Yz8C20g+JiulKy0TahKwIM+RDdj3Iaqi0EBUse4XkmQ7q4IG0Qw K1fssLtFsxVbfWdEZc1rztijUnK6fCWnGme7f8Iri5GdaVuSsjVG0oVF5rUN/DDjiv+H2QTR7FU rUSnJtnlzq1gX17czAw== X-Received: from wmbf24.prod.google.com ([2002:a05:600c:5958:b0:483:6c98:3d2f]) (user=aliceryhl job=prod-delivery.src-stubby-dispatcher) by 2002:a05:600c:a418:b0:483:b3d7:2e80 with SMTP id 5b1f17b1804b1-483b3d72f30mr25074315e9.33.1771845825030; Mon, 23 Feb 2026 03:23:45 -0800 (PST) Date: Mon, 23 Feb 2026 11:23:44 +0000 In-Reply-To: <20260221020952.412352-22-jhubbard@nvidia.com> Mime-Version: 1.0 References: <20260221020952.412352-1-jhubbard@nvidia.com> <20260221020952.412352-22-jhubbard@nvidia.com> Message-ID: Subject: Re: [PATCH v5 21/38] rust: ptr: add const_align_up() and enable inline_const feature From: Alice Ryhl To: John Hubbard Content-Type: text/plain; charset="utf-8" Message-ID-Hash: FKZUPVINO6OXARHZ7F5GNHDMFH4OGY2H X-Message-ID-Hash: FKZUPVINO6OXARHZ7F5GNHDMFH4OGY2H X-MailFrom: 3wTicaQkKB_YYjgacpwfjemmejc.amklmstcYsjgqrq.dpccbcqirmn.mpe@flex--aliceryhl.bounces.google.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Danilo Krummrich , Alexandre Courbot , Joel Fernandes , Alistair Popple , Eliot Courtney , Zhi Wang , Simona Vetter , Bjorn Helgaas , Miguel Ojeda , Alex Gaynor , Boqun Feng , Gary Guo , =?utf-8?B?QmrDtnJu?= Roy Baron , Benno Lossin , Andreas Hindborg , Trevor Gross , nouveau@lists.freedesktop.org, rust-for-linux@vger.kernel.org, LKML X-Mailman-Version: 3.3.8 Precedence: list List-Id: Nouveau development list Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On Fri, Feb 20, 2026 at 06:09:35PM -0800, John Hubbard wrote: > Add const_align_up() to kernel::ptr as the const-compatible > equivalent of Alignable::align_up(). This uses inline_const to validate > the alignment at compile time with a clear error message. > > Add inline_const to rust_allowed_features in scripts/Makefile.build, > following the approach in [1]. > > [1] https://lore.kernel.org/rust-for-linux/20260206171253.2704684-2-gary@kernel.org/ > > Suggested-by: Danilo Krummrich > Suggested-by: Miguel Ojeda > Signed-off-by: John Hubbard Note that Rust Binder's ptr_align could use this if you want another user. Alice From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f74.google.com (mail-wm1-f74.google.com [209.85.128.74]) (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 93A6B35CB8B for ; Mon, 23 Feb 2026 11:23:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.74 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771845827; cv=none; b=jBLimZiaJFFUa6hrcfxNmR7x/aYUd5oUxiOd5iYeZAFReAdAa3ExC8PSHr1k7wHH3QunmX/5f6aiziSqX+Wjk7HKeUWfU+uSO+BhdJV9GM0s1g4WBRGaNCl7TIeepPCIrOXqYVqoSiPPhmy38JLU7jH4pgpgeoX+aiW1JitXORw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771845827; c=relaxed/simple; bh=nWimSMfoh0LM9JwVbRmZZAKSTbjL8JAXDNUEZYCzCQA=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=aJP9Ds1GYscgPqQCDRndMu+1PykJMIZ6/T+zJfBuuCIJCoaKb+3qMfUYpkahdOnFhiUyu5jU/8/H+Nn+4A57QEF7c2f2RSzrDQoIPa6cTI8NEGlWu691iADr3T/F4ovISE7KaPWEMLI7nhX0r/4zP/R0tdgZil1AXBPcYOEYm70= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--aliceryhl.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=zcHNqgAw; arc=none smtp.client-ip=209.85.128.74 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--aliceryhl.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="zcHNqgAw" Received: by mail-wm1-f74.google.com with SMTP id 5b1f17b1804b1-4836e35292cso35918045e9.1 for ; Mon, 23 Feb 2026 03:23:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1771845825; x=1772450625; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=N5sqVBklMNFd+AwWdw1mQppSBmesqWMHAjeKbhCCvH0=; b=zcHNqgAw33T7aj408isMKcJTxDThhaIZDBD5UWxcbH0fF7A7dRD8VaDAupr89gdTg3 5JIwjALO4gIDCg/ebdUO2ERCtCPRagt6Hxp2WwI+5L4ObeFg4YERJ8gMRMXdR51X0FOz vdmqgGAiCOgORSbEgLAgp0Af9bEPM3o7J+K328qVhhrUovU08VM2GYXMrrNlqIE5AW6w YerOOS6sAQwKMNg9GPiJAvMcZjuuNDR+oM6A5zsf7p2fVyWh8qSuDd93m49JVY2PiAsI zp/tzN2+EaMNVVxvIZ7GLmCdMIdPjm6yIFwMBD83KYhH6ROUseFKAkgrbKb5OFd9En5O m8DA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771845825; x=1772450625; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=N5sqVBklMNFd+AwWdw1mQppSBmesqWMHAjeKbhCCvH0=; b=CL+qwonnE+wySheuNsOtEioWdnc5tHTPXf2ANu+be+Wrl/CuhKi2zu0DDv4dx8xSPI 7yPtdbC9x6Nuu5MOWxaOhnfNYLGd7cZ1C4mjz5daqBCC4NTOERiXz9nSZhHa9uyu5HC6 5X1ysPyb6M2dGLpFezahgx/+H+uH8MAk7BcRa2G0X0ymhnVg1ga9dSFf88G1LBMhr/Rm rQBZeByAVVD8hq0UFfskcA/JdEVsEjwxgMTMyUIEz2sL1ZBT8VsLimvpiOOEyZuhmzRg Cz3wz80/hA+ZNOESSZ5RZzQJKRKztblmNIeFb7PJ/COL8Vn+lOPLnZjqas5qmpA/oeak BWcw== X-Forwarded-Encrypted: i=1; AJvYcCWEi8Hu2BchzYmcCfTvhggGf25JcWmyJJLbGapePz44/iiDdd5SNIz+A+pBWIoT83AVLzrjZfWy1/ABvoznPA==@vger.kernel.org X-Gm-Message-State: AOJu0Yw9Xp7V+CHuMypU8XVDrYONYmdonXsGfY8JORm0Jb1BiQ3jsxcw k0R99SaclZjDWScWFyA8v3SDVjVztFoRng2nbTn57FN1cir/PX2tbz61I/C6kloUtqoxZXxt/q/ O5DxlpQqu+wj6rCFdFA== X-Received: from wmbf24.prod.google.com ([2002:a05:600c:5958:b0:483:6c98:3d2f]) (user=aliceryhl job=prod-delivery.src-stubby-dispatcher) by 2002:a05:600c:a418:b0:483:b3d7:2e80 with SMTP id 5b1f17b1804b1-483b3d72f30mr25074315e9.33.1771845825030; Mon, 23 Feb 2026 03:23:45 -0800 (PST) Date: Mon, 23 Feb 2026 11:23:44 +0000 In-Reply-To: <20260221020952.412352-22-jhubbard@nvidia.com> Precedence: bulk X-Mailing-List: rust-for-linux@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260221020952.412352-1-jhubbard@nvidia.com> <20260221020952.412352-22-jhubbard@nvidia.com> Message-ID: Subject: Re: [PATCH v5 21/38] rust: ptr: add const_align_up() and enable inline_const feature From: Alice Ryhl To: John Hubbard Cc: Danilo Krummrich , Alexandre Courbot , Joel Fernandes , Timur Tabi , Alistair Popple , Eliot Courtney , Zhi Wang , David Airlie , Simona Vetter , Bjorn Helgaas , Miguel Ojeda , Alex Gaynor , Boqun Feng , Gary Guo , "=?utf-8?B?QmrDtnJu?= Roy Baron" , Benno Lossin , Andreas Hindborg , Trevor Gross , nouveau@lists.freedesktop.org, rust-for-linux@vger.kernel.org, LKML Content-Type: text/plain; charset="utf-8" On Fri, Feb 20, 2026 at 06:09:35PM -0800, John Hubbard wrote: > Add const_align_up() to kernel::ptr as the const-compatible > equivalent of Alignable::align_up(). This uses inline_const to validate > the alignment at compile time with a clear error message. > > Add inline_const to rust_allowed_features in scripts/Makefile.build, > following the approach in [1]. > > [1] https://lore.kernel.org/rust-for-linux/20260206171253.2704684-2-gary@kernel.org/ > > Suggested-by: Danilo Krummrich > Suggested-by: Miguel Ojeda > Signed-off-by: John Hubbard Note that Rust Binder's ptr_align could use this if you want another user. Alice