From patchwork Mon Jul 13 08:00:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 235346 Delivered-To: patch@linaro.org Received: by 2002:a92:d244:0:0:0:0:0 with SMTP id v4csp2617259ilg; Mon, 13 Jul 2020 01:00:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyq1D0AfyRd/VH4Fb17hJ7bh5Qjcj4MWqfH3mFap6vMRPruVnLvfqN46dGF6obs4b+LFt9E X-Received: by 2002:a17:906:f183:: with SMTP id gs3mr68706937ejb.361.1594627253963; Mon, 13 Jul 2020 01:00:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594627253; cv=none; d=google.com; s=arc-20160816; b=D0MFrZLOndfylQ6HAAi6FPisPe4xWISG3J7YXmjr2Uj24FRX0/0H0XFv6eFUFFl8RD O7jZlM1UCW6UMLUdRO2MPa2fxVGeLdO89Kog6gnOf9c2N4EX7AWZ8A0bivz3UWl6D/Ot SjmOvwdgvsBXGmlMIn194M/mv6lWAiiaK0QzpIewh9Zwj8hcXXUhq2rMwHjWCAeKVHG/ JcQmINb1ZGU7W4+NfDeRKpWv2KRUcb9JOhvBm+G+XDzAjJYs36GRROxo1d5tvT2Y9Z+Z vFHWPDvuz8bSLHJ/NNN/PHgdMvUlSk5iWCL6A0wQ4uCn66OLsYBrQVgxUIJjqxlVjCQC EIPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=XXWcsoi+xGgOcFmbeWP75diSxyhw0hWfzUHSepxSy6k=; b=CLBLCr498cUJcxbxp4o+i96ZNYzfqHKcIw1cZBYBiFexT2Vvs9AtXpJg1j5n3+ZlE5 q4xF5I7+eXFqA4NuqkbiJEDtgqKJz5ZysB0jr1VCnpVqG9b6edCNtoCUyewfULXQeXBb qXCDnRDXr6/8YUrz6HrNbb4WYA5p0nQ59cAfY0KMRsemvYwP5EWPHd9TG4zsF7P4k8A1 YZc3Njq6G5I2xRqcge/qWtwhZh+cSzR2RK4y1rdVkl03FnKWBca2iuNLzP+5LOwkAA1D sO+GQbvflmQDmW7xSNCoA6Kq9FpWDU+r6o17rCslQRaZikbfo+hn+jmu72tk0IpwABOE MBSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=g5RssAEy; spf=pass (google.com: domain of linux-scsi-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-scsi-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id me11si8649646ejb.458.2020.07.13.01.00.53 for ; Mon, 13 Jul 2020 01:00:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-scsi-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=g5RssAEy; spf=pass (google.com: domain of linux-scsi-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-scsi-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729412AbgGMIAf (ORCPT ); Mon, 13 Jul 2020 04:00:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52602 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729410AbgGMIAf (ORCPT ); Mon, 13 Jul 2020 04:00:35 -0400 Received: from mail-wr1-x443.google.com (mail-wr1-x443.google.com [IPv6:2a00:1450:4864:20::443]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B259CC061755 for ; Mon, 13 Jul 2020 01:00:34 -0700 (PDT) Received: by mail-wr1-x443.google.com with SMTP id f7so14763821wrw.1 for ; Mon, 13 Jul 2020 01:00:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=XXWcsoi+xGgOcFmbeWP75diSxyhw0hWfzUHSepxSy6k=; b=g5RssAEyVWSu9L06I2k7D7WofbgEQJ8+Fjgyt22YJ6NMm0i+3Pac++WSxZ543qhSQJ f1b4YPSM40MFF6z2/hcBwuZ2YZ5SkVFzJZzXrAMYkxdzxogel0GfMUq7rx9Jvn7o1ZJp NtDW9QxqFGW7sAmX8FZx6NfNtvJJkuGQbZpFxupI9x/VqMQaBFlmnrnDs4CEIzaBE5eM e0J5uMapfLs1KlPpwS6JA123vI6gkoqlYP76ByAefa/FOJkUtevNR6buaCTVZGfKufZL xfz6sTNyu2HZjmKnrhKM3cjc1Tf5hFB+SYpG7KhwpYOTz3bvOCSYBpVcDH69EsdNtaHj NjTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=XXWcsoi+xGgOcFmbeWP75diSxyhw0hWfzUHSepxSy6k=; b=iI0WQkMgEiYyri2/zLWaSUoYkHvgYQRGWryvwByPkorUzm96KvElWmPLUZUfKWElFc PlNxACwztKnuHaxGWrvW9VMDV4EDmPc7SC5jgI2bVE1C+QEcyQ2XjQLopI8bGByeEJDN qwtY0V+V04voViNObhuYAArWXYlcTrhwuab3nyqeVCSMw+sa2TI+s/oTFIOHRLydvRX0 2Ay3NI87q0eIuWOYJpX3O/ah9km0k7llW1oNvgSVgFWotn5k+zXPnXl/HEuq/LRRSc23 OuznH/+9RoPJ0dQzgqZBQYU8Gu/K0bIHWIztkOjGcRK6tiQKubwDI3ljE7RCupTBY4Il Cvcw== X-Gm-Message-State: AOAM532tNUtUAp9OkYZ0Frm+pgghOpfctrlgpp0GFft5V36bL2226aD3 6BGWl+6yjHVeV7trWt33RI7Eeg== X-Received: by 2002:adf:f14e:: with SMTP id y14mr78388722wro.151.1594627233468; Mon, 13 Jul 2020 01:00:33 -0700 (PDT) Received: from localhost.localdomain ([2.31.163.6]) by smtp.gmail.com with ESMTPSA id 33sm24383549wri.16.2020.07.13.01.00.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jul 2020 01:00:32 -0700 (PDT) From: Lee Jones To: jejb@linux.ibm.com, martin.petersen@oracle.com Cc: linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, Lee Jones , Hannes Reinecke Subject: [PATCH v2 23/24] scsi: aic7xxx: aic79xx_osm: Fix 'amount_xferred' set but not used issue Date: Mon, 13 Jul 2020 09:00:00 +0100 Message-Id: <20200713080001.128044-24-lee.jones@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200713080001.128044-1-lee.jones@linaro.org> References: <20200713080001.128044-1-lee.jones@linaro.org> MIME-Version: 1.0 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org 'amount_xferred' is used, but only in certain circumstances. Place the same stipulations on the defining/allocating of 'amount_xferred' as is placed when using it. We've been careful not to change any of the ordering semantics here. Fixes the following W=1 kernel build warning(s): drivers/scsi/aic7xxx/aic79xx_osm.c: In function ‘ahd_done’: drivers/scsi/aic7xxx/aic79xx_osm.c:1796:12: warning: variable ‘amount_xferred’ set but not used [-Wunused-but-set-variable] Cc: Hannes Reinecke Signed-off-by: Lee Jones --- drivers/scsi/aic7xxx/aic79xx_osm.c | 2 ++ 1 file changed, 2 insertions(+) -- 2.25.1 Reviewed-by: Hannes Reinecke diff --git a/drivers/scsi/aic7xxx/aic79xx_osm.c b/drivers/scsi/aic7xxx/aic79xx_osm.c index 8e43ff86e0a60..3782a20d58885 100644 --- a/drivers/scsi/aic7xxx/aic79xx_osm.c +++ b/drivers/scsi/aic7xxx/aic79xx_osm.c @@ -1787,10 +1787,12 @@ ahd_done(struct ahd_softc *ahd, struct scb *scb) */ cmd->sense_buffer[0] = 0; if (ahd_get_transaction_status(scb) == CAM_REQ_INPROG) { +#ifdef AHD_REPORT_UNDERFLOWS uint32_t amount_xferred; amount_xferred = ahd_get_transfer_length(scb) - ahd_get_residual(scb); +#endif if ((scb->flags & SCB_TRANSMISSION_ERROR) != 0) { #ifdef AHD_DEBUG if ((ahd_debug & AHD_SHOW_MISC) != 0) {