On Thu, 2022-02-17 at 20:55 +0100, mwilck@xxxxxxxx wrote: > From: Martin Wilck <mwilck@xxxxxxxx> > > We categorized protocols by bus/proto_id, while we only differentiate > protocol IDs for SCSI. Allow transforming this into a linear sequence > of bus/protocol IDs by having non-SCSI first, and follwing up with > the different SCSI protocols. > > Signed-off-by: Martin Wilck <mwilck@xxxxxxxx> > --- > libmultipath/structs.c | 10 ++++++++++ > libmultipath/structs.h | 13 +++++++++++-- > 2 files changed, 21 insertions(+), 2 deletions(-) > > diff --git a/libmultipath/structs.c b/libmultipath/structs.c > index 17f4baf..5849bf1 100644 > --- a/libmultipath/structs.c > +++ b/libmultipath/structs.c > @@ -753,3 +753,13 @@ out: > > return 0; > } > + > +unsigned int bus_protocol_id(const struct path *pp) { > + if (!pp || pp->bus < 0 || pp->bus > SYSFS_BUS_SCSI) > + return SYSFS_BUS_UNDEF; > + if (pp->bus != SYSFS_BUS_SCSI) > + return pp->bus; > + if (pp->sg_id.proto_id < 0 || pp->sg_id.proto_id It turns out that ^^^^^^^^^^^^^^^^^^ this comparison causes an error with clang 3.5, and possibly other compilers, because they use an unsigned int type for sg_id.proto_id. Because some compilers will use "int", instead of dropping the test, I'll just add a cast to (int). Regards Martin -- dm-devel mailing list dm-devel@xxxxxxxxxx https://listman.redhat.com/mailman/listinfo/dm-devel