From nobody Thu Apr 2 17:17:47 2026 Received: from mail-pf1-f179.google.com (mail-pf1-f179.google.com [209.85.210.179]) (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 1175334A784 for ; Wed, 11 Feb 2026 03:32:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.179 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770780772; cv=none; b=S3zJOSn5d+7BpoO4DjwbJIC75onVnA6zkMVwSFSAfmOx3IG1DZZpdPmdqmg59bCnm/jgpws5m1RU+18b+iWTLqmCpT/SDgQ9L3c5p961MUSiTCyuaaCohhu35ccnNXSywDrzrjZ54dO6S/sCqfKSkydKzxIoFICFvw++zbTi4js= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770780772; c=relaxed/simple; bh=vSBHsAMqmP0mTWh5XLC6s4jgQYugzTdX4cOLY716pds=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Qa+oWy0tPH4i0TOnq3xHjtXMx88uiZIKOSbnPCnSjfhLxW/38NRBHYvUZ7Yl8L/QsBbzRu24dy40H6ha+4V5AE0R8kI2cSEka0uxNtLkm+0t6mx/uo+yDDtuLF/6LMWgga2QkqephrmkA4abK1alxxcxL3/f4S7T6fMQXEGEzqE= 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=Zox2dZZa; arc=none smtp.client-ip=209.85.210.179 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="Zox2dZZa" Received: by mail-pf1-f179.google.com with SMTP id d2e1a72fcca58-81f4dfa82edso2335416b3a.0 for ; Tue, 10 Feb 2026 19:32:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1770780770; x=1771385570; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=dF6bX/QVONfWDQrBCiwnvcbeLdCbDl1IQ4EC8a9rjVk=; b=Zox2dZZaeOEmRU3KE/QgDrV8zctrDPtHoKmPoXeYbu8I+pDBVaZ2Rwjsxmlcm4JNmQ 33Lm13+sbsQ940Ul/9B3K5eilSYAz5awblnZHWIeIP+SDidJ9NWUB8I+geJmpdXmuEpX CD7517TXo/+KS9H9Zs5vKiUWvR3V0NjdWBYbI/Qf3JSVdoTK9/EXIgxtR688mxpssVOq mcgl8FLgt4A2vcz5oN17PIYVv/3tFCu0d3EM+FVdFcDGmjXAW3IVKRuzt0c53RFydqFA 91nMutKIqVSASx/S0ku4ISfmrSxa3gmYFD2wReracFk62e89Meuhdd9YYtV/aJzOt6CN lFAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770780770; x=1771385570; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=dF6bX/QVONfWDQrBCiwnvcbeLdCbDl1IQ4EC8a9rjVk=; b=nxQBwSc1jHClgGYP2YCPE9XZegcBBaKiTULTkLMRzA0UNKY5Lk/HCQidhgPlPTHndF 8ZV4pKHLaq11C0j+FjlcNrf1m4QGtZBJY5hcEuCr29rUewREz27sNPxMT94ILd36Br6E w3CKItc9MNNHBCC14epmmZK/pPB9wnQMECHbgEXqkpexcG2T6jF6+mkCldkgirW4dtPb XIm1CrAhrif4CyTMVI9JXqD6b5nwYKPo3XCh6QT8NAhYvkDoGQe96UMj7l8tWkaL5J5F TFrDzoE4bx5vF8f2pKIsHL6GPA0jCJ7EtCia+87JnDJTiNoC/taYbRe7uKHVXmA4Y5Om 0Uig== X-Forwarded-Encrypted: i=1; AJvYcCXxqqGtUrdWlY2s7AxynAiUwjy0n+7ARA2ZWQnbk2vNDiwz6sL/vjEU1rYH0iJ5oXOCDW5Ua5iQ6Ipo+3w=@vger.kernel.org X-Gm-Message-State: AOJu0Yy7545Ea7V/JKdjBghkCq5dKsm3CRIf7ksFPY+uZ/2ix3ERz3NV zwcvFZ4I/xP5nH2V7Z1wDoRIHwdEFUIFR/0EVUmuPxe4enB5A3Z5uGji X-Gm-Gg: AZuq6aJzdXAlUg7HEbeZCgH0jJboVQKznLZXP3gHjqVT1NU4kRmg4sxpMgwn4PueGx5 IjSDkCZq9FKD2oHU1xiRRuL/pdVTz+tpBXNHSyzlHB2ckjDxKTx+zlzMn/x20/NgSY5FPvm1e1Z TSi9QGpzSuGoKgdh1xC4HPz18L0CFEjXccq+1iUI6Q7kQZiTIiBfDOAXJpWiLQK5EOgxX98kvde tlXGSuC3s4mitFZnxQBXr/wsDFLp8zAd9luSNnCylhLMtSh77U9Amx4m/0Rxp3s66x4CaF5dWdY BVc0QJBwng0JvAnxBAYUAY/jbDWDNDW9Va+qCb1izHbZb7PtPoizOdihVEbNwy4nGha3s7XZLnG gwg5uhHe0IbhguOY9W+IRYiVImvForz/sQKb1cgvFQUgeUng7tV03r2SnI3bQSsWT5wjtGDYDDj 3/wk/wwY6FuTbr9kkkqshM/Jrgsm+ABcFddVR7P5hZiw== X-Received: by 2002:a05:6a20:9f86:b0:35d:d477:a7d6 with SMTP id adf61e73a8af0-3942e35f73cmr1201854637.13.1770780770454; Tue, 10 Feb 2026 19:32:50 -0800 (PST) Received: from toolbx.alistair23.me ([2403:581e:fdf9:0:6209:4521:6813:45b7]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-c6e197d63c9sm464856a12.20.2026.02.10.19.32.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Feb 2026 19:32:49 -0800 (PST) From: alistair23@gmail.com X-Google-Original-From: alistair.francis@wdc.com To: bhelgaas@google.com, lukas@wunner.de, rust-for-linux@vger.kernel.org, akpm@linux-foundation.org, linux-pci@vger.kernel.org, Jonathan.Cameron@huawei.com, linux-cxl@vger.kernel.org, linux-kernel@vger.kernel.org Cc: alex.gaynor@gmail.com, benno.lossin@proton.me, boqun.feng@gmail.com, a.hindborg@kernel.org, gary@garyguo.net, bjorn3_gh@protonmail.com, tmgross@umich.edu, alistair23@gmail.com, ojeda@kernel.org, wilfred.mallawa@wdc.com, aliceryhl@google.com, Alistair Francis Subject: [RFC v3 26/27] rust: add bindings for hash_info Date: Wed, 11 Feb 2026 13:29:33 +1000 Message-ID: <20260211032935.2705841-27-alistair.francis@wdc.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260211032935.2705841-1-alistair.francis@wdc.com> References: <20260211032935.2705841-1-alistair.francis@wdc.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Alistair Francis C code can get the hash_digest_size by indexing into the global hash_digest_size array. We can't do that in the Rust code, so let's add a Rust helper function to allow us to get the hash_digest_size. Signed-off-by: Alistair Francis --- rust/helpers/hash_info.c | 8 ++++++++ rust/helpers/helpers.c | 1 + 2 files changed, 9 insertions(+) create mode 100644 rust/helpers/hash_info.c diff --git a/rust/helpers/hash_info.c b/rust/helpers/hash_info.c new file mode 100644 index 000000000000..d2cbc08b57d1 --- /dev/null +++ b/rust/helpers/hash_info.c @@ -0,0 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0 + +#include + +int rust_helper_get_hash_digest_size(uint32_t offset) +{ + return hash_digest_size[offset]; +} diff --git a/rust/helpers/helpers.c b/rust/helpers/helpers.c index 4b08b4f1d3a3..34db9eb5e43e 100644 --- a/rust/helpers/helpers.c +++ b/rust/helpers/helpers.c @@ -31,6 +31,7 @@ #include "drm.c" #include "err.c" #include "hash.c" +#include "hash_info.c" #include "irq.c" #include "fs.c" #include "io.c" --=20 2.52.0