Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp9737669imu; Wed, 5 Dec 2018 09:25:34 -0800 (PST) X-Google-Smtp-Source: AFSGD/XovNuiZ/l28/X2AqpwzPabNngv4Y9YL+M7pd0Glw3xET98X+bbMUqoOqiRwMsU7bsA1Sql X-Received: by 2002:a17:902:128c:: with SMTP id g12mr24019998pla.146.1544030734512; Wed, 05 Dec 2018 09:25:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544030734; cv=none; d=google.com; s=arc-20160816; b=d1nyE962rEa6rS13vtGca6kTn5qIEjR0/aWwK52ZhOdwHwHvydO51+tWjjHq5NPe64 HQMrnQanY2eddiKwszT0oMtkKSXXeYHbqsIe2ocya0EYAH4FskDETLw8HHpakq1dpaDF /1hdar5CUVtix8oKyvdCGekUbUo9jXYLo+mSJHIH9bSn1i3qp8h6DpZPzlgTScQxuVRn YXOtjsexUyrV5kCf1+f3dQ+OdfUhOcJo9PTwsDSmUItKrhumttHvki0GTuwHDuSbQN4p 9mCrkEm431qJ4NohsDE05v2rkwE0M8AqRLa4hP1EOWxAV+PNpNP3ke5FJXKKTEJEf6SZ DocQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=zJIU5qPm0FWz6VlyDVJI6HhxPQrbh3vWQhdmJaDqXII=; b=mFaalX0TebV90x4szLTeiEdO30y0R9jaIPrrNICQMwcEliUcP2irvLfFngvD7bl5RF 8FSUnF2+zQjEJbp9NjxyhTP+d9WcrPaRwRDCULVQa71FlM8w8hFCYiFK2XzagAG18oFm 28TMxQUyuRMq9Y5AK7uiKMcKVmz9GX4H++WDjI5XUHkP0nU6NSqUb2kDerLFR0fHBtZi O9SVDRWktZ7ZD7OdCH3HLkgJBRcGIIC9HIsONPFyPtq9UfCUAkwSkGx8OqYCwrH2EkV4 gTEtopABdxmj55FLwoSEpeIhyToTFxw0lPxclXPYc29ucSFumaCAOvfipCgCRXj7Xec/ PzIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ago62cqj; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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. [209.132.180.67]) by mx.google.com with ESMTP id t63si18360226pgd.78.2018.12.05.09.25.19; Wed, 05 Dec 2018 09:25:34 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ago62cqj; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 S1728034AbeLERY3 (ORCPT + 99 others); Wed, 5 Dec 2018 12:24:29 -0500 Received: from mail-it1-f194.google.com ([209.85.166.194]:50977 "EHLO mail-it1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727804AbeLERY3 (ORCPT ); Wed, 5 Dec 2018 12:24:29 -0500 Received: by mail-it1-f194.google.com with SMTP id z7so22591970iti.0 for ; Wed, 05 Dec 2018 09:24:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=zJIU5qPm0FWz6VlyDVJI6HhxPQrbh3vWQhdmJaDqXII=; b=ago62cqjasKEph8jw6fM4KZisk1vJjJIjahBE4+/dyxc3gT7rtjWjC7pF17I7qFK3U A9b3rcDm/sJdTEiAJu8W3tDpX2TukaU60/ji5yHcGcif27VyGZqePxtJhEYD/qn7x/+4 cmwcCjKK/VMRxDTnZKldfbE6P34E6btP6VrwU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=zJIU5qPm0FWz6VlyDVJI6HhxPQrbh3vWQhdmJaDqXII=; b=jNh7dA6CXfMEvs6BYH+RcTaaf7QRmuGHyETyUcNW2gzCft5Jv3hszu+3NRivdPNgYN xROKbDFbo7KMCEd1ByvqFp66fekh1TE/NJ2meqvSdyoGxhpCJOy3fdyHyMlnFu10/kR5 RTfaMeMINfzdKNTxX0EGzH3S5em5DIPGvM9m9aEOv90UJ71UXXPEv5uNge1rNBtoE0be eCxSmCpOlWrBvSPvFMfSOvl63KsH42DDFfg0tDrOVPoXqWVP3d+fqkwTnkTTXWBv3p/N W7lRasESGq8ADnTb3/qCbgdJTGYbc3SfjhLs9bk0zWXmxRC9cbmnU/PF0byt6Ml+cBtY EMRg== X-Gm-Message-State: AA+aEWZZ7DROE0f2Z5GuC6UteIwwLbFawVqfIk96xn+PwwLOoq9nFf9i oZUHiZlPgBE/fU5nDMHMND4xrV25doZ/JBOKb+nJ9g== X-Received: by 2002:a05:660c:34f:: with SMTP id b15mr16466076itl.146.1544030668000; Wed, 05 Dec 2018 09:24:28 -0800 (PST) MIME-Version: 1.0 References: <1543653585-108277-1-git-send-email-yuehaibing@huawei.com> In-Reply-To: <1543653585-108277-1-git-send-email-yuehaibing@huawei.com> From: Mathieu Poirier Date: Wed, 5 Dec 2018 10:24:16 -0700 Message-ID: Subject: Re: [PATCH -next] coresight: stm: remove set but not used variable 'res_size' To: yuehaibing@huawei.com Cc: "Suzuki K. Poulose" , Alexander Shishkin , Maxime Coquelin , Alexandre TORGUE , linux-arm-kernel , linux-stm32@st-md-mailman.stormreply.com, Linux Kernel Mailing List , kernel-janitors@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 1 Dec 2018 at 01:31, YueHaibing wrote: > > Fixes gcc '-Wunused-but-set-variable' warning: > > drivers/hwtracing/coresight/coresight-stm.c: In function 'stm_probe': > drivers/hwtracing/coresight/coresight-stm.c:796:9: warning: > variable 'res_size' set but not used [-Wunused-but-set-variable] > > It never used since introduction in commit > 237483aa5cf4 ("coresight: stm: adding driver for CoreSight STM component") > > Signed-off-by: YueHaibing Applied - thanks, Mathieu > --- > drivers/hwtracing/coresight/coresight-stm.c | 12 ++++-------- > 1 file changed, 4 insertions(+), 8 deletions(-) > > diff --git a/drivers/hwtracing/coresight/coresight-stm.c b/drivers/hwtracing/coresight/coresight-stm.c > index ef339ff..f07825d 100644 > --- a/drivers/hwtracing/coresight/coresight-stm.c > +++ b/drivers/hwtracing/coresight/coresight-stm.c > @@ -793,7 +793,7 @@ static int stm_probe(struct amba_device *adev, const struct amba_id *id) > struct stm_drvdata *drvdata; > struct resource *res = &adev->res; > struct resource ch_res; > - size_t res_size, bitmap_size; > + size_t bitmap_size; > struct coresight_desc desc = { 0 }; > struct device_node *np = adev->dev.of_node; > > @@ -833,15 +833,11 @@ static int stm_probe(struct amba_device *adev, const struct amba_id *id) > > drvdata->write_bytes = stm_fundamental_data_size(drvdata); > > - if (boot_nr_channel) { > + if (boot_nr_channel) > drvdata->numsp = boot_nr_channel; > - res_size = min((resource_size_t)(boot_nr_channel * > - BYTES_PER_CHANNEL), resource_size(res)); > - } else { > + else > drvdata->numsp = stm_num_stimulus_port(drvdata); > - res_size = min((resource_size_t)(drvdata->numsp * > - BYTES_PER_CHANNEL), resource_size(res)); > - } > + > bitmap_size = BITS_TO_LONGS(drvdata->numsp) * sizeof(long); > > guaranteed = devm_kzalloc(dev, bitmap_size, GFP_KERNEL); > > >