tpm: Add explicit endianness cast
Subsystems (2)
PATCH v3 1/4 tpm: Add explicit endianness cast
Signed-off-by Thiebaud Weksteen <[email protected]>
--- drivers/char/tpm/tpm_eventlog_of.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/char/tpm/tpm_eventlog_of.c +2 -2
@@ -56,8 +56,8 @@ int tpm_read_log_of(struct tpm_chip *chip)* but physical tpm needs the conversion. */ if (of_property_match_string (np,"compatible" ,"IBM,vtpm" ) <0 ) { - size =be32_to_cpup (sizep); - base =be64_to_cpup (basep); + size =be32_to_cpup ((__force __be32 *)sizep); + base =be64_to_cpup ((__force __be64 *)basep); }else { size = *sizep; base = *basep;
Signature · 1 line
2.17.0.484.g0c8726318c-goog
Quoted 23 lines · Thiebaud Weksteen
Signed-off-by Thiebaud Weksteen <[email protected]>--- drivers/char/tpm/tpm_eventlog_of.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/char/tpm/tpm_eventlog_of.c +2
-2@@ -56,8 +56,8 @@ int tpm_read_log_of(struct tpm_chip *chip)* but physical tpm needs the conversion. */ if (of_property_match_string (np,"compatible" ,"IBM,vtpm" ) <0 ) { - size =be32_to_cpup (sizep); - base =be64_to_cpup (basep); + size =be32_to_cpup ((__force __be32 *)sizep); + base =be64_to_cpup ((__force __be64 *)basep); }else { size = *sizep; base = *basep;Signature · 1 line
2.17.0.484.g0c8726318c-goog
Repeal and replace, right (no change log)?
/Jarkko
Quoted 7 lines · Jarkko Sakkinen
Review
Quoted 6 lines · Thiebaud Weksteen
Signed-off-by Thiebaud Weksteen <[email protected]>--- drivers/char/tpm/tpm_eventlog_of.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)(quoted diff) +0
-0
b/drivers/char/tpm/tpm_eventlog_of.c
Quoted 11 lines
Quoted 11 lines
index
96fd5646f866..ea0f16f19d73100644drivers/char/tpm/tpm_eventlog_of.c +2
-2@@ -56,8 +56,8 @@ int tpm_read_log_of(struct tpm_chip *chip)* but physical tpm needs the conversion. */ if (of_property_match_string (np,"compatible" ,"IBM,vtpm" ) <0 ) { - size =be32_to_cpup (sizep); - base =be64_to_cpup (basep); + size =be32_to_cpup ((__force __be32 *)sizep); + base =be64_to_cpup ((__force __be64 *)basep);
Quoted 8 lines
Quoted 6 lines
drivers/char/tpm/tpm_eventlog_of.c +0
-1}else { size = *sizep; base = *basep; --2.17.0.484.g0c8726318c-goog
Repeal and replace, right (no change log)?
Yep, that's right. Thanks.
Quoted 1 line
/Jarkko
Quoted 31 lines · Thiebaud Weksteen
Quoted 7 lines · Jarkko Sakkinen
Review
Quoted 6 lines · Thiebaud Weksteen
Signed-off-by Thiebaud Weksteen <[email protected]>--- drivers/char/tpm/tpm_eventlog_of.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)(quoted diff) +0
-0
b/drivers/char/tpm/tpm_eventlog_of.cQuoted 11 lines
Quoted 11 lines
index
96fd5646f866..ea0f16f19d73100644drivers/char/tpm/tpm_eventlog_of.c +2
-2@@ -56,8 +56,8 @@ int tpm_read_log_of(struct tpm_chip *chip)* but physical tpm needs the conversion. */ if (of_property_match_string (np,"compatible" ,"IBM,vtpm" ) <0 ) { - size =be32_to_cpup (sizep); - base =be64_to_cpup (basep); + size =be32_to_cpup ((__force __be32 *)sizep); + base =be64_to_cpup ((__force __be64 *)basep);Quoted 8 lines
Quoted 6 lines
drivers/char/tpm/tpm_eventlog_of.c +0
-1}else { size = *sizep; base = *basep; --2.17.0.484.g0c8726318c-goog
Repeal and replace, right (no change log)?
Quoted 1 line
Yep, that's right. Thanks.
Done.
/Jarkko