Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2476805pxj; Mon, 10 May 2021 04:03:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxxlP+bkoDiUrw0ZqWevtRfdA6YpPWwsGTnu827Z81auPQLzFoPZsO3FIcmjAAJlgIYGp61 X-Received: by 2002:a17:906:91d3:: with SMTP id b19mr25204167ejx.242.1620644599051; Mon, 10 May 2021 04:03:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620644599; cv=none; d=google.com; s=arc-20160816; b=V9QNlY+f03wXVfUns/KaPlJ2FYRNXD36MkBO/Xmq7iCjF9Hh3dALu9UXuUsI3kcLKk CKPJ2gip937QARlkAjLYDSZIi0KNW1lJSHU8t7BqhAVj2f3n+NNgTTL1OPTfuIy9t682 h2VDRKMPC1OyrjGMcL+rGNfmIAycASNyXLdgJbgrkZaaIDHdudUeBwxrzkTrJhXyJBid Ae0ed1sRsMOzeWHd5wKPGZbFCp3v1KEgcx5q6fA6Ovnna2DIJWQwuHMAtspf0bg6ykCz 51uIWJakbYs1DoDznFm6p0W3BvUlWPcXBwfgSPFClJklKGiJDN0mzW8trvnaHS89b2sT kvtw== 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=hmi7eJtqBf1HCJRi7FyLXiFPZiDpOoDs/nyPaBi0hTA=; b=drLmDwQoPcRfFIDksmxtSQ8JWdnGc/MD6hY7nEZnIkuJ5MbU0/yhtYfzAshzD4b8K7 jQ5N9pe20lCtJnr8t+qCBVAhnWwQa5BNNGhF/8i0uAf/aECSoHXa4fyOAjqfLxe/w4MU yTI//3k+q4QlUGKZ+HgvRU280ld4YIa2KhZuThUqba+EauZLE7/4isJmneWT4xwRSfox Gcc8a4mKQYPwVC/2VnwrVIM61qvqNctw4AyMRBBHwKjkNa1E6QOFDoZ8CAY5Mfz4l/vs X03IAEYp1cE07rSRooI75Fy7vjXllJ2Dji4rrteTcx5X45KLAg6sPi48ujsJ+Hu09woi IR0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=zC+ILplS; 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 dd11si13194634edb.359.2021.05.10.04.02.55; Mon, 10 May 2021 04:03:19 -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=zC+ILplS; 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 S235436AbhEJLBC (ORCPT + 99 others); Mon, 10 May 2021 07:01:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:59364 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233156AbhEJKpO (ORCPT ); Mon, 10 May 2021 06:45:14 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 93FD361996; Mon, 10 May 2021 10:35:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620642907; bh=LoyNK8HNErERYJfITDJthitm31cZ2tCOjIxcWiYUDwo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zC+ILplSoLFWF7BUxlaFYPdXAhPh0NGko0Y0Ezh0xv5qtZLQrWM5GAA/vskcyWj39 K1ZqeIlbqiDmCRNIe5xmhOFMTjkBbNFcxiTPAWkO2KpmJPPXBUtg2mgwoIYDUgXGYq P536KfVYORCnVAI+wg5x0Arw1fL2oI3i1pYivg1k= 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 5.10 100/299] intel_th: Consistency and off-by-one fix Date: Mon, 10 May 2021 12:18:17 +0200 Message-Id: <20210510102008.237980174@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210510102004.821838356@linuxfoundation.org> References: <20210510102004.821838356@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 f72803a02391..28509b02a0b5 100644 --- a/drivers/hwtracing/intel_th/gth.c +++ b/drivers/hwtracing/intel_th/gth.c @@ -543,7 +543,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); @@ -697,7 +697,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