nvidia(ctrla081): print extra data if any byte is non-zero

This commit is contained in:
Matt Bilker
2023-02-07 05:49:47 +00:00
parent 1492be813b
commit d91bbc5e60

View File

@@ -80,10 +80,11 @@ impl fmt::Debug for NvA081CtrlVgpuInfo {
} else { } else {
&[] &[]
}; };
let vgpu_extra_params = self.vgpu_extra_params[..] let vgpu_extra_params = if self.vgpu_extra_params[..].iter().any(|&x| x != 0) {
.split(|&x| x == 0) &self.vgpu_extra_params[..]
.next() } else {
.unwrap_or(&[]); &[]
};
f.debug_struct("NvA081CtrlVgpuInfo") f.debug_struct("NvA081CtrlVgpuInfo")
.field("vgpu_type", &self.vgpu_type) .field("vgpu_type", &self.vgpu_type)