* [PATCH 1/1] tpm_tis: Use DEFINE_RES_MEM() to simplify code
@ 2021-06-01 6:45 Zhen Lei
2021-06-01 17:57 ` Jarkko Sakkinen
0 siblings, 1 reply; 5+ messages in thread
From: Zhen Lei @ 2021-06-01 6:45 UTC (permalink / raw)
To: Peter Huewe, Jarkko Sakkinen, Jason Gunthorpe, linux-integrity,
linux-kernel
Cc: Zhen Lei
No functional change.
Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
---
drivers/char/tpm/tpm_tis.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/drivers/char/tpm/tpm_tis.c b/drivers/char/tpm/tpm_tis.c
index 4ed6e660273a414..d3f2e5364c275f4 100644
--- a/drivers/char/tpm/tpm_tis.c
+++ b/drivers/char/tpm/tpm_tis.c
@@ -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)
--
2.26.0.106.g9fadedd
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 1/1] tpm_tis: Use DEFINE_RES_MEM() to simplify code
2021-06-01 6:45 [PATCH 1/1] tpm_tis: Use DEFINE_RES_MEM() to simplify code Zhen Lei
@ 2021-06-01 17:57 ` Jarkko Sakkinen
2021-06-02 1:11 ` Leizhen (ThunderTown)
0 siblings, 1 reply; 5+ messages in thread
From: Jarkko Sakkinen @ 2021-06-01 17:57 UTC (permalink / raw)
To: Zhen Lei; +Cc: Peter Huewe, Jason Gunthorpe, linux-integrity, linux-kernel
On Tue, Jun 01, 2021 at 02:45:07PM +0800, Zhen Lei wrote:
> No functional change.
>
> Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
No change, no need to apply?
/Jarkko
> ---
> drivers/char/tpm/tpm_tis.c | 6 +-----
> 1 file changed, 1 insertion(+), 5 deletions(-)
>
> diff --git a/drivers/char/tpm/tpm_tis.c b/drivers/char/tpm/tpm_tis.c
> index 4ed6e660273a414..d3f2e5364c275f4 100644
> --- a/drivers/char/tpm/tpm_tis.c
> +++ b/drivers/char/tpm/tpm_tis.c
> @@ -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)
> --
> 2.26.0.106.g9fadedd
>
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/1] tpm_tis: Use DEFINE_RES_MEM() to simplify code
2021-06-01 17:57 ` Jarkko Sakkinen
@ 2021-06-02 1:11 ` Leizhen (ThunderTown)
2021-06-03 5:29 ` Jarkko Sakkinen
0 siblings, 1 reply; 5+ messages in thread
From: Leizhen (ThunderTown) @ 2021-06-02 1:11 UTC (permalink / raw)
To: Jarkko Sakkinen
Cc: Peter Huewe, Jason Gunthorpe, linux-integrity, linux-kernel
On 2021/6/2 1:57, Jarkko Sakkinen wrote:
> On Tue, Jun 01, 2021 at 02:45:07PM +0800, Zhen Lei wrote:
>> No functional change.
>>
>> Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
>
> 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?
>
> /Jarkko
>
>> ---
>> drivers/char/tpm/tpm_tis.c | 6 +-----
>> 1 file changed, 1 insertion(+), 5 deletions(-)
>>
>> diff --git a/drivers/char/tpm/tpm_tis.c b/drivers/char/tpm/tpm_tis.c
>> index 4ed6e660273a414..d3f2e5364c275f4 100644
>> --- a/drivers/char/tpm/tpm_tis.c
>> +++ b/drivers/char/tpm/tpm_tis.c
>> @@ -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)
>> --
>> 2.26.0.106.g9fadedd
>>
>>
>>
>
> .
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/1] tpm_tis: Use DEFINE_RES_MEM() to simplify code
2021-06-02 1:11 ` Leizhen (ThunderTown)
@ 2021-06-03 5:29 ` Jarkko Sakkinen
2021-06-03 6:27 ` Leizhen (ThunderTown)
0 siblings, 1 reply; 5+ messages in thread
From: Jarkko Sakkinen @ 2021-06-03 5:29 UTC (permalink / raw)
To: Leizhen (ThunderTown)
Cc: Peter Huewe, Jason Gunthorpe, linux-integrity, linux-kernel
On Wed, Jun 02, 2021 at 09:11:47AM +0800, Leizhen (ThunderTown) wrote:
>
>
> On 2021/6/2 1:57, Jarkko Sakkinen wrote:
> > On Tue, Jun 01, 2021 at 02:45:07PM +0800, Zhen Lei wrote:
> >> No functional change.
> >>
> >> Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
> >
> > 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?
I mean "No functional change" does not really tell anything about anything.
Please just describe what the commit does.
/Jarkko
>
> >
> > /Jarkko
> >
> >> ---
> >> drivers/char/tpm/tpm_tis.c | 6 +-----
> >> 1 file changed, 1 insertion(+), 5 deletions(-)
> >>
> >> diff --git a/drivers/char/tpm/tpm_tis.c b/drivers/char/tpm/tpm_tis.c
> >> index 4ed6e660273a414..d3f2e5364c275f4 100644
> >> --- a/drivers/char/tpm/tpm_tis.c
> >> +++ b/drivers/char/tpm/tpm_tis.c
> >> @@ -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)
> >> --
> >> 2.26.0.106.g9fadedd
> >>
> >>
> >>
> >
> > .
> >
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/1] tpm_tis: Use DEFINE_RES_MEM() to simplify code
2021-06-03 5:29 ` Jarkko Sakkinen
@ 2021-06-03 6:27 ` Leizhen (ThunderTown)
0 siblings, 0 replies; 5+ messages in thread
From: Leizhen (ThunderTown) @ 2021-06-03 6:27 UTC (permalink / raw)
To: Jarkko Sakkinen
Cc: Peter Huewe, Jason Gunthorpe, linux-integrity, linux-kernel
On 2021/6/3 13:29, Jarkko Sakkinen wrote:
> On Wed, Jun 02, 2021 at 09:11:47AM +0800, Leizhen (ThunderTown) wrote:
>>
>>
>> On 2021/6/2 1:57, Jarkko Sakkinen wrote:
>>> On Tue, Jun 01, 2021 at 02:45:07PM +0800, Zhen Lei wrote:
>>>> No functional change.
>>>>
>>>> Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
>>>
>>> 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?
>
> 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.
>
> /Jarkko
>
>>
>>>
>>> /Jarkko
>>>
>>>> ---
>>>> drivers/char/tpm/tpm_tis.c | 6 +-----
>>>> 1 file changed, 1 insertion(+), 5 deletions(-)
>>>>
>>>> diff --git a/drivers/char/tpm/tpm_tis.c b/drivers/char/tpm/tpm_tis.c
>>>> index 4ed6e660273a414..d3f2e5364c275f4 100644
>>>> --- a/drivers/char/tpm/tpm_tis.c
>>>> +++ b/drivers/char/tpm/tpm_tis.c
>>>> @@ -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)
>>>> --
>>>> 2.26.0.106.g9fadedd
>>>>
>>>>
>>>>
>>>
>>> .
>>>
>>
>>
>
> .
>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2021-06-03 6:27 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-01 6:45 [PATCH 1/1] tpm_tis: Use DEFINE_RES_MEM() to simplify code Zhen Lei
2021-06-01 17:57 ` Jarkko Sakkinen
2021-06-02 1:11 ` Leizhen (ThunderTown)
2021-06-03 5:29 ` Jarkko Sakkinen
2021-06-03 6:27 ` Leizhen (ThunderTown)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).