diff mbox

[2/2] envvar: Do not read default values for /options from the NVRAM anymore

Message ID 1477395825-6930-3-git-send-email-thuth@redhat.com
State Accepted
Headers show

Commit Message

Thomas Huth Oct. 25, 2016, 11:43 a.m. UTC
Now that we already set the default values in /options during
"(set-defaults)", there is no need anymore to load these values
through the NVRAM after we discovered that we had to re-initialize
it.

Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 slof/fs/envvar.fs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Nikunj A Dadhania Oct. 26, 2016, 5:02 a.m. UTC | #1
Thomas Huth <thuth@redhat.com> writes:

> Now that we already set the default values in /options during
> "(set-defaults)", there is no need anymore to load these values
> through the NVRAM after we discovered that we had to re-initialize
> it.
>
> Signed-off-by: Thomas Huth <thuth@redhat.com>

Reviewed-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>

> ---
>  slof/fs/envvar.fs | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/slof/fs/envvar.fs b/slof/fs/envvar.fs
> index 4a4d237..0e5f90a 100644
> --- a/slof/fs/envvar.fs
> +++ b/slof/fs/envvar.fs
> @@ -262,7 +262,7 @@ VARIABLE nvoff \ offset in envvar partition
>        ." No NVRAM common partition, re-initializing..." cr
>        internal-reset-nvram
>        (nvupdate)
> -      nvram-partition-type-common get-nvram-partition IF ." NVRAM seems to be broken." cr EXIT THEN
> +      EXIT
>     THEN
>     \ partition header found: read data from nvram
>     drop ( addr )           \ throw away offset
> -- 
> 1.8.3.1
>
> _______________________________________________
> SLOF mailing list
> SLOF@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/slof
Alexey Kardashevskiy Oct. 27, 2016, 1:44 a.m. UTC | #2
On 25/10/16 22:43, Thomas Huth wrote:
> Now that we already set the default values in /options during
> "(set-defaults)", there is no need anymore to load these values
> through the NVRAM after we discovered that we had to re-initialize
> it.
> 
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
>  slof/fs/envvar.fs | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/slof/fs/envvar.fs b/slof/fs/envvar.fs
> index 4a4d237..0e5f90a 100644
> --- a/slof/fs/envvar.fs
> +++ b/slof/fs/envvar.fs
> @@ -262,7 +262,7 @@ VARIABLE nvoff \ offset in envvar partition
>        ." No NVRAM common partition, re-initializing..." cr
>        internal-reset-nvram
>        (nvupdate)
> -      nvram-partition-type-common get-nvram-partition IF ." NVRAM seems to be broken." cr EXIT THEN
> +      EXIT


get-nvram-partition would leave ( addr len ) on stack if
internal-reset-nvram + (nvupdate) succeeded and that would be a bug which
you just fixed, is my understanding correct?


>     THEN
>     \ partition header found: read data from nvram
>     drop ( addr )           \ throw away offset
>
Thomas Huth Oct. 27, 2016, 7:15 a.m. UTC | #3
On 27.10.2016 03:44, Alexey Kardashevskiy wrote:
> On 25/10/16 22:43, Thomas Huth wrote:
>> Now that we already set the default values in /options during
>> "(set-defaults)", there is no need anymore to load these values
>> through the NVRAM after we discovered that we had to re-initialize
>> it.
>>
>> Signed-off-by: Thomas Huth <thuth@redhat.com>
>> ---
>>  slof/fs/envvar.fs | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/slof/fs/envvar.fs b/slof/fs/envvar.fs
>> index 4a4d237..0e5f90a 100644
>> --- a/slof/fs/envvar.fs
>> +++ b/slof/fs/envvar.fs
>> @@ -262,7 +262,7 @@ VARIABLE nvoff \ offset in envvar partition
>>        ." No NVRAM common partition, re-initializing..." cr
>>        internal-reset-nvram
>>        (nvupdate)
>> -      nvram-partition-type-common get-nvram-partition IF ." NVRAM seems to be broken." cr EXIT THEN
>> +      EXIT
> 
> 
> get-nvram-partition would leave ( addr len ) on stack if
> internal-reset-nvram + (nvupdate) succeeded and that would be a bug which
> you just fixed, is my understanding correct?

No, that was not a bug because the code below (after the "THEN") expects
( addr len ) on the stack.

>>     THEN
>>     \ partition header found: read data from nvram
>>     drop ( addr )           \ throw away offset

 Thomas
diff mbox

Patch

diff --git a/slof/fs/envvar.fs b/slof/fs/envvar.fs
index 4a4d237..0e5f90a 100644
--- a/slof/fs/envvar.fs
+++ b/slof/fs/envvar.fs
@@ -262,7 +262,7 @@  VARIABLE nvoff \ offset in envvar partition
       ." No NVRAM common partition, re-initializing..." cr
       internal-reset-nvram
       (nvupdate)
-      nvram-partition-type-common get-nvram-partition IF ." NVRAM seems to be broken." cr EXIT THEN
+      EXIT
    THEN
    \ partition header found: read data from nvram
    drop ( addr )           \ throw away offset