nvidia(ctrla082): print whole signature if any byte is non-zero

This commit is contained in:
Matt Bilker
2023-02-06 01:57:38 +00:00
parent 6200b6b341
commit 46dee6336c

View File

@@ -43,10 +43,11 @@ pub struct NvA082CtrlCmdHostVgpuDeviceGetVgpuTypeInfoParams {
impl fmt::Debug for NvA082CtrlCmdHostVgpuDeviceGetVgpuTypeInfoParams {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
let vgpu_signature = self.vgpu_signature[..]
.split(|&x| x == 0)
.next()
.unwrap_or(&[]);
let vgpu_signature = if self.vgpu_signature[..].iter().any(|&x| x != 0) {
&self.vgpu_signature[..]
} else {
&[]
};
let vgpu_extra_params = self.vgpu_extra_params[..]
.split(|&x| x == 0)
.next()