Re: [PATCH 5/9] gpu: nova-core: gsp: add types for RM control RPCs
From: Eliot Courtney
Date: Mon Mar 16 2026 - 07:45:56 EST
On Tue Mar 10, 2026 at 6:45 AM JST, Joel Fernandes wrote:
> On Fri, 27 Feb 2026, Eliot Courtney wrote:
> [..]
>> +/// Command code for RM control RPCs sent using [`MsgFunction::GspRmControl`].
>> +#[derive(Copy, Clone, Debug, PartialEq)]
>> +#[repr(u32)]
>> +pub(crate) enum RmControlMsgFunction {
>> + /// Get the CE fault method buffer size.
>> + CeGetFaultMethodBufferSize = bindings::NV2080_CTRL_CMD_CE_GET_FAULT_METHOD_BUFFER_SIZE,
>> +}
>> +
>> +impl TryFrom<u32> for RmControlMsgFunction {
>> + type Error = kernel::error::Error;
>> +
>> + fn try_from(value: u32) -> Result<Self> {
>
> Other similar impls in the driver carry a TODO[FPRI] comment. Please add one
> above this impl:
>
> // TODO[FPRI]: replace with `FromPrimitive`.
>
>> + match value {
>> + bindings::NV2080_CTRL_CMD_CE_GET_FAULT_METHOD_BUFFER_SIZE => {
>> + Ok(Self::CeGetFaultMethodBufferSize)
>> + }
>> + _ => Err(EINVAL),
>> + }
>> + }
>> +}
Will do, thanks.
>
> Nit: the braces around the single-expression match arm are unnecessary:
>
> match value {
> bindings::NV2080_CTRL_CMD_CE_GET_FAULT_METHOD_BUFFER_SIZE =>
> Ok(Self::CeGetFaultMethodBufferSize),
> _ => Err(EINVAL),
> }
>
> thanks,
This does not pass rustfmtcheck, probably because rustfmt wants braces
on multilines like this.