From nobody Sat Feb 7 06:55:31 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1505824664392531.1580573688627; Tue, 19 Sep 2017 05:37:44 -0700 (PDT) Received: from localhost ([::1]:42597 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1duHmZ-0001au-M6 for importer@patchew.org; Tue, 19 Sep 2017 08:37:43 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59734) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1duHf7-0003oG-Iu for qemu-devel@nongnu.org; Tue, 19 Sep 2017 08:30:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1duHf3-0005Fa-IZ for qemu-devel@nongnu.org; Tue, 19 Sep 2017 08:30:01 -0400 Received: from mail-wr0-x241.google.com ([2a00:1450:400c:c0c::241]:36437) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1duHf3-0005FH-Cs for qemu-devel@nongnu.org; Tue, 19 Sep 2017 08:29:57 -0400 Received: by mail-wr0-x241.google.com with SMTP id g50so2141046wra.3 for ; Tue, 19 Sep 2017 05:29:57 -0700 (PDT) Received: from 640k.lan (dynamic-adsl-78-12-246-117.clienti.tiscali.it. [78.12.246.117]) by smtp.gmail.com with ESMTPSA id k18sm1292878wmd.22.2017.09.19.05.29.55 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Sep 2017 05:29:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=11aFFIPDSVuui9gVJBpE1N2363pWs7gwVNlEkLWiRys=; b=EsR6QjbZJ4OoQEaownJZgGqAbLZRE9QtnQKrK3I0i4QrXIHdyFRU/dKYcxJ/K7f3Uf k648C7DQdSXdXPOvXuTMTl7tadMvWfoYk9f7sNF4+qO8VIAv50f/VOWieHjfnzD2wFjG 4tvqEM6/8K0Figib1O4lwMxaqhP7/AjaNY0PCDmjCv0VZ4QVySF9D44+2WtDWHcOjrzW 9er2HmmvkXoH555KWJI0ghryvtMCGgvtPwRtt/mkx8Bzi37tODJEBu47baLPyRcN6rAX egtLXoVQFhoxjYnsh3g2fJ3u9T6qfJLGycdzWiU/GhkXC2pB0iwMoKMgPIsEqeYMamgb APzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=11aFFIPDSVuui9gVJBpE1N2363pWs7gwVNlEkLWiRys=; b=M6aj0E9IHBB8UeH0rFhVLfYHg3exj3llBglTRnyADK3huueQw7SbnnKxJuuLke4nyx fcYI4YQEYBks/FjjtpSzI4WBDXl425cH1WuO1XQiwjg6yHii0PbTzexc3va5bDNH7300 PhUDBYFjHF6FLPuHy6KPGUEMZoHHdmC4NMzE0+RakrJ2lQlKOpyc83OFZa7YnL6WchyI yeggPciaQEp0z+eNz3pjDyd4NpTaJ+V9YJKLrM/nUlnVmrOPLPJOZ5as/eGEbYgR92DI 4dQhT+kiEI2XKZZv2jpQW1o5l1j2Ndtq+lXLnrPzTa5RcAd06jrlgrkU5vVgs3PS4C1W PgQg== X-Gm-Message-State: AHPjjUjrNBDIQXfRpj7ihgfh0ymfVv7376T9fRAQSuwrmS3km0ZvPVo0 Y2JrNPNMX//K8O1M8nEFsYZRhoG8 X-Google-Smtp-Source: AOwi7QBhpZjyy+GYWJTyTVeB/moPCtOGmr7fjq8B5QZCbyGRY/YRQ/g4xNrVEz6SUvBJE/NNFJ+aew== X-Received: by 10.223.184.181 with SMTP id i50mr1240253wrf.136.1505824196093; Tue, 19 Sep 2017 05:29:56 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 19 Sep 2017 14:29:01 +0200 Message-Id: <1505824179-21541-13-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1505824179-21541-1-git-send-email-pbonzini@redhat.com> References: <1505824179-21541-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::241 Subject: [Qemu-devel] [PULL 12/50] scsi: rename scsi_build_sense to scsi_convert_sense X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 After introducing the scsi/ subdirectory, there will be a scsi_build_sense function that is the same as scsi_req_build_sense but without needing a SCSIRequest. The existing scsi_build_sense function gets in the way, remove it. Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Paolo Bonzini --- hw/scsi/scsi-bus.c | 10 +++++----- hw/scsi/scsi-disk.c | 4 ++-- include/hw/scsi/scsi.h | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/hw/scsi/scsi-bus.c b/hw/scsi/scsi-bus.c index ade31c1..fac360e 100644 --- a/hw/scsi/scsi-bus.c +++ b/hw/scsi/scsi-bus.c @@ -790,7 +790,7 @@ int scsi_req_get_sense(SCSIRequest *req, uint8_t *buf, = int len) return 0; } =20 - ret =3D scsi_build_sense(req->sense, req->sense_len, buf, len, true); + ret =3D scsi_convert_sense(req->sense, req->sense_len, buf, len, true); =20 /* * FIXME: clearing unit attention conditions upon autosense should be = done @@ -811,7 +811,7 @@ int scsi_req_get_sense(SCSIRequest *req, uint8_t *buf, = int len) =20 int scsi_device_get_sense(SCSIDevice *dev, uint8_t *buf, int len, bool fix= ed) { - return scsi_build_sense(dev->sense, dev->sense_len, buf, len, fixed); + return scsi_convert_sense(dev->sense, dev->sense_len, buf, len, fixed); } =20 void scsi_req_build_sense(SCSIRequest *req, SCSISense sense) @@ -1531,12 +1531,12 @@ const struct SCSISense sense_code_SPACE_ALLOC_FAILE= D =3D { }; =20 /* - * scsi_build_sense + * scsi_convert_sense * * Convert between fixed and descriptor sense buffers */ -int scsi_build_sense(uint8_t *in_buf, int in_len, - uint8_t *buf, int len, bool fixed) +int scsi_convert_sense(uint8_t *in_buf, int in_len, + uint8_t *buf, int len, bool fixed) { bool fixed_in; SCSISense sense; diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c index cf38f93..990ba04 100644 --- a/hw/scsi/scsi-disk.c +++ b/hw/scsi/scsi-disk.c @@ -1987,8 +1987,8 @@ static int32_t scsi_disk_emulate_command(SCSIRequest = *req, uint8_t *buf) break; case REQUEST_SENSE: /* Just return "NO SENSE". */ - buflen =3D scsi_build_sense(NULL, 0, outbuf, r->buflen, - (req->cmd.buf[1] & 1) =3D=3D 0); + buflen =3D scsi_convert_sense(NULL, 0, outbuf, r->buflen, + (req->cmd.buf[1] & 1) =3D=3D 0); if (buflen < 0) { goto illegal_request; } diff --git a/include/hw/scsi/scsi.h b/include/hw/scsi/scsi.h index 6b85786..6ef67fb 100644 --- a/include/hw/scsi/scsi.h +++ b/include/hw/scsi/scsi.h @@ -244,8 +244,8 @@ extern const struct SCSISense sense_code_SPACE_ALLOC_FA= ILED; uint32_t scsi_data_cdb_xfer(uint8_t *buf); uint32_t scsi_cdb_xfer(uint8_t *buf); int scsi_cdb_length(uint8_t *buf); -int scsi_build_sense(uint8_t *in_buf, int in_len, - uint8_t *buf, int len, bool fixed); +int scsi_convert_sense(uint8_t *in_buf, int in_len, + uint8_t *buf, int len, bool fixed); =20 SCSIRequest *scsi_req_alloc(const SCSIReqOps *reqops, SCSIDevice *d, uint32_t tag, uint32_t lun, void *hba_private); --=20 1.8.3.1