[{"id":3688135,"web_url":"http://patchwork.ozlabs.org/comment/3688135/","msgid":"<20260508034309.58D6DC2BCB0@smtp.kernel.org>","list_archive_url":null,"date":"2026-05-08T03:43:08","subject":"Re: [PATCH 05/18] rust: add bindings for hash.h","submitter":{"id":93311,"url":"http://patchwork.ozlabs.org/api/people/93311/","name":null,"email":"sashiko-bot@kernel.org"},"content":"Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:\n- [Low] Unintended exposure of <linux/hash.h> to Rust bindings.\n- [Low] Alphabetical sorting rules are violated in bindings_helper.h and helpers.c.\n--\n\ncommit d4762d094c0da15881ab9c843fc2316ba4792255\nAuthor: Alistair Francis <alistair.francis@wdc.com>\n\nrust: add bindings for hash.h\n\nThis commit exposes crypto_shash_descsize(), crypto_shash_digestsize(),\nand crypto_free_shash() to Rust by adding them to the C helpers and\nupdating the bindings include lists.\n\n> diff --git a/rust/bindings/bindings_helper.h b/rust/bindings/bindings_helper.h\n> index 446dbeaf08668..d73142078240f 100644\n> --- a/rust/bindings/bindings_helper.h\n> +++ b/rust/bindings/bindings_helper.h\n> @@ -30,6 +30,7 @@\n>  \n>  #include <linux/acpi.h>\n>  #include <linux/gpu_buddy.h>\n> +#include <crypto/hash.h>\n>  #include <drm/drm_device.h>\n>  #include <drm/drm_drv.h>\n\nThis isn't a bug, but does this addition break the alphabetical sorting of\nthe includes?  It looks like <crypto/hash.h> is being inserted between\n<linux/gpu_buddy.h> and <drm/drm_device.h>.\n\n[ ... ]\n\n> @@ -60,6 +61,7 @@\n>  #include <linux/file.h>\n>  #include <linux/firmware.h>\n>  #include <linux/fs.h>\n> +#include <linux/hash.h>\n>  #include <linux/i2c.h>\n\nThe commit message mentions adding bindings for crypto/hash.h.  Is the\naddition of linux/hash.h intended here?\n\nIt doesn't appear that utilities from linux/hash.h are being used, which\ncould unnecessarily increase bindgen execution time and pollute the\nRust namespace.\n\n> diff --git a/rust/helpers/helpers.c b/rust/helpers/helpers.c\n> index 625921e27dfbc..6372e14f8419c 100644\n> --- a/rust/helpers/helpers.c\n> +++ b/rust/helpers/helpers.c\n> @@ -60,6 +60,7 @@\n>  #include \"dma-resv.c\"\n>  #include \"drm.c\"\n>  #include \"err.c\"\n> +#include \"hash.c\"\n>  #include \"irq.c\"\n>  #include \"fs.c\"\n>  #include \"gpu.c\"\n\nThis isn't a bug, but does inserting hash.c here also bypass alphabetical\nsorting?\n\nWhile it is placed before irq.c, both fs.c and gpu.c appear further down in\nthe existing list, so placing hash.c after gpu.c might keep this block more\nproperly ordered.","headers":{"Return-Path":"\n <linux-pci+bounces-54179-incoming=patchwork.ozlabs.org@vger.kernel.org>","X-Original-To":["incoming@patchwork.ozlabs.org","linux-pci@vger.kernel.org"],"Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256\n header.s=k20201202 header.b=nHv5SGGl;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c04:e001:36c::12fc:5321; helo=tor.lore.kernel.org;\n envelope-from=linux-pci+bounces-54179-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)","smtp.subspace.kernel.org;\n\tdkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org\n header.b=\"nHv5SGGl\"","smtp.subspace.kernel.org;\n arc=none smtp.client-ip=10.30.226.201"],"Received":["from tor.lore.kernel.org (tor.lore.kernel.org\n [IPv6:2600:3c04:e001:36c::12fc:5321])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4gBZhc6RkJz1yCg\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 08 May 2026 13:43:12 +1000 (AEST)","from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby tor.lore.kernel.org (Postfix) with ESMTP id DF5683035AAE\n\tfor <incoming@patchwork.ozlabs.org>; Fri,  8 May 2026 03:43:10 +0000 (UTC)","from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id EA378308F07;\n\tFri,  8 May 2026 03:43:09 +0000 (UTC)","from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org\n [10.30.226.201])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id C79F165192\n\tfor <linux-pci@vger.kernel.org>; Fri,  8 May 2026 03:43:09 +0000 (UTC)","by smtp.kernel.org (Postfix) with ESMTPSA id 58D6DC2BCB0;\n\tFri,  8 May 2026 03:43:09 +0000 (UTC)"],"ARC-Seal":"i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1778211789; cv=none;\n b=V7CGlPMxdbvS/T0SycUoIGO49F5KhQpzN4Y6+IAEdptMseUUWcMBEs/Qp1/NWq/NCjum7vQ0MG7GxmzLk61PviZfQ/A8L3dX2t87mYxchbRNmvTozX1WKZqaHowcIV8RGbT1peQbd93bTnrvuaYMKCo3i9DIt2VkPh7P01W/+iQ=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1778211789; c=relaxed/simple;\n\tbh=e648FWE7GOnQcDzOwhFweU4Cuje+PbzlCVNdyxsRpds=;\n\th=From:Subject:To:Cc:In-Reply-To:References:Content-Type:Date:\n\t Message-Id;\n b=KVOf5ezenM6l+nW9CByWfN8gONu/Uasgrqqh6MCpqjewavODb2qnl1HW5CIAAMF+33MQ63C/yYRhQkGnqdEGko6oNiWMGJIfgrMNAZBO3t0UPB434I95WWSXw8BgnazwumSR7MEXYXn6hJQwrWMx5Km6QH5pSdtg2oJ/qPBBO2Q=","ARC-Authentication-Results":"i=1; smtp.subspace.kernel.org;\n dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org\n header.b=nHv5SGGl; arc=none smtp.client-ip=10.30.226.201","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;\n\ts=k20201202; t=1778211789;\n\tbh=e648FWE7GOnQcDzOwhFweU4Cuje+PbzlCVNdyxsRpds=;\n\th=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date:From;\n\tb=nHv5SGGlobC1+OcSWXc1wVCOJhfUgaXsFICvYy16eX43mOfaWuBXYYfhdLRuS+0Ax\n\t Ivd4TkYozqrGnEfdGhfnTRhWoMcXQyUt+JZc3pO2s1adfS+pk7vd8/RFFF+XSzJ4uQ\n\t GqxAMU9H1wJ90BkcxExzpMfXyVmHEJA9T1pxvad1ky5lXjoXD35AtHDp9b6brlvoHr\n\t xxjg/bOz32QpmjqavOgZu0ctz+uNe4JUdbJcRxJ1dzvR5E1dpQa6AOu0YCNHz8ONS6\n\t tU6dgxFpias40+fUU01DSq47TKG0tfkwYmXNKYh2yiMYpOfrkgKPpZ+ctbMOIFWfo9\n\t X/3UV3Gn8vOqA==","From":"sashiko-bot@kernel.org","Subject":"Re: [PATCH 05/18] rust: add bindings for hash.h","Reply-To":"sashiko@lists.linux.dev","To":"alistair23@gmail.com","Cc":"linux-pci@vger.kernel.org, ojeda@kernel.org","In-Reply-To":"<20260508031710.514574-6-alistair.francis@wdc.com>","References":"<20260508031710.514574-6-alistair.francis@wdc.com>","Content-Type":"text/plain; charset=utf-8","Content-Transfer-Encoding":"quoted-printable","Date":"Fri, 08 May 2026 03:43:08 +0000","Message-Id":"<20260508034309.58D6DC2BCB0@smtp.kernel.org>","Precedence":"bulk","X-Mailing-List":"linux-pci@vger.kernel.org","List-Id":"<linux-pci.vger.kernel.org>","List-Subscribe":"<mailto:linux-pci+subscribe@vger.kernel.org>","List-Unsubscribe":"<mailto:linux-pci+unsubscribe@vger.kernel.org>"}}]