On Mon, Jun 16, 2025 at 11:44:02AM +0200, Jean Delvare wrote: > The presence of the device has already been tested before, so testing > it again for individual fields is redundant. > > Signed-off-by: Jean Delvare <jdelv...@suse.de>
Reviewed-by: Jerry Hoemann <jerry.hoem...@hpe.com> > --- > If we really wanted to test individual fields, then "Device Not > Present" wouldn't be the right thing to display anyway. If some of > the fields are set, then the device must be present. > > I tested this change on my collection of DMI table dumps and it made > no difference. > > This is a proposal, I will only commit this change if HPE is OK with > it. > > dmioem.c | 16 ++++------------ > 1 file changed, 4 insertions(+), 12 deletions(-) > > --- dmidecode.orig/dmioem.c > +++ dmidecode/dmioem.c > @@ -359,14 +359,6 @@ static void dmi_hp_203_assoc_hndl(const > pr_attr(fname, "0x%04X", num); > } > > -static void dmi_hp_203_pciinfo(const char *fname, u16 num) > -{ > - if (num == 0xFFFF) > - pr_attr(fname, "Device Not Present"); > - else > - pr_attr(fname, "0x%04x", num); > -} > - > static void dmi_hp_203_bayenc(const char *fname, u8 num) > { > switch (num) > @@ -1293,10 +1285,10 @@ static int dmi_decode_hp(const struct dm > } > else > { > - dmi_hp_203_pciinfo("PCI Vendor ID", WORD(data + > 0x08)); > - dmi_hp_203_pciinfo("PCI Device ID", WORD(data + > 0x0A)); > - dmi_hp_203_pciinfo("PCI Sub Vendor ID", > WORD(data + 0x0C)); > - dmi_hp_203_pciinfo("PCI Sub Device ID", > WORD(data + 0x0E)); > + pr_attr("PCI Vendor ID", "0x%04x", WORD(data + > 0x08)); > + pr_attr("PCI Device ID", "0x%04x", WORD(data + > 0x0A)); > + pr_attr("PCI Sub Vendor ID", "0x%04x", > WORD(data + 0x0C)); > + pr_attr("PCI Sub Device ID", "0x%04x", > WORD(data + 0x0E)); > pr_attr("PCI Class Code", "0x%02x", data[0x10]); > pr_attr("PCI Sub Class Code", "0x%02x", > data[0x11]); > } > > > -- > Jean Delvare > SUSE L3 Support -- ----------------------------------------------------------------------------- Jerry Hoemann Software Engineer Hewlett Packard Enterprise -----------------------------------------------------------------------------