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

This commit is contained in:
Matt Bilker
2023-02-06 01:57:13 +00:00
parent 59660e42f8
commit 6200b6b341

View File

@@ -76,10 +76,11 @@ pub struct NvA081CtrlCmdVgpuConfigGetMigrationCapParams {
impl fmt::Debug for NvA081CtrlVgpuInfo {
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()