All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: kernel-janitors@vger.kernel.org
Subject: re: bus: arm-ccn: cpumask attribute
Date: Thu, 14 May 2015 10:13:44 +0000	[thread overview]
Message-ID: <20150514101344.GA20531@mwanda> (raw)

Hello Pawel Moll,

The patch ffa415245b86: "bus: arm-ccn: cpumask attribute" from Apr
16, 2015, leads to the following static checker warning:

	drivers/bus/arm-ccn.c:1188 arm_ccn_pmu_cpu_notifier()
	warn: unsigned 'target' is never less than zero.

drivers/bus/arm-ccn.c
  1175  static int arm_ccn_pmu_cpu_notifier(struct notifier_block *nb,
  1176                  unsigned long action, void *hcpu)
  1177  {
  1178          struct arm_ccn_dt *dt = container_of(nb, struct arm_ccn_dt, cpu_nb);
  1179          struct arm_ccn *ccn = container_of(dt, struct arm_ccn, dt);
  1180          unsigned int cpu = (long)hcpu; /* for (long) see kernel/cpu.c */
  1181          unsigned int target;
  1182  
  1183          switch (action & ~CPU_TASKS_FROZEN) {
  1184          case CPU_DOWN_PREPARE:
  1185                  if (!cpumask_test_and_clear_cpu(cpu, &dt->cpu))
  1186                          break;
  1187                  target = cpumask_any_but(cpu_online_mask, cpu);
  1188                  if (target < 0)
                            ^^^^^^^^^^
target is unsigned and cpumask_any_but() returns unsigned.

  1189                          break;
  1190                  perf_pmu_migrate_context(&dt->pmu, cpu, target);
  1191                  cpumask_set_cpu(target, &dt->cpu);
  1192                  WARN_ON(irq_set_affinity(ccn->irq, &dt->cpu) != 0);
  1193          default:
  1194                  break;
  1195          }
  1196  
  1197          return NOTIFY_OK;
  1198  }

regards,
dan carpenter

             reply	other threads:[~2015-05-14 10:13 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-14 10:13 Dan Carpenter [this message]
2015-05-14 10:50 ` [PATCH] bus: arm-ccn: Handle correctly no-more-cpus case Pawel Moll
2015-05-14 10:50   ` Pawel Moll
2015-05-14 11:04   ` Mark Rutland
2015-05-14 11:04     ` Mark Rutland
2015-05-14 11:26     ` Mark Rutland
2015-05-14 11:26       ` Mark Rutland

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150514101344.GA20531@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=kernel-janitors@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.