lkml.org 
[lkml]   [2011]   [Nov]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] bcd: limit bin2bcd input value to lie between 0-99
On Wed, 16 Nov 2011 10:41:32 +0530
vbyravarasu@nvidia.com wrote:

> From: venu byravarasu <vbyravarasu@nvidia.com>
>
> Current implementation of bin2bcd allows any value
> between 0x0 to 0xF to be stored in the most significant
> nibble of its returned value, against to the BCD limits
> of 0 - 9. Hence fixing it.
>
> e.g. say val passed to bin2bcd is 123.
> In that case the expected value to be returned by
> this function is 0x23.
> However, without the fix being added, it would
> return 0xC3.
>

I'm not sure that I agree. Passing 123 to bin2bcd() is a bug, isn't
it? We want to know about bugs so we can fix them, and quietly repairing
thngs in callees prevents that.



\
 
 \ /
  Last update: 2011-11-22 23:35    [W:0.692 / U:0.080 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site