Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp353650pxb; Wed, 14 Apr 2021 17:36:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy0Ok59kuiifGebnWKJSUccpRY3fWXqUO/eEbpOlGfn0+aQKurOcorFmSWOa6Mp1NwcOizK X-Received: by 2002:a17:906:c9d8:: with SMTP id hk24mr733902ejb.480.1618446986643; Wed, 14 Apr 2021 17:36:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618446986; cv=none; d=google.com; s=arc-20160816; b=L6bUOltzDhD8ScTOMV/8xTRAvQNJ1Qp7XEmsjvsDYwIL27caa7AZcGLrTz7Apnqcc4 x3Ii+djTeYIhnc61zwo4aRKBTkyuOqwaR5iCYQ/0U7EPvdBGV3W5EWyFLxfbY4woq9e2 D0MlrPHhsSjNg7/qVd8TxCOr29jNwCOgEAHspkJwNf9zNu0bANIYYzzHDPgnTncK/Jhz ShyLu4phGjHxS6aEWHygQVYA/qOQCH9qaTMMM/AumsHoOu93K8/mUJUE9u+BAtPaHAt2 AMSLXd/HMAYqO0ELmAwXqB/MdC5e3ajXGBues5hA3/4CNSWnRiQ6xxKvoUXGC+U4Irfh n3MQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :ironport-sdr:ironport-sdr; bh=o+zFeKH+t9OoRP1vfuAbPwHLhPsRcCM0Fkrn7D/0CAg=; b=jzyQCuXs859uZoxJIaZEi6jwF77DHOBirFIrN+e7s/CsVrx4eFQeT+PQgyClaEub2Y 2dSCQXj50H/UBQejDaVPxfO0rQii1bc4e/wMzPzY3vg9k36vRZchPiYBBJItML91IKzY J+n/SdNgRG5+c3unGrKYw9N9gOtOSCL8qYMJtR5eexCQuicij0Yz/6DutOx1pgo/fdzT z7fnEdImQDmnNcZfTPE0iVy/Kupba2CVykmRqiw00axu6NsfA5ntxpd/smzobj0x2HvU Gbx01UIgFOr/6f/3cvRGGMpx/4MbatHIk8qTgjcOvkfBuqVlz6DdCiKIDu/Uhew4siVk yR/w== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hs11si883367ejc.429.2021.04.14.17.36.03; Wed, 14 Apr 2021 17:36:26 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347279AbhDNRNM (ORCPT + 99 others); Wed, 14 Apr 2021 13:13:12 -0400 Received: from mga02.intel.com ([134.134.136.20]:3013 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233433AbhDNRNK (ORCPT ); Wed, 14 Apr 2021 13:13:10 -0400 IronPort-SDR: Jhl0/EDvpRgQakKz8jFuWXqUVKoEX2hIq+fAxspie0/IXnYbq4199nVdLo00N0GRen9bH1YWLr veWvPKU+bDTg== X-IronPort-AV: E=McAfee;i="6200,9189,9954"; a="181811937" X-IronPort-AV: E=Sophos;i="5.82,222,1613462400"; d="scan'208";a="181811937" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Apr 2021 10:12:48 -0700 IronPort-SDR: CmyVNo0sLTc+aycXhmOiFqsqUOQK5jZo5dz/NH3r7py4v+CkaOnr+qlYQ1Qiv6q49gSoz/jQWB JXTo6mOaggTw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,222,1613462400"; d="scan'208";a="382427992" Received: from black.fi.intel.com (HELO black.fi.intel.com.) ([10.237.72.28]) by orsmga003.jf.intel.com with ESMTP; 14 Apr 2021 10:12:46 -0700 From: Alexander Shishkin To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, Pavel Machek , Pavel Machek , Alexander Shishkin , Andy Shevchenko Subject: [PATCH 5/7] intel_th: Consistency and off-by-one fix Date: Wed, 14 Apr 2021 20:12:49 +0300 Message-Id: <20210414171251.14672-6-alexander.shishkin@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210414171251.14672-1-alexander.shishkin@linux.intel.com> References: <20210414171251.14672-1-alexander.shishkin@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Pavel Machek 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 --- 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