summaryrefslogtreecommitdiffstats
path: root/drivers/hwtracing
diff options
context:
space:
mode:
authorPavel Machek <pavel@ucw.cz>2021-04-14 20:12:49 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-04-16 07:26:50 +0200
commit18ffbc47d45a1489b664dd68fb3a7610a6e1dea3 (patch)
treeeaf468e2a57e3dd95541f5165a8e15479064ebd2 /drivers/hwtracing
parentd9962f6f428449fe227f1c88c65ac3fffdf7dceb (diff)
downloadlinux-18ffbc47d45a1489b664dd68fb3a7610a6e1dea3.tar.gz
linux-18ffbc47d45a1489b664dd68fb3a7610a6e1dea3.tar.bz2
linux-18ffbc47d45a1489b664dd68fb3a7610a6e1dea3.zip
intel_th: Consistency and off-by-one fix
Consistently use "< ... +1" in for loops. Fix of-by-one in for_each_set_bit(). Signed-off-by: Pavel Machek <pavel@denx.de> Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com> Link: https://lore.kernel.org/lkml/20190724095841.GA6952@amd/ Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20210414171251.14672-6-alexander.shishkin@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/hwtracing')
-rw-r--r--drivers/hwtracing/intel_th/gth.c4
1 files 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(&gth->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(&gth->gth_lock);