Linux on ARM based TI OMAP SoCs
 help / color / mirror / Atom feed
* re: ARM: OMAP2+: Powerdomain: Remove the need to always have a voltdm associated to a pwrdm
@ 2013-11-06 20:36 Dan Carpenter
  0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2013-11-06 20:36 UTC (permalink / raw)
  To: rnayak; +Cc: linux-omap

Hello Rajendra Nayak,

This is a semi-automatic email about new static checker warnings.

The patch cd8abed1da91: "ARM: OMAP2+: Powerdomain: Remove the need to 
always have a voltdm associated to a pwrdm" from Jun 17, 2013, leads 
to the following Smatch complaint:

arch/arm/mach-omap2/powerdomain.c:131 _pwrdm_register()
	 error: we previously assumed 'arch_pwrdm' could be null (see line 105)

arch/arm/mach-omap2/powerdomain.c
   104	
   105		if (arch_pwrdm && arch_pwrdm->pwrdm_has_voltdm)
                    ^^^^^^^^^^
Patch introduces new check.

   106			if (!arch_pwrdm->pwrdm_has_voltdm())
   107				goto skip_voltdm;
   108	
   109		voltdm = voltdm_lookup(pwrdm->voltdm.name);
   110		if (!voltdm) {
   111			pr_err("powerdomain: %s: voltagedomain %s does not exist\n",
   112			       pwrdm->name, pwrdm->voltdm.name);
   113			return -EINVAL;
   114		}
   115		pwrdm->voltdm.ptr = voltdm;
   116		INIT_LIST_HEAD(&pwrdm->voltdm_node);
   117		voltdm_add_pwrdm(voltdm, pwrdm);
   118	skip_voltdm:
   119		spin_lock_init(&pwrdm->_lock);
   120	
   121		list_add(&pwrdm->node, &pwrdm_list);
   122	
   123		/* Initialize the powerdomain's state counter */
   124		for (i = 0; i < PWRDM_MAX_PWRSTS; i++)
   125			pwrdm->state_counter[i] = 0;
   126	
   127		pwrdm->ret_logic_off_counter = 0;
   128		for (i = 0; i < pwrdm->banks; i++)
   129			pwrdm->ret_mem_off_counter[i] = 0;
   130	
   131		arch_pwrdm->pwrdm_wait_transition(pwrdm);
                ^^^^^^^^^^^^
Existing unchecked dereference.

   132		pwrdm->state = pwrdm_read_pwrst(pwrdm);
   133		pwrdm->state_counter[pwrdm->state] = 1;

regards,
dan carpenter

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2013-11-06 20:36 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-06 20:36 ARM: OMAP2+: Powerdomain: Remove the need to always have a voltdm associated to a pwrdm Dan Carpenter

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