From patchwork Fri Jun 29 14:53:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 140627 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp1012691ljj; Fri, 29 Jun 2018 08:54:23 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcT2CX8jK4Je97+I/0Eo0u7gLp76r2EGB8FC58O0myk8uDPIi6cydJMDyCOCeKmld3p5wgE X-Received: by 2002:a0c:e847:: with SMTP id l7-v6mr3102160qvo.196.1530287663248; Fri, 29 Jun 2018 08:54:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530287663; cv=none; d=google.com; s=arc-20160816; b=Ye79hF4B4XRse02+tXxegP/9VYiew4i5i4QAksQtXxf8MmcyCYbiBy02NQm8R455Tu /HM09S4UH0CCWPVTEmqaHD7/awSmYLqC/heKF5MAe1AaPdg7aawWM++vEgLGVCRwYzkO gXbH7vbIus1O01SGLHHxl0+0rmfpjz4tnqlw5wqcqbdeA0SiddMno4d+fnBSBCyx7Cem msluGKkmTvG6CV/UXA0vR3wAF/iIZUd6+8A0aylgwc8rWTtC7x8n9qapVIikea9+agnZ dqBQ9iNq7lTxBSbA5NKoTZW1MeqLhfMCD8U0Us2K0mFjE+h1Y51Lia0gQRh+wd2gNy21 LNOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:arc-authentication-results; bh=QH6REC3t3Si5+2XHghNixjP2UgFza9U3Drkzre3NjYU=; b=RpPwiVBX06wl3hTr51kJrsa8NKC/PKacjcwwakGb3vsZGodcajKweYhL5k1IwFRFNR HBq6H8/t74gLi588gLri7FuEyNCZRjimbKlMyfBLc+ypHMRAh/JvuYa5kmiKjlKsS8Kb Z0n7FJYPd4CjFoeTRPB72nYuyYVgazrtmw6/ajVMdzR1RSvQ4+5fq0I0IOEb7D0/Lgde MFl2HpERtimVbzgCyt/dxUTHvJ7kP/GO4lRQls7bL3pZVttM+OFtsWvWIJAtkdxZpoI0 3Id0DtLkxB2NugH5Wtti6mik0tKPnbhBaMXO37Wwn49ALEUqfP04mYdqrwCh4xVGVrKs CqjQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id z10-v6si626600qvd.269.2018.06.29.08.54.23 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 29 Jun 2018 08:54:23 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:43101 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fYvj4-0005Zw-KJ for patch@linaro.org; Fri, 29 Jun 2018 11:54:22 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34303) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fYun9-0007tF-JZ for qemu-devel@nongnu.org; Fri, 29 Jun 2018 10:54:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fYun8-0007mT-Ly for qemu-devel@nongnu.org; Fri, 29 Jun 2018 10:54:31 -0400 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:43128) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fYun8-0007hP-E2 for qemu-devel@nongnu.org; Fri, 29 Jun 2018 10:54:30 -0400 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.89) (envelope-from ) id 1fYun7-0004pS-65 for qemu-devel@nongnu.org; Fri, 29 Jun 2018 15:54:29 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Date: Fri, 29 Jun 2018 15:53:41 +0100 Message-Id: <20180629145347.652-50-peter.maydell@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180629145347.652-1-peter.maydell@linaro.org> References: <20180629145347.652-1-peter.maydell@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:8b0:1d0::2 Subject: [Qemu-devel] [PULL 49/55] sd: Don't trace SDRequest crc field 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+patch=linaro.org@nongnu.org Sender: "Qemu-devel" We don't actually implement SD command CRC checking, because for almost all of our SD controllers the CRC generation is done in hardware, and so modelling CRC generation and checking would be a bit pointless. (The exception is that milkymist-memcard makes the guest software compute the CRC.) As a result almost all of our SD controller models don't bother to set the SDRequest crc field, and the SD card model doesn't check it. So the tracing of it in sdbus_do_command() provokes Coverity warnings about use of uninitialized data. Drop the CRC field from the trace; we can always add it back if and when we do anything useful with the CRC. Fixes Coverity issues 1386072, 1386074, 1386076, 1390571. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé Message-id: 20180626180324.5537-1-peter.maydell@linaro.org --- hw/sd/core.c | 2 +- hw/sd/trace-events | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) -- 2.17.1 diff --git a/hw/sd/core.c b/hw/sd/core.c index 820345f704b..107e6d71ddb 100644 --- a/hw/sd/core.c +++ b/hw/sd/core.c @@ -91,7 +91,7 @@ int sdbus_do_command(SDBus *sdbus, SDRequest *req, uint8_t *response) { SDState *card = get_card(sdbus); - trace_sdbus_command(sdbus_name(sdbus), req->cmd, req->arg, req->crc); + trace_sdbus_command(sdbus_name(sdbus), req->cmd, req->arg); if (card) { SDCardClass *sc = SD_CARD_GET_CLASS(card); diff --git a/hw/sd/trace-events b/hw/sd/trace-events index bfd1d62efcb..43cffab8b17 100644 --- a/hw/sd/trace-events +++ b/hw/sd/trace-events @@ -7,7 +7,7 @@ bcm2835_sdhost_edm_change(const char *why, uint32_t edm) "(%s) EDM now 0x%x" bcm2835_sdhost_update_irq(uint32_t irq) "IRQ bits 0x%x\n" # hw/sd/core.c -sdbus_command(const char *bus_name, uint8_t cmd, uint32_t arg, uint8_t crc) "@%s CMD%02d arg 0x%08x crc 0x%02x" +sdbus_command(const char *bus_name, uint8_t cmd, uint32_t arg) "@%s CMD%02d arg 0x%08x" sdbus_read(const char *bus_name, uint8_t value) "@%s value 0x%02x" sdbus_write(const char *bus_name, uint8_t value) "@%s value 0x%02x" sdbus_set_voltage(const char *bus_name, uint16_t millivolts) "@%s %u (mV)"