Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp303316pxj; Thu, 20 May 2021 09:40:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwaGFSmMcrsEygSMv6keb2hd3Ky41P5VoHrcDSEIsJgeK33s35SUu4z0rdLi97GEWEHtfcr X-Received: by 2002:a17:907:1749:: with SMTP id lf9mr5798543ejc.178.1621528822436; Thu, 20 May 2021 09:40:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621528822; cv=none; d=google.com; s=arc-20160816; b=vrK+cBPJvfG6NdUFGGInlU2z1b6g4CacLGDiF1Z7bxEr2tAAeROSh5BUEr/k2aTYaI yI0ZTBTj8/h5NrOH0fn6REhUUQT5D9iGm0Cp8AA36a4J85ajEfEP3GaszR+pIEpwMsZW ghOWAFNkh++ypBkruAa/dVo8tNZIMEZ1ILqtnPC9isehW01us94aQQ2y9It3zvEAdgWs OPW0+YF5qM2wOGIQrd332jIQ3cG7kOUsqUCSz7MUPFw2oGI/T8NEFrwVfnAkXiBRQ9YT qBp/IQJGqCFlqRQSYcFMakZkY2Rl19JL3ph5DdqzdwF2nURPNvlK7FVtt5S3t3wADInb SzSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=o6hQe/zE6mOmxlu/4D0oWyc7OJMyVTGj17DAq6DHFYM=; b=bTxUTRcULO3GHRe7heIgptxVXWRNoORwAndUzNmTb2n8LSCx+MdZ5M63MDZmy37jpQ WwrNqY+FpqWu2LfkMvV7R1f/McDQyhagfQO7nytMvmLnf7ymiujmm+3mvubXvTHDdHoL 6EJq4LUFfjrHC3U9ZPHKTktMBPTNgBa4lnQQlLg6IveutuNiVVQs4d0v63EsJjHS01JO By3oA8O7Ury1OcGlYRYeSpdkLMXQaENGajr9TLUT74kdL8MB64CTuuEXaVwFHly2DXLN PUqmbtz1rjxCJrikovVfe7DyO85DWX9D5GNEX3/CiSOhbpGvjYdfvqlOHGXTMkt3yl9o rYMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=K67PsgmP; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e2si2511925edv.442.2021.05.20.09.39.58; Thu, 20 May 2021 09:40:22 -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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=K67PsgmP; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233371AbhETJnU (ORCPT + 99 others); Thu, 20 May 2021 05:43:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:39950 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233289AbhETJkw (ORCPT ); Thu, 20 May 2021 05:40:52 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id A6AE361422; Thu, 20 May 2021 09:31:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621503111; bh=NEuUn62GfhKmcJ/2RMkMwNqyYtuxp0cE9FhV7n16B+Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=K67PsgmPkwyegvtmNLpBT13IAXBwbqVXnKwhNP9aqXgpYpUsDQBI/IpIbjVY8OE/0 FmauSOCEqfylFqqBhKuxY6e3grBBepHJCdUZA/mGGlU90A/6NA3BPknOtbG6c8yfeT kknB/doaricvTSSno7A+j93ov+sTcqiZ6SPh++P0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Pavel Machek , Alexander Shishkin , Andy Shevchenko , Sasha Levin Subject: [PATCH 4.19 039/425] intel_th: Consistency and off-by-one fix Date: Thu, 20 May 2021 11:16:48 +0200 Message-Id: <20210520092132.703461597@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210520092131.308959589@linuxfoundation.org> References: <20210520092131.308959589@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Pavel Machek [ Upstream commit 18ffbc47d45a1489b664dd68fb3a7610a6e1dea3 ] Consistently use "< ... +1" in for loops. Fix of-by-one in for_each_set_bit(). Signed-off-by: Pavel Machek Signed-off-by: Alexander Shishkin Link: https://lore.kernel.org/lkml/20190724095841.GA6952@amd/ Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20210414171251.14672-6-alexander.shishkin@linux.intel.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/hwtracing/intel_th/gth.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/hwtracing/intel_th/gth.c b/drivers/hwtracing/intel_th/gth.c index edc52d75e6bd..5041fe7fee9e 100644 --- a/drivers/hwtracing/intel_th/gth.c +++ b/drivers/hwtracing/intel_th/gth.c @@ -477,7 +477,7 @@ static void intel_th_gth_disable(struct intel_th_device *thdev, output->active = false; for_each_set_bit(master, gth->output[output->port].master, - TH_CONFIGURABLE_MASTERS) { + TH_CONFIGURABLE_MASTERS + 1) { gth_master_set(gth, master, -1); } spin_unlock(>h->gth_lock); @@ -616,7 +616,7 @@ static void intel_th_gth_unassign(struct intel_th_device *thdev, othdev->output.port = -1; othdev->output.active = false; gth->output[port].output = NULL; - for (master = 0; master <= TH_CONFIGURABLE_MASTERS; master++) + for (master = 0; master < TH_CONFIGURABLE_MASTERS + 1; master++) if (gth->master[master] == port) gth->master[master] = -1; spin_unlock(>h->gth_lock); -- 2.30.2