tpm_tis: Use DEFINE_RES_MEM() to simplify code
Subsystems (2)
PATCH 1/1 tpm_tis: Use DEFINE_RES_MEM() to simplify code
No functional change.
--- drivers/char/tpm/tpm_tis.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/char/tpm/tpm_tis.c +1 -5
@@ -363,11 +363,7 @@ static int tpm_tis_force_device(void) {struct platform_device *pdev;static const struct resource x86_resources[] = { - { - .start =0xFED40000 , - .end =0xFED40000 +TIS_MEM_LEN -1 , - .flags =IORESOURCE_MEM , - }, +DEFINE_RES_MEM (0xFED40000 ,TIS_MEM_LEN ) };if (!force)
Signature · 1 line
2.26.0.106.g9fadedd
Jarkko Sakkinen
maintainerQuoted 3 lines · Zhen Lei
No functional change.
Signed-off-by Zhen Lei <[email protected]>
No change, no need to apply?
/Jarkko
Quoted 26 lines
--- drivers/char/tpm/tpm_tis.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)drivers/char/tpm/tpm_tis.c +1
-5@@ -363,11 +363,7 @@ static int tpm_tis_force_device(void) {struct platform_device *pdev;static const struct resource x86_resources[] = { - { - .start =0xFED40000 , - .end =0xFED40000 +TIS_MEM_LEN -1 , - .flags =IORESOURCE_MEM , - }, +DEFINE_RES_MEM (0xFED40000 ,TIS_MEM_LEN ) };if (!force)Signature · 1 line
2.26.0.106.g9fadedd
Quoted 6 lines · Jarkko Sakkinen
Quoted 3 lines · Zhen Lei
No functional change.
Signed-off-by Zhen Lei <[email protected]>No change, no need to apply?
But it can make the code look simpler, easier to read and maintain(The start address does not need to appear twice). I think that's why these DEFINE_RES_* macros are defined.
By the way, would it be better to change the letters in 0xFED40000 to lowercase?
Quoted 32 lines
/Jarkko
Quoted 26 lines
--- drivers/char/tpm/tpm_tis.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)drivers/char/tpm/tpm_tis.c +1
-5@@ -363,11 +363,7 @@ static int tpm_tis_force_device(void) {struct platform_device *pdev;static const struct resource x86_resources[] = { - { - .start =0xFED40000 , - .end =0xFED40000 +TIS_MEM_LEN -1 , - .flags =IORESOURCE_MEM , - }, +DEFINE_RES_MEM (0xFED40000 ,TIS_MEM_LEN ) };if (!force)Signature · 1 line
2.26.0.106.g9fadedd.
Jarkko Sakkinen
maintainerQuoted 8 lines · Leizhen (ThunderTown)
Quoted 5 lines · Jarkko Sakkinen
Quoted 3 lines · Zhen Lei
No functional change.
Signed-off-by Zhen Lei <[email protected]>
Quoted 7 lines
Quoted 1 line
No change, no need to apply?
But it can make the code look simpler, easier to read and maintain(The start address does not need to appear twice). I think that's why these DEFINE_RES_* macros are defined.
By the way, would it be better to change the letters in
0xFED40000to lowercase?
I mean "No functional change" does not really tell anything about anything.
Please just describe what the commit does.
/Jarkko
Quoted 35 lines
Quoted 33 lines
/Jarkko
Quoted 26 lines
--- drivers/char/tpm/tpm_tis.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)drivers/char/tpm/tpm_tis.c +1
-5@@ -363,11 +363,7 @@ static int tpm_tis_force_device(void) {struct platform_device *pdev;static const struct resource x86_resources[] = { - { - .start =0xFED40000 , - .end =0xFED40000 +TIS_MEM_LEN -1 , - .flags =IORESOURCE_MEM , - }, +DEFINE_RES_MEM (0xFED40000 ,TIS_MEM_LEN ) };if (!force)Signature · 1 line
2.26.0.106.g9fadedd.
Quoted 15 lines · Jarkko Sakkinen
Quoted 14 lines · Leizhen (ThunderTown)
Quoted 6 lines · Jarkko Sakkinen
Quoted 3 lines · Zhen Lei
No functional change.
Signed-off-by Zhen Lei <[email protected]>No change, no need to apply?
But it can make the code look simpler, easier to read and maintain(The start address does not need to appear twice). I think that's why these DEFINE_RES_* macros are defined.
Quoted 5 lines
Quoted 1 line
By the way, would it be better to change the letters in
0xFED40000to lowercase?I mean "No functional change" does not really tell anything about anything.
Please just describe what the commit does.
I'm sorry to have misunderstood your intention. OK, I rewrite the commit message.
Quoted 41 lines
/Jarkko
Quoted 24 lines
Quoted 24 lines
/Jarkko
Quoted 20 lines
--- drivers/char/tpm/tpm_tis.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)drivers/char/tpm/tpm_tis.c +1
-5@@ -363,11 +363,7 @@ static int tpm_tis_force_device(void) {struct platform_device *pdev;static const struct resource x86_resources[] = { - { - .start =0xFED40000 , - .end =0xFED40000 +TIS_MEM_LEN -1 , - .flags =IORESOURCE_MEM , - }, +DEFINE_RES_MEM (0xFED40000 ,TIS_MEM_LEN ) };Quoted 11 lines
Quoted 9 lines
Quoted 6 lines
drivers/char/tpm/tpm_tis.c +0
-0if (!force)Signature · 1 line
2.26.0.106.g9fadedd.
.