Skip to content

Commit

Permalink
_format_message_dn(): fix infiniband dp formatting
Browse files Browse the repository at this point in the history
Coverity has correctly noted that despite its name,
efidp_infiniband.ioc_guid is not in fact a GUID, and can't be printed
like one.

This gets rid of the extra code.  I'm still not sure we're printing it
correctly, but until someone notices that we're not, that's probably
fine.

Signed-off-by: Peter Jones <pjones@redhat.com>
  • Loading branch information
vathpela committed Dec 8, 2021
1 parent 86cd1b4 commit 1b4d531
Showing 1 changed file with 8 additions and 23 deletions.
31 changes: 8 additions & 23 deletions src/dp-message.c
Original file line number Diff line number Diff line change
Expand Up @@ -333,29 +333,14 @@ _format_message_dn(unsigned char *buf, size_t size, const_efidp dp)
format(buf, size, off, "I2O", "I2O(%d)", dp->i2o.target);
break;
case EFIDP_MSG_INFINIBAND:
if (dp->infiniband.resource_flags &
EFIDP_INFINIBAND_RESOURCE_IOC_SERVICE) {
format(buf, size, off, "Infiniband",
"Infiniband(%08x,%"PRIx64"%"PRIx64",%"PRIx64",%"PRIu64",%"PRIu64")",
dp->infiniband.resource_flags,
dp->infiniband.port_gid[1],
dp->infiniband.port_gid[0],
dp->infiniband.service_id,
dp->infiniband.target_port_id,
dp->infiniband.device_id);
} else {
format(buf, size, off, "Infiniband",
"Infiniband(%08x,%"PRIx64"%"PRIx64",",
dp->infiniband.resource_flags,
dp->infiniband.port_gid[1],
dp->infiniband.port_gid[0]);
format_guid(buf, size, off, "Infiniband",
&dp->infiniband.ioc_guid);
format(buf, size, off, "Infiniband",
",%"PRIu64",%"PRIu64")",
dp->infiniband.target_port_id,
dp->infiniband.device_id);
}
format(buf, size, off, "Infiniband",
"Infiniband(%08x,%"PRIx64"%"PRIx64",%"PRIx64",%"PRIu64",%"PRIu64")",
dp->infiniband.resource_flags,
dp->infiniband.port_gid[1],
dp->infiniband.port_gid[0],
dp->infiniband.ioc_guid,
dp->infiniband.target_port_id,
dp->infiniband.device_id);
break;
case EFIDP_MSG_MAC_ADDR:
format(buf, size, off, "MAC", "MAC(");
Expand Down

0 comments on commit 1b4d531

Please sign in to comment.