tpm_tis: Use DEFINE_RES_MEM() to simplify code
Subsystems (2)
v2 cover tpm_tis: Use DEFINE_RES_MEM() to simplify code
v1 --> v2:
Update commit message.
Zhen Lei (1):
tpm_tis: Use DEFINE_RES_MEM() to simplify code
drivers/char/tpm/tpm_tis.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
Signature · 1 line
2.26.0.106.g9fadedd
PATCH v2 1/1 tpm_tis: Use DEFINE_RES_MEM() to simplify code
Use DEFINE_RES_MEM() to save a couple of lines of code, which is simpler and more readable. The start address does not need to appear twice.
Signed-off-by Zhen Lei <[email protected]>
--- 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 4 lines · Zhen Lei
Use
DEFINE_RES_MEM()to save a couple of lines of code, which is simpler and more readable. The start address does not need to appear twice.Signed-off-by Zhen Lei <[email protected]>
Reviewed-by Jarkko Sakkinen <[email protected]>
/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