From owner-freebsd-current@FreeBSD.ORG Thu Nov 13 03:30:45 2014 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1442CA86 for ; Thu, 13 Nov 2014 03:30:45 +0000 (UTC) Received: from mailuogwhop.emc.com (mailuogwhop.emc.com [168.159.213.141]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mailuogwprd01.lss.emc.com", Issuer "RSA Corporate Server CA v2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B771835F for ; Thu, 13 Nov 2014 03:30:44 +0000 (UTC) Received: from maildlpprd04.lss.emc.com (maildlpprd04.lss.emc.com [10.253.24.36]) by mailuogwprd01.lss.emc.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.0) with ESMTP id sAD3Ub37023288 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 12 Nov 2014 22:30:37 -0500 X-DKIM: OpenDKIM Filter v2.4.3 mailuogwprd01.lss.emc.com sAD3Ub37023288 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=isilon.com; s=jan2013; t=1415849437; bh=ZDW5xhesU7Ohy25VvXbgQ89t4CQ=; h=From:To:Subject:Date:Message-ID:Content-Type:MIME-Version; b=EgUbn3X+m78M5A5QLxodUl9OvhaywxalHydDXLXpAviG9i4Aw4MSeLtTJ0YZrI19B ERoj7KZkBX2esYXrOpi1x94VXlzrMw5U7HvxwMlAfc14tgbFktqiMOLRgdDWWqHkXv RZ/Kr6PsTFY2qEG/vvdcR0tHUpTVENe5nx398ZS4= X-DKIM: OpenDKIM Filter v2.4.3 mailuogwprd01.lss.emc.com sAD3Ub37023288 Received: from mailusrhubprd53.lss.emc.com (mailusrhubprd53.lss.emc.com [10.106.48.18]) by maildlpprd04.lss.emc.com (RSA Interceptor) for ; Wed, 12 Nov 2014 22:30:07 -0500 Received: from mxhub22.corp.emc.com (mxhub22.corp.emc.com [128.222.70.134]) by mailusrhubprd53.lss.emc.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.0) with ESMTP id sAD3UOSD002463 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=FAIL) for ; Wed, 12 Nov 2014 22:30:24 -0500 Received: from MXHUB108.corp.emc.com (10.253.58.24) by mxhub22.corp.emc.com (128.222.70.134) with Microsoft SMTP Server (TLS) id 8.3.327.1; Wed, 12 Nov 2014 22:30:23 -0500 Received: from MX104CL01.corp.emc.com ([169.254.7.35]) by MXHUB108.corp.emc.com ([10.253.58.24]) with mapi id 14.03.0195.001; Wed, 12 Nov 2014 22:30:23 -0500 From: "Rang, Anton" To: "freebsd-current@freebsd.org" Subject: Minor bug in SCSI definition Thread-Topic: Minor bug in SCSI definition Thread-Index: Ac/+8bm7L6SD3RGAR7mfJJ6wuTR2AA== Date: Thu, 13 Nov 2014 03:30:23 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.13.46.243] MIME-Version: 1.0 X-Sentrion-Hostname: mailusrhubprd53.lss.emc.com X-RSA-Classifications: Source Code, public Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Nov 2014 03:30:45 -0000 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