public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
* re: bus: arm-ccn: cpumask attribute
@ 2015-05-14 10:13 Dan Carpenter
  2015-05-14 10:50 ` [PATCH] bus: arm-ccn: Handle correctly no-more-cpus case Pawel Moll
  0 siblings, 1 reply; 4+ messages in thread
From: Dan Carpenter @ 2015-05-14 10:13 UTC (permalink / raw)
  To: kernel-janitors

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-05-14 11:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-14 10:13 bus: arm-ccn: cpumask attribute Dan Carpenter
2015-05-14 10:50 ` [PATCH] bus: arm-ccn: Handle correctly no-more-cpus case Pawel Moll
2015-05-14 11:04   ` Mark Rutland
2015-05-14 11:26     ` Mark Rutland

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox