Re: [PATCHv2 01/28] OMAP: change get_context_loss_count ret value

From
Tomi Valkeinen <hidden>
Date
2011-06-13 16:45:04
Also in
linux-omap
Reply to
Ghongdemath, Girish, 2011-06-13
On Mon, 2011-06-13 at 11:37 -0500, Ghongdemath, Girish wrote:
Tomi,
Couple of queries,

On Mon, Jun 13, 2011 at 4:51 AM, Tomi Valkeinen [off-list ref] wrote:
quoted
Paul, can you take this patch and queue it for an rc?

 Tomi

On Thu, 2011-06-09 at 16:56 +0300, Tomi Valkeinen wrote:
quoted
get_context_loss_count functions return context loss count as u32, and
zero means an error. However, zero is also returned when context has
never been lost and could also be returned when the context loss count
has wrapped and goes to zero.

Change the functions to return an int, with negative value meaning an
error.
quoted
quoted
+             if (off_mode_enabled) {
- why have a check for off_mode_enabled? As this only detects valid
next state for MPU/CORE. Other pwrdm can still
hit OFF.
It does what the code did previously, without changing the logic. And
this doesn't detect anything, it's just an dummy emulation for context
loss to test the drivers.
quoted
quoted
+                     count++;
+                     /*
+                      * Context loss count has to be a non-negative value.
+                      * Clear the sign bit to get a value range from 0 to
+                      * INT_MAX.
+                      */
+                     count &= INT_MAX;
+                     dummy_context_loss_counter = count;
+             }
      }
- Why not use u32 instead?
So that we can return error values. That was the whole point of this
patch.

 Tomi

Thread (54 messages) 54 messages, 7 authors, last reply 2011-10-06
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help