Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1545296ybh; Tue, 14 Jul 2020 00:10:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxSsTb2bvWjuriZoNE6yQv6vfqU5ObSQhtIL9dfW8ehV7B9Ao0voJytImz0Gz0LV8+6SEzP X-Received: by 2002:a05:6402:31ad:: with SMTP id dj13mr3129590edb.88.1594710643576; Tue, 14 Jul 2020 00:10:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594710643; cv=none; d=google.com; s=arc-20160816; b=lnmxM6cZum4iXy8Vw0AUOjpPzJyPGtML+zS84aXiud01N5EBX2cm2JAIYb9tH81sq5 Wqdso2RYu64F5NrCb6DOnoQtX4lkomEWhql+47IuCvGgE3TfGrKZ3caZleOjVpgYeclF 2neiTjHSPLT20fwZWiKKQfDxH+U9/8aUtpYDXUCeKPGfeq/a7I2YqNdXtxSoZ2PDatBd zXH1QXlgRSU+TS2V8SmNF+W4yd39zNnWLY0TV0+qv28dYYsm8bDjbjr5lQNUkXxZA2// 76J/SlEyrkEUBPtD58XFDvZNGPXR9/I5KhYSu2b7/A5Wmzvoc575Q2tzcd2sfiA9a4rd vNwA== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=lPkddj+gI5Ss0lSybc6XTaZ8ENoa6K4BxJoARfNYonI=; b=KkPI5dhZtvE+H8maq7U53tC/hxv7j1QWD69NmEbtkna/eYtpXss5vAO+MtL2nSPxok Wsr8v15vJEbYb0Yx8PgRoX+CCQs04r5rs8PUVC6fVItGfeimRgnBAEngdyXBgsfFHBSm GvKNhVSN+M+T2SlPWM1hq4j7EnP27Pyajbgmz4B5f7QBCIhCHtTYbnUsU5/gGbuqkpmd /kJ1YVrSM/jTiIi/3o5EW8OypKIQEE7xhkU3bgq7+vHwIU7sGT5ZQpm60vTY0J4b6gFJ 8oyg0OkvnZVIdFq2shhLm+auGn1pjYUYvUt1BlQSsMzfBgzKLK4xFVO/SdEHNsCKcZCx NuxA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v4si9858036ejx.555.2020.07.14.00.10.21; Tue, 14 Jul 2020 00:10:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727029AbgGNHIS (ORCPT + 99 others); Tue, 14 Jul 2020 03:08:18 -0400 Received: from mx2.suse.de ([195.135.220.15]:42754 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725925AbgGNHIR (ORCPT ); Tue, 14 Jul 2020 03:08:17 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 2DE6BB771; Tue, 14 Jul 2020 07:08:18 +0000 (UTC) Subject: Re: [PATCH v2 21/29] scsi: aic7xxx: aic7xxx_osm: Fix 'amount_xferred' set but not used issue To: Lee Jones , jejb@linux.ibm.com, martin.petersen@oracle.com Cc: linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, Hannes Reinecke , "Daniel M. Eischen" , Doug Ledford References: <20200713074645.126138-1-lee.jones@linaro.org> <20200713074645.126138-22-lee.jones@linaro.org> From: Hannes Reinecke Message-ID: <097d4f3f-3d98-4bdc-b31f-5276a8160539@suse.de> Date: Tue, 14 Jul 2020 09:08:14 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 In-Reply-To: <20200713074645.126138-22-lee.jones@linaro.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7/13/20 9:46 AM, Lee Jones wrote: > '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/aic7xxx_osm.c: In function ‘ahc_done’: > drivers/scsi/aic7xxx/aic7xxx_osm.c:1725:12: warning: variable ‘amount_xferred’ set but not used [-Wunused-but-set-variable] > 1725 | uint32_t amount_xferred; > | ^~~~~~~~~~~~~~ > > Cc: Hannes Reinecke > Cc: "Daniel M. Eischen" > Cc: Doug Ledford > Signed-off-by: Lee Jones > --- > drivers/scsi/aic7xxx/aic7xxx_osm.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/scsi/aic7xxx/aic7xxx_osm.c b/drivers/scsi/aic7xxx/aic7xxx_osm.c > index ed437c16de881..e7ccb8b80fc19 100644 > --- a/drivers/scsi/aic7xxx/aic7xxx_osm.c > +++ b/drivers/scsi/aic7xxx/aic7xxx_osm.c > @@ -1711,10 +1711,12 @@ ahc_done(struct ahc_softc *ahc, struct scb *scb) > */ > cmd->sense_buffer[0] = 0; > if (ahc_get_transaction_status(scb) == CAM_REQ_INPROG) { > +#ifdef AHC_REPORT_UNDERFLOWS > uint32_t amount_xferred; > > amount_xferred = > ahc_get_transfer_length(scb) - ahc_get_residual(scb); > +#endif > if ((scb->flags & SCB_TRANSMISSION_ERROR) != 0) { > #ifdef AHC_DEBUG > if ((ahc_debug & AHC_SHOW_MISC) != 0) { > Reviewed-by: Hannes Reinecke Cheers, Hannes -- Dr. Hannes Reinecke Teamlead Storage & Networking hare@suse.de +49 911 74053 688 SUSE Software Solutions GmbH, Maxfeldstr. 5, 90409 Nürnberg HRB 36809 (AG Nürnberg), Geschäftsführer: Felix Imendörffer