Date: Thu, 13 Nov 2014 03:30:23 +0000 From: "Rang, Anton" <anton.rang@isilon.com> To: "freebsd-current@freebsd.org" <freebsd-current@freebsd.org> Subject: Minor bug in SCSI definition Message-ID: <F21EDC44C64DB34B90AF485AC3CEDD4B3548AFDD@MX104CL01.corp.emc.com>
next in thread | raw e-mail | index | archive | help
Coverity found an issue in this area which I tracked down to the incorrect = definition patched below. The SID_QUAL macro is (((inq_data)->device & 0xE0) >> 5) which extracts the= peripheral qualifier. Per SCSI-2 (draft 10L) table 46, the vendor-specific values are "1XXb". This probably affects almost nobody, but it will clear up a couple of Cover= ity warnings. Anton Index: sys/cam/scsi/scsi_all.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sys/cam/scsi/scsi_all.h (revision 274352) +++ sys/cam/scsi/scsi_all.h (working copy) @@ -1817,7 +1817,7 @@ * reserved for = this peripheral * qualifier. */ -#define SID_QUAL_IS_VENDOR_UNIQUE(inq_data) ((SID_QUAL(inq_data) = & 0x08) !=3D 0) +#define SID_QUAL_IS_VENDOR_UNIQUE(inq_data) ((SID_QUAL(inq_data) &= 0x04) !=3D 0) u_int8_t dev_qual2; #define SID_QUAL2 0x7F #define SID_LU_CONG 0x40
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?F21EDC44C64DB34B90AF485AC3CEDD4B3548AFDD>