From owner-freebsd-current@FreeBSD.ORG Thu Nov 13 03:44:18 2014 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2A183CB3; Thu, 13 Nov 2014 03:44:18 +0000 (UTC) Received: from mail-ig0-x22b.google.com (mail-ig0-x22b.google.com [IPv6:2607:f8b0:4001:c05::22b]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DC55F6C9; Thu, 13 Nov 2014 03:44:17 +0000 (UTC) Received: by mail-ig0-f171.google.com with SMTP id hl2so4270521igb.4 for ; Wed, 12 Nov 2014 19:44:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=xp2vOxpxr61sFNYeGprjcGU4tlh7GXBK5jfkZNMW9a0=; b=T1GG5QV7XyqgLM4cd70J/R5hl/N+D7yHXZoV8vhtiOPsoefJ7cPhFfBWKGDpUzvqx2 L0rFWTduuSZhPZ6Eo9Sr4l+ubDZkiYoeiSIZ/ePjuD6zlVH2HTjv3eV9Mi0kySBAXDQo EfUstjDyNKnOyTaoYE9XQmjZdek2boKsdlBuhfz88H1HJK9B0GNC/90j8olS30U/9K9e lmOCtx/nqWJw9CwGCB08Q71LADUfIl3c6k59+f81E6A7KmeBI2pWdm0GrrNksTF6r0zm HY4KqIAlb/xkhY/jstp+DAV/yD7TFN7FUh310wxOkgYmyolUi5KUmEkub2iYO2Nkowxt VfTA== MIME-Version: 1.0 X-Received: by 10.107.137.194 with SMTP id t63mr29423629ioi.52.1415850257034; Wed, 12 Nov 2014 19:44:17 -0800 (PST) Received: by 10.50.235.49 with HTTP; Wed, 12 Nov 2014 19:44:16 -0800 (PST) In-Reply-To: References: Date: Wed, 12 Nov 2014 19:44:16 -0800 Message-ID: Subject: Re: Minor bug in SCSI definition From: NGie Cooper To: "Rang, Anton" Content-Type: text/plain; charset=UTF-8 Cc: Scott Long , Alexander Motin , "freebsd-current@freebsd.org" , "Kenneth D. Merry" 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:44:18 -0000 On Wed, Nov 12, 2014 at 7:30 PM, Rang, Anton wrote: > 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 Coverity warnings. > > Anton > > Index: sys/cam/scsi/scsi_all.h > =================================================================== > --- 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) != 0) > +#define SID_QUAL_IS_VENDOR_UNIQUE(inq_data) ((SID_QUAL(inq_data) & 0x04) != 0) > u_int8_t dev_qual2; > #define SID_QUAL2 0x7F > #define SID_LU_CONG 0x40 CCing ken@/mav@/scottl@ -- thanks!