* [U-Boot] [PATCH] mpc85xx/T104xRDB: Remove vbank check redundant code
@ 2015-05-18 6:31 Priyanka Jain
2015-07-27 19:06 ` York Sun
0 siblings, 1 reply; 4+ messages in thread
From: Priyanka Jain @ 2015-05-18 6:31 UTC (permalink / raw)
To: u-boot
sw variable in checkboard function is storing vbank value
which can only take 4-bit value.
So check of sw value for if greater than 7 is redundant.
Signed-off-by: Priyanka Jain <Priyanka.Jain@freescale.com>
---
board/freescale/t104xrdb/t104xrdb.c | 5 +----
1 files changed, 1 insertions(+), 4 deletions(-)
diff --git a/board/freescale/t104xrdb/t104xrdb.c b/board/freescale/t104xrdb/t104xrdb.c
index 9cd5e15..c34eea6 100644
--- a/board/freescale/t104xrdb/t104xrdb.c
+++ b/board/freescale/t104xrdb/t104xrdb.c
@@ -35,10 +35,7 @@ int checkboard(void)
sw = CPLD_READ(flash_ctl_status);
sw = ((sw & CPLD_LBMAP_MASK) >> CPLD_LBMAP_SHIFT);
- if (sw <= 7)
- printf("vBank: %d\n", sw);
- else
- printf("Unsupported Bank=%x\n", sw);
+ printf("vBank: %d\n", sw);
return 0;
}
--
1.7.4.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [U-Boot] [PATCH] mpc85xx/T104xRDB: Remove vbank check redundant code
2015-05-18 6:31 [U-Boot] [PATCH] mpc85xx/T104xRDB: Remove vbank check redundant code Priyanka Jain
@ 2015-07-27 19:06 ` York Sun
2015-07-29 8:31 ` Priyanka Jain
0 siblings, 1 reply; 4+ messages in thread
From: York Sun @ 2015-07-27 19:06 UTC (permalink / raw)
To: u-boot
On 05/17/2015 11:31 PM, Priyanka Jain wrote:
> sw variable in checkboard function is storing vbank value
> which can only take 4-bit value.
> So check of sw value for if greater than 7 is redundant.
>
> Signed-off-by: Priyanka Jain <Priyanka.Jain@freescale.com>
> ---
> board/freescale/t104xrdb/t104xrdb.c | 5 +----
> 1 files changed, 1 insertions(+), 4 deletions(-)
>
> diff --git a/board/freescale/t104xrdb/t104xrdb.c b/board/freescale/t104xrdb/t104xrdb.c
> index 9cd5e15..c34eea6 100644
> --- a/board/freescale/t104xrdb/t104xrdb.c
> +++ b/board/freescale/t104xrdb/t104xrdb.c
> @@ -35,10 +35,7 @@ int checkboard(void)
> sw = CPLD_READ(flash_ctl_status);
> sw = ((sw & CPLD_LBMAP_MASK) >> CPLD_LBMAP_SHIFT);
>
> - if (sw <= 7)
> - printf("vBank: %d\n", sw);
> - else
> - printf("Unsupported Bank=%x\n", sw);
> + printf("vBank: %d\n", sw);
>
> return 0;
> }
>
Priyanka,
4-bit variable can still have value bigger than 7. Is there other reason you
want to remove it?
York
^ permalink raw reply [flat|nested] 4+ messages in thread
* [U-Boot] [PATCH] mpc85xx/T104xRDB: Remove vbank check redundant code
2015-07-27 19:06 ` York Sun
@ 2015-07-29 8:31 ` Priyanka Jain
2015-07-29 16:56 ` York Sun
0 siblings, 1 reply; 4+ messages in thread
From: Priyanka Jain @ 2015-07-29 8:31 UTC (permalink / raw)
To: u-boot
> -----Original Message-----
> From: Sun York-R58495
> Sent: Tuesday, July 28, 2015 12:37 AM
> To: Jain Priyanka-B32167; u-boot at lists.denx.de
> Subject: Re: [PATCH] mpc85xx/T104xRDB: Remove vbank check redundant
> code
>
>
>
> On 05/17/2015 11:31 PM, Priyanka Jain wrote:
> > sw variable in checkboard function is storing vbank value which can
> > only take 4-bit value.
> > So check of sw value for if greater than 7 is redundant.
> >
> > Signed-off-by: Priyanka Jain <Priyanka.Jain@freescale.com>
> > ---
> > board/freescale/t104xrdb/t104xrdb.c | 5 +----
> > 1 files changed, 1 insertions(+), 4 deletions(-)
> >
> > diff --git a/board/freescale/t104xrdb/t104xrdb.c
> > b/board/freescale/t104xrdb/t104xrdb.c
> > index 9cd5e15..c34eea6 100644
> > --- a/board/freescale/t104xrdb/t104xrdb.c
> > +++ b/board/freescale/t104xrdb/t104xrdb.c
> > @@ -35,10 +35,7 @@ int checkboard(void)
> > sw = CPLD_READ(flash_ctl_status);
> > sw = ((sw & CPLD_LBMAP_MASK) >> CPLD_LBMAP_SHIFT);
> >
> > - if (sw <= 7)
> > - printf("vBank: %d\n", sw);
> > - else
> > - printf("Unsupported Bank=%x\n", sw);
> > + printf("vBank: %d\n", sw);
> >
> > return 0;
> > }
> >
>
> Priyanka,
>
> 4-bit variable can still have value bigger than 7. Is there other reason you
> want to remove it?
[Jain Priyanka-B32167] Sorry, Its 3-bit variable. So cannot have value greater than 7.
CPLD_LBMAP_MASK is 0x3f and CPLD_LBMAB_SHIFT is of value 3.
So it is basically bits sw[5], sw[4], sw[3].
>
> York
^ permalink raw reply [flat|nested] 4+ messages in thread
* [U-Boot] [PATCH] mpc85xx/T104xRDB: Remove vbank check redundant code
2015-07-29 8:31 ` Priyanka Jain
@ 2015-07-29 16:56 ` York Sun
0 siblings, 0 replies; 4+ messages in thread
From: York Sun @ 2015-07-29 16:56 UTC (permalink / raw)
To: u-boot
On 07/29/2015 01:31 AM, Jain Priyanka-B32167 wrote:
>
>
>> -----Original Message-----
>> From: Sun York-R58495
>> Sent: Tuesday, July 28, 2015 12:37 AM
>> To: Jain Priyanka-B32167; u-boot at lists.denx.de
>> Subject: Re: [PATCH] mpc85xx/T104xRDB: Remove vbank check redundant
>> code
>>
>>
>>
>> On 05/17/2015 11:31 PM, Priyanka Jain wrote:
>>> sw variable in checkboard function is storing vbank value which can
>>> only take 4-bit value.
>>> So check of sw value for if greater than 7 is redundant.
>>>
>>> Signed-off-by: Priyanka Jain <Priyanka.Jain@freescale.com>
>>> ---
>>> board/freescale/t104xrdb/t104xrdb.c | 5 +----
>>> 1 files changed, 1 insertions(+), 4 deletions(-)
>>>
>>> diff --git a/board/freescale/t104xrdb/t104xrdb.c
>>> b/board/freescale/t104xrdb/t104xrdb.c
>>> index 9cd5e15..c34eea6 100644
>>> --- a/board/freescale/t104xrdb/t104xrdb.c
>>> +++ b/board/freescale/t104xrdb/t104xrdb.c
>>> @@ -35,10 +35,7 @@ int checkboard(void)
>>> sw = CPLD_READ(flash_ctl_status);
>>> sw = ((sw & CPLD_LBMAP_MASK) >> CPLD_LBMAP_SHIFT);
>>>
>>> - if (sw <= 7)
>>> - printf("vBank: %d\n", sw);
>>> - else
>>> - printf("Unsupported Bank=%x\n", sw);
>>> + printf("vBank: %d\n", sw);
>>>
>>> return 0;
>>> }
>>>
>>
>> Priyanka,
>>
>> 4-bit variable can still have value bigger than 7. Is there other reason you
>> want to remove it?
> [Jain Priyanka-B32167] Sorry, Its 3-bit variable. So cannot have value greater than 7.
> CPLD_LBMAP_MASK is 0x3f and CPLD_LBMAB_SHIFT is of value 3.
> So it is basically bits sw[5], sw[4], sw[3].
>
If it is 3-bit value, it makes sense. Can you update the commit message?
York
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-07-29 16:56 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-18 6:31 [U-Boot] [PATCH] mpc85xx/T104xRDB: Remove vbank check redundant code Priyanka Jain
2015-07-27 19:06 ` York Sun
2015-07-29 8:31 ` Priyanka Jain
2015-07-29 16:56 ` York Sun
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox