Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp609042pxj; Thu, 20 May 2021 17:45:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy4nxScEhFndg3RlvETJDqpOEBQ6zXNQ8fWZwgn2ODisSHAo11ZrRk02p+IWCeoQOfXm6+m X-Received: by 2002:a17:906:1794:: with SMTP id t20mr7384054eje.119.1621557934489; Thu, 20 May 2021 17:45:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621557934; cv=none; d=google.com; s=arc-20160816; b=WD9+NyxFYl0LYR7DYHeocx0yZxE6MUfJ7jym424YRbyGoaDQLRAjHZvlEw2hy0ty3i uWppvkDfSy6Vlw8rw9ma1gzVuo+t4x2SSeT9gChWma8MFdzr86GwHPl9IVbyJheQob0B WBAnPFXfRhJULkEbgSZzxiTW8zPx+eMZaNjkSU2j37k6GRy7+eCpM+IT8VmO65mBXlnB AyL+4f9ZlOzrLNn9YMl/CrZbaqx0iiyv+g8wos+h6Bi/Ng8EgMALJykCP3ZiHMiCLWNw 2EuivuNmyBQ7aLF95ldJDOwQp0+dI2n+1Fj4clJvmNgxBEPn5MQ7gy6ah+TObz6uC990 2sbg== 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=M5bId+JfZg911PnHNpQJoRKhqPwBL+bOg9qpW/GKZwE=; b=hVYcaL1J2im9PZvy2+51Hp+jZobdIxc8DcOfd1v2XrPfS5oqte8DSTMWCwwLGmcG74 6FNlQ79AIl8oTFs6yHOu1tlJ9tBzXACLhpoa7XQ5LFU/2PkIrW57Verhuh1XCApvahl/ Asb+ZBulI6aPMRxzc9oRng2SRCJbeLM79okaDyWz+kYRVOrOCcmf28gy3yGhtepZQkym I5JMBkcxiPmSdnsvjbhYjh7pSg4hEQ3mwJpxayXIu+3cKvOBY0sh/OwyyuMLrTdBENuJ mUUjWehfHnSlnaLM73ntEv6AunZp1rp7wmAWjKMBOeoTLthifxEufQjczL1JnzTdTyBK MqEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ZD2HMc8+; 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 k22si3909838edv.285.2021.05.20.17.45.11; Thu, 20 May 2021 17:45:34 -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=ZD2HMc8+; 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 S241196AbhETL3E (ORCPT + 99 others); Thu, 20 May 2021 07:29:04 -0400 Received: from mail.kernel.org ([198.145.29.99]:47834 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239805AbhETLI5 (ORCPT ); Thu, 20 May 2021 07:08:57 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 8905F6193B; Thu, 20 May 2021 10:06:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621505188; bh=Ff5gKiAnDw2dpIKjZi8Ygf6hQGI1KEcGmdXwASJb6xo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZD2HMc8+msYS2b/Jd7dufWdrO8S3VY06SNeeE/3a3e2Huszi7UMSDoBVP0C1IbmRP 5XmzW6PEJCckTjvtliSdmRZk9z6QikpDs6jmNwDlmKoaO3SWgmb3uUXrThsdVLvpTx 1J9oPM7TUwIcVTPCdgGV1fkLacgE+eODHD45xFl4= 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.4 021/190] intel_th: Consistency and off-by-one fix Date: Thu, 20 May 2021 11:21:25 +0200 Message-Id: <20210520092102.874291082@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210520092102.149300807@linuxfoundation.org> References: <20210520092102.149300807@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 189eb6269971..e585b29ce738 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); @@ -597,7 +597,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