HomeFreeBSD

ctl: Avoid an upcast for calling ctl_scsi_path_string

Description

ctl: Avoid an upcast for calling ctl_scsi_path_string

Change the first argument of ctl_scsi_path_string to be the embedded
header structure instead of the union. Currently union ctl_io and
struct ctl_scsiio have the same alignment, but this changes on i386 if
a new union member is added that contains a uint64_t member (such as
an embedded struct nvme_command for NVMeoF). In that case, union
ctl_io requires stronger alignment, so the upcast from struct
ctl_scsiio to union ctl_io in ctl_scsi_sense_sbuf raises an increasing
alignment warning on i386.

Avoid the warning by passing struct ctl_io_hdr as the first argument
to ctl_scsi_path_string instead.

Reviewed by: imp
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D44716

(cherry picked from commit 352cf4a64adf117a8a0cf23a20b8de4990b2ba22)

Details

Provenance
jhbAuthored on May 2 2024, 11:30 PM
Reviewer
imp
Differential Revision
D44716: ctl: Avoid an upcast for calling ctl_scsi_path_string
Parents
rG03094f3700be: if_ovpn: add interface counters
Branches
Unknown
Tags
Unknown