Received: by 2002:a05:6520:4211:b029:f4:110d:56bc with SMTP id o17csp2104641lkv; Thu, 20 May 2021 03:31:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzYS7kDwmJZgL1oT+eGstHxjMSSJs59Dw4+kH0weI9+s9AhtXzbH2MqUDjnQrmQVO8iLqxI X-Received: by 2002:a6b:ed11:: with SMTP id n17mr4066142iog.171.1621506661884; Thu, 20 May 2021 03:31:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621506661; cv=none; d=google.com; s=arc-20160816; b=fwswzCEGWVI9IUo7PV5NzIiCGJBXVEisabnjC2Mzy91iO/ojSKZ6qiuMs9FPKk77g0 zFkkYUCsKuRsgQJR7odBDKL8VkI/7TBBAR8aFldaWNQeVqPNQ1dZIF53ldLD/Vjx4CBr QD25KhjpYDVXvGLWQzdq3WHBpEynPwYbTpe4Xq+2uhuYbTekekOrvRI2AwbUZV0sW4DG BdJB32CC0LSmuDdM4PghG4IUtMyo2TeuiPJr1a/eB1VQpUqf8NwanCA/XWf+2Nu0zCtD lUerONsfadrLQY6jI31q/DF+D+oqfQVkfjhLUPjd9O7geShFiFMCFh8PYxqPP7TnCdUC 9y1w== 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=xZof4J+PzkABcwXzY/o+U/cM3H6+wgdYqcjP74Uoe+s=; b=V5ZQ6griJ1YDygYNzs1iSpT5qacYuWOveg8te5bXVHTuvgMZ4YtLIpr0FtP8rkDBJJ 2iXjvJsrgh+ulGZlMO4DJiG9bixPn8q6ik/g8KKP1nNlR/4LlXr2kFNxYuJn17lRaEFd mKU2gfJfRMiBketpPUtieB2grJAvgMbWIi/UgY5bR7lMti1AnpEV1XVQWOvwoBQiA8tp ZivZw6wg03rpgBInvVnhtmaQFMcaSM4E+3jFGkJ7BQiTCoYkC8P20K1rM2NmduWjOfat whCP4LTeQPyuF8xplPXCaUsMKcSJG59HRpmV0Y2ycJBP3mPogXqM8DLzJdI9sr/6mSgi eAmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Am5QtegR; 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 n5si2701949ilj.6.2021.05.20.03.30.49; Thu, 20 May 2021 03:31:01 -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=Am5QtegR; 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 S236654AbhETKax (ORCPT + 99 others); Thu, 20 May 2021 06:30:53 -0400 Received: from mail.kernel.org ([198.145.29.99]:50912 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235859AbhETKR2 (ORCPT ); Thu, 20 May 2021 06:17:28 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1C48B613DA; Thu, 20 May 2021 09:46:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621503985; bh=qbbmotqRcQsqZb8LKliq760hLm0WV5WZAvv/LQ2y9qw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Am5QtegRppxPdM8O57aw2vtWYjOswR9I1sm6FOnw+kKQhuei78sC0e86m+RV8aO9B Iy7PlQ95iv80ctRLXzsCOLbz+aRp1cFibVZs03QIC4ra/rPyNrjoJtZgIze51Ruz7+ m3jJM0AdcbK1HtdXcojgb4YBwuHgSotKrh7tZqts= 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.14 042/323] intel_th: Consistency and off-by-one fix Date: Thu, 20 May 2021 11:18:54 +0200 Message-Id: <20210520092121.547462229@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210520092120.115153432@linuxfoundation.org> References: <20210520092120.115153432@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 2a3ae9006c58..79473ba48d0c 100644 --- a/drivers/hwtracing/intel_th/gth.c +++ b/drivers/hwtracing/intel_th/gth.c @@ -485,7 +485,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); @@ -624,7 +624,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