<div dir="auto"><div><br><div class="gmail_extra"><br><div class="gmail_quote">On Apr 14, 2017 3:48 AM, "Gedare Bloom" <<a href="mailto:gedare@rtems.org">gedare@rtems.org</a>> wrote:<br type="attribution"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="quoted-text">On Thu, Apr 13, 2017 at 11:19 PM, Chris Johns <<a href="mailto:chrisj@rtems.org">chrisj@rtems.org</a>> wrote:<br>
> On 14/4/17 5:31 am, Daniel Hellstrom wrote:<br>
>> From: Martin Aberg <<a href="mailto:maberg@gaisler.com">maberg@gaisler.com</a>><br>
>><br>
>> Probing of separate interrupts was done by storing the GPTIMER_CFG_SI bit. But<br>
>> it was never actually stored since it is bit 8 and the datatype is 8-bit. Now<br>
>> store the AND result as boolean value instead.<br>
>> ---<br>
>>  c/src/lib/libbsp/sparc/shared/<wbr>timer/gptimer.c | 2 +-<br>
>>  1 file changed, 1 insertion(+), 1 deletion(-)<br>
>><br>
>> diff --git a/c/src/lib/libbsp/sparc/<wbr>shared/timer/gptimer.c b/c/src/lib/libbsp/sparc/<wbr>shared/timer/gptimer.c<br>
>> index e701211..d26d007 100644<br>
>> --- a/c/src/lib/libbsp/sparc/<wbr>shared/timer/gptimer.c<br>
>> +++ b/c/src/lib/libbsp/sparc/<wbr>shared/timer/gptimer.c<br>
>> @@ -293,7 +293,7 @@ int gptimer_init1(struct drvmgr_dev *dev)<br>
>>        *  B. Each Timer have an individual IRQ. The number is:<br>
>>        *        BASE_IRQ + timer_index<br>
>>        */<br>
>> -     priv->separate_interrupt = regs->cfg & GPTIMER_CFG_SI;<br>
>> +     priv->separate_interrupt = !!(regs->cfg & GPTIMER_CFG_SI);<br>
><br>
> Is this suppose to be not not?<br>
><br>
</div>The !! is a C pattern to check for a non-zero value.<br>
<br>
Generally it is the same as<br>
(regs->cfg & GPTIMER_CFG_SI) != 0;<br>
<br>
I would also prefer the more explicit form, since we don't use the !!<br>
pattern in RTEMS it is a bit confusing for someone to see and<br>
understand.<br></blockquote></div></div></div><div dir="auto"><br></div><div dir="auto">With Sebastian on holiday, I get the chance to ask...</div><div dir="auto"><br></div><div dir="auto">Is this rule written down in the Coding Style? :)</div><div dir="auto"><br></div><div dir="auto">Please add it. I usually get busted on this. Nice to be on the other side for once. :)</div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="elided-text"><br>
> I prefer to see `(regs->cfg & GPTIMER_CFG_SI) == 0`.<br>
><br>
> Chris<br>
> ______________________________<wbr>_________________<br>
> devel mailing list<br>
> <a href="mailto:devel@rtems.org">devel@rtems.org</a><br>
> <a href="http://lists.rtems.org/mailman/listinfo/devel" rel="noreferrer" target="_blank">http://lists.rtems.org/<wbr>mailman/listinfo/devel</a><br>
______________________________<wbr>_________________<br>
devel mailing list<br>
<a href="mailto:devel@rtems.org">devel@rtems.org</a><br>
<a href="http://lists.rtems.org/mailman/listinfo/devel" rel="noreferrer" target="_blank">http://lists.rtems.org/<wbr>mailman/listinfo/devel</a><br>
</div></blockquote></div><br></div></div></div>