lkml.org 
[lkml]   [2021]   [Dec]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v16 10/11] of: fdt: Add memory for devices by DT property "linux,usable-memory-range"
From
Date


On 2021/12/1 10:55, Leizhen (ThunderTown) wrote:
>>> + }
>>>
>>> - memblock_cap_memory_range(cap_mem_addr, cap_mem_size);
>>> + memblock_cap_memory_range(rgn[0].base, rgn[0].size);
>>> + for (i = 1; i < MAX_USABLE_RANGES && rgn[i].size; i++)
>> s/ &&/,/

Hi Rob:
I want to keep "&&" unchanged, do you mind? I'm going to post an
updated version tomorrow, hopefully the last.

> Hi Rob:
>
> The comma operator may not be suitable for logical judgment. The logical judgment
> before commas (,) is ignored.
>
> Here's my test:
>
> C code:
> int main()
> {
> int i, j;
>
> printf("&&:\n");
> for (i = 0, j = 0; i < 2 && j < 3; i++, j++)
> printf("i=%d, j=%d\n", i, j);
>
> printf("\ncomma:\n");
> for (i = 0, j = 0; i < 2, j < 3; i++, j++) //(i < 2) before comma is ignored
> printf("i=%d, j=%d\n", i, j);
>
> return 0;
> }
>
> Output:
> &&:
> i=0, j=0
> i=1, j=1
>
> comma:
> i=0, j=0
> i=1, j=1
> i=2, j=2
>
>

\
 
 \ /
  Last update: 2021-12-09 03:00    [W:0.086 / U:0.616 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site