linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] memory: tegra: Use DEFINE_SHOW_ATTRIBUTE to simplify code
@ 2022-09-22 14:33 Liu Shixin
  2022-09-22 14:33 ` [PATCH 1/4] memory: tegra20-emc: use " Liu Shixin
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Liu Shixin @ 2022-09-22 14:33 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Thierry Reding, Jonathan Hunter
  Cc: linux-kernel, linux-tegra, Liu Shixin

Use DEFINE_SHOW_ATTRIBUTE helper macro to simplify the code.
No functional change.

Liu Shixin (4):
  memory: tegra20-emc: use DEFINE_SHOW_ATTRIBUTE to simplify code
  memory: tegra30-emc: use DEFINE_SHOW_ATTRIBUTE to simplify code
  memory: tegra210-emc: use DEFINE_SHOW_ATTRIBUTE to simplify code
  memory: tegra186-emc: use DEFINE_SHOW_ATTRIBUTE to simplify code

 drivers/memory/tegra/tegra186-emc.c      | 15 +--------------
 drivers/memory/tegra/tegra20-emc.c       | 15 +--------------
 drivers/memory/tegra/tegra210-emc-core.c | 14 +-------------
 drivers/memory/tegra/tegra30-emc.c       | 15 +--------------
 4 files changed, 4 insertions(+), 55 deletions(-)

-- 
2.25.1


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 1/4] memory: tegra20-emc: use DEFINE_SHOW_ATTRIBUTE to simplify code
  2022-09-22 14:33 [PATCH 0/4] memory: tegra: Use DEFINE_SHOW_ATTRIBUTE to simplify code Liu Shixin
@ 2022-09-22 14:33 ` Liu Shixin
  2022-09-22 14:33 ` [PATCH 2/4] memory: tegra30-emc: " Liu Shixin
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: Liu Shixin @ 2022-09-22 14:33 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Thierry Reding, Jonathan Hunter
  Cc: linux-kernel, linux-tegra, Liu Shixin

Use DEFINE_SHOW_ATTRIBUTE helper macro to simplify the code.
No functional change.

Signed-off-by: Liu Shixin <liushixin2@huawei.com>
---
 drivers/memory/tegra/tegra20-emc.c | 15 +--------------
 1 file changed, 1 insertion(+), 14 deletions(-)

diff --git a/drivers/memory/tegra/tegra20-emc.c b/drivers/memory/tegra/tegra20-emc.c
index 25ba3c5e4ad6..bd4e37b6552d 100644
--- a/drivers/memory/tegra/tegra20-emc.c
+++ b/drivers/memory/tegra/tegra20-emc.c
@@ -841,20 +841,7 @@ static int tegra_emc_debug_available_rates_show(struct seq_file *s, void *data)
 
 	return 0;
 }
-
-static int tegra_emc_debug_available_rates_open(struct inode *inode,
-						struct file *file)
-{
-	return single_open(file, tegra_emc_debug_available_rates_show,
-			   inode->i_private);
-}
-
-static const struct file_operations tegra_emc_debug_available_rates_fops = {
-	.open = tegra_emc_debug_available_rates_open,
-	.read = seq_read,
-	.llseek = seq_lseek,
-	.release = single_release,
-};
+DEFINE_SHOW_ATTRIBUTE(tegra_emc_debug_available_rates);
 
 static int tegra_emc_debug_min_rate_get(void *data, u64 *rate)
 {
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 2/4] memory: tegra30-emc: use DEFINE_SHOW_ATTRIBUTE to simplify code
  2022-09-22 14:33 [PATCH 0/4] memory: tegra: Use DEFINE_SHOW_ATTRIBUTE to simplify code Liu Shixin
  2022-09-22 14:33 ` [PATCH 1/4] memory: tegra20-emc: use " Liu Shixin
@ 2022-09-22 14:33 ` Liu Shixin
  2022-09-22 14:33 ` [PATCH 3/4] memory: tegra210-emc: " Liu Shixin
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: Liu Shixin @ 2022-09-22 14:33 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Thierry Reding, Jonathan Hunter
  Cc: linux-kernel, linux-tegra, Liu Shixin

Use DEFINE_SHOW_ATTRIBUTE helper macro to simplify the code.
No functional change.

Signed-off-by: Liu Shixin <liushixin2@huawei.com>
---
 drivers/memory/tegra/tegra30-emc.c | 15 +--------------
 1 file changed, 1 insertion(+), 14 deletions(-)

diff --git a/drivers/memory/tegra/tegra30-emc.c b/drivers/memory/tegra/tegra30-emc.c
index 9ba2a9e5316b..77706e9bc543 100644
--- a/drivers/memory/tegra/tegra30-emc.c
+++ b/drivers/memory/tegra/tegra30-emc.c
@@ -1359,20 +1359,7 @@ static int tegra_emc_debug_available_rates_show(struct seq_file *s, void *data)
 
 	return 0;
 }
-
-static int tegra_emc_debug_available_rates_open(struct inode *inode,
-						struct file *file)
-{
-	return single_open(file, tegra_emc_debug_available_rates_show,
-			   inode->i_private);
-}
-
-static const struct file_operations tegra_emc_debug_available_rates_fops = {
-	.open = tegra_emc_debug_available_rates_open,
-	.read = seq_read,
-	.llseek = seq_lseek,
-	.release = single_release,
-};
+DEFINE_SHOW_ATTRIBUTE(tegra_emc_debug_available_rates);
 
 static int tegra_emc_debug_min_rate_get(void *data, u64 *rate)
 {
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 3/4] memory: tegra210-emc: use DEFINE_SHOW_ATTRIBUTE to simplify code
  2022-09-22 14:33 [PATCH 0/4] memory: tegra: Use DEFINE_SHOW_ATTRIBUTE to simplify code Liu Shixin
  2022-09-22 14:33 ` [PATCH 1/4] memory: tegra20-emc: use " Liu Shixin
  2022-09-22 14:33 ` [PATCH 2/4] memory: tegra30-emc: " Liu Shixin
@ 2022-09-22 14:33 ` Liu Shixin
  2022-09-26  9:26   ` Krzysztof Kozlowski
  2022-09-22 14:33 ` [PATCH 4/4] memory: tegra186-emc: " Liu Shixin
  2022-09-26  9:26 ` [PATCH 0/4] memory: tegra: Use " Krzysztof Kozlowski
  4 siblings, 1 reply; 8+ messages in thread
From: Liu Shixin @ 2022-09-22 14:33 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Thierry Reding, Jonathan Hunter
  Cc: linux-kernel, linux-tegra, Liu Shixin

Use DEFINE_SHOW_ATTRIBUTE helper macro to simplify the code.
No functional change.

Signed-off-by: Liu Shixin <liushixin2@huawei.com>
---
 drivers/memory/tegra/tegra210-emc-core.c | 14 +-------------
 1 file changed, 1 insertion(+), 13 deletions(-)

diff --git a/drivers/memory/tegra/tegra210-emc-core.c b/drivers/memory/tegra/tegra210-emc-core.c
index cbe1a7723514..603b306daca1 100644
--- a/drivers/memory/tegra/tegra210-emc-core.c
+++ b/drivers/memory/tegra/tegra210-emc-core.c
@@ -1621,20 +1621,8 @@ static int tegra210_emc_debug_available_rates_show(struct seq_file *s,
 
 	return 0;
 }
+DEFINE_SHOW_ATTRIBUTE(tegra210_emc_debug_available_rates);
 
-static int tegra210_emc_debug_available_rates_open(struct inode *inode,
-						   struct file *file)
-{
-	return single_open(file, tegra210_emc_debug_available_rates_show,
-			   inode->i_private);
-}
-
-static const struct file_operations tegra210_emc_debug_available_rates_fops = {
-	.open = tegra210_emc_debug_available_rates_open,
-	.read = seq_read,
-	.llseek = seq_lseek,
-	.release = single_release,
-};
 
 static int tegra210_emc_debug_min_rate_get(void *data, u64 *rate)
 {
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 4/4] memory: tegra186-emc: use DEFINE_SHOW_ATTRIBUTE to simplify code
  2022-09-22 14:33 [PATCH 0/4] memory: tegra: Use DEFINE_SHOW_ATTRIBUTE to simplify code Liu Shixin
                   ` (2 preceding siblings ...)
  2022-09-22 14:33 ` [PATCH 3/4] memory: tegra210-emc: " Liu Shixin
@ 2022-09-22 14:33 ` Liu Shixin
  2022-09-26  9:26 ` [PATCH 0/4] memory: tegra: Use " Krzysztof Kozlowski
  4 siblings, 0 replies; 8+ messages in thread
From: Liu Shixin @ 2022-09-22 14:33 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Thierry Reding, Jonathan Hunter
  Cc: linux-kernel, linux-tegra, Liu Shixin

Use DEFINE_SHOW_ATTRIBUTE helper macro to simplify the code.
No functional change.

Signed-off-by: Liu Shixin <liushixin2@huawei.com>
---
 drivers/memory/tegra/tegra186-emc.c | 15 +--------------
 1 file changed, 1 insertion(+), 14 deletions(-)

diff --git a/drivers/memory/tegra/tegra186-emc.c b/drivers/memory/tegra/tegra186-emc.c
index 54b47ca33483..26e763bde92a 100644
--- a/drivers/memory/tegra/tegra186-emc.c
+++ b/drivers/memory/tegra/tegra186-emc.c
@@ -84,20 +84,7 @@ static int tegra186_emc_debug_available_rates_show(struct seq_file *s,
 
 	return 0;
 }
-
-static int tegra186_emc_debug_available_rates_open(struct inode *inode,
-						   struct file *file)
-{
-	return single_open(file, tegra186_emc_debug_available_rates_show,
-			   inode->i_private);
-}
-
-static const struct file_operations tegra186_emc_debug_available_rates_fops = {
-	.open = tegra186_emc_debug_available_rates_open,
-	.read = seq_read,
-	.llseek = seq_lseek,
-	.release = single_release,
-};
+DEFINE_SHOW_ATTRIBUTE(tegra186_emc_debug_available_rates);
 
 static int tegra186_emc_debug_min_rate_get(void *data, u64 *rate)
 {
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH 0/4] memory: tegra: Use DEFINE_SHOW_ATTRIBUTE to simplify code
  2022-09-22 14:33 [PATCH 0/4] memory: tegra: Use DEFINE_SHOW_ATTRIBUTE to simplify code Liu Shixin
                   ` (3 preceding siblings ...)
  2022-09-22 14:33 ` [PATCH 4/4] memory: tegra186-emc: " Liu Shixin
@ 2022-09-26  9:26 ` Krzysztof Kozlowski
  4 siblings, 0 replies; 8+ messages in thread
From: Krzysztof Kozlowski @ 2022-09-26  9:26 UTC (permalink / raw)
  To: Liu Shixin, Thierry Reding, Jonathan Hunter; +Cc: linux-kernel, linux-tegra

On 22/09/2022 16:33, Liu Shixin wrote:
> Use DEFINE_SHOW_ATTRIBUTE helper macro to simplify the code.
> No functional change.
> 
> Liu Shixin (4):
>   memory: tegra20-emc: use DEFINE_SHOW_ATTRIBUTE to simplify code
>   memory: tegra30-emc: use DEFINE_SHOW_ATTRIBUTE to simplify code
>   memory: tegra210-emc: use DEFINE_SHOW_ATTRIBUTE to simplify code
>   memory: tegra186-emc: use DEFINE_SHOW_ATTRIBUTE to simplify code
> 

Any review from nVidia-interested folks? :)

Best regards,
Krzysztof


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 3/4] memory: tegra210-emc: use DEFINE_SHOW_ATTRIBUTE to simplify code
  2022-09-22 14:33 ` [PATCH 3/4] memory: tegra210-emc: " Liu Shixin
@ 2022-09-26  9:26   ` Krzysztof Kozlowski
  2022-09-26 12:37     ` Liu Shixin
  0 siblings, 1 reply; 8+ messages in thread
From: Krzysztof Kozlowski @ 2022-09-26  9:26 UTC (permalink / raw)
  To: Liu Shixin, Thierry Reding, Jonathan Hunter; +Cc: linux-kernel, linux-tegra

On 22/09/2022 16:33, Liu Shixin wrote:
> Use DEFINE_SHOW_ATTRIBUTE helper macro to simplify the code.
> No functional change.
> 
> Signed-off-by: Liu Shixin <liushixin2@huawei.com>
> ---
>  drivers/memory/tegra/tegra210-emc-core.c | 14 +-------------
>  1 file changed, 1 insertion(+), 13 deletions(-)
> 
> diff --git a/drivers/memory/tegra/tegra210-emc-core.c b/drivers/memory/tegra/tegra210-emc-core.c
> index cbe1a7723514..603b306daca1 100644
> --- a/drivers/memory/tegra/tegra210-emc-core.c
> +++ b/drivers/memory/tegra/tegra210-emc-core.c
> @@ -1621,20 +1621,8 @@ static int tegra210_emc_debug_available_rates_show(struct seq_file *s,
>  
>  	return 0;
>  }
> +DEFINE_SHOW_ATTRIBUTE(tegra210_emc_debug_available_rates);
>  
> -static int tegra210_emc_debug_available_rates_open(struct inode *inode,
> -						   struct file *file)
> -{
> -	return single_open(file, tegra210_emc_debug_available_rates_show,
> -			   inode->i_private);
> -}
> -
> -static const struct file_operations tegra210_emc_debug_available_rates_fops = {
> -	.open = tegra210_emc_debug_available_rates_open,
> -	.read = seq_read,
> -	.llseek = seq_lseek,
> -	.release = single_release,
> -};
>  

It looks you leave here two blank lines. If so, please fix it - only one
blank line.

>  static int tegra210_emc_debug_min_rate_get(void *data, u64 *rate)
>  {

Best regards,
Krzysztof


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 3/4] memory: tegra210-emc: use DEFINE_SHOW_ATTRIBUTE to simplify code
  2022-09-26  9:26   ` Krzysztof Kozlowski
@ 2022-09-26 12:37     ` Liu Shixin
  0 siblings, 0 replies; 8+ messages in thread
From: Liu Shixin @ 2022-09-26 12:37 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Thierry Reding, Jonathan Hunter
  Cc: linux-kernel, linux-tegra



On 2022/9/26 17:26, Krzysztof Kozlowski wrote:
> On 22/09/2022 16:33, Liu Shixin wrote:
>> Use DEFINE_SHOW_ATTRIBUTE helper macro to simplify the code.
>> No functional change.
>>
>> Signed-off-by: Liu Shixin <liushixin2@huawei.com>
>> ---
>>  drivers/memory/tegra/tegra210-emc-core.c | 14 +-------------
>>  1 file changed, 1 insertion(+), 13 deletions(-)
>>
>> diff --git a/drivers/memory/tegra/tegra210-emc-core.c b/drivers/memory/tegra/tegra210-emc-core.c
>> index cbe1a7723514..603b306daca1 100644
>> --- a/drivers/memory/tegra/tegra210-emc-core.c
>> +++ b/drivers/memory/tegra/tegra210-emc-core.c
>> @@ -1621,20 +1621,8 @@ static int tegra210_emc_debug_available_rates_show(struct seq_file *s,
>>  
>>  	return 0;
>>  }
>> +DEFINE_SHOW_ATTRIBUTE(tegra210_emc_debug_available_rates);
>>  
>> -static int tegra210_emc_debug_available_rates_open(struct inode *inode,
>> -						   struct file *file)
>> -{
>> -	return single_open(file, tegra210_emc_debug_available_rates_show,
>> -			   inode->i_private);
>> -}
>> -
>> -static const struct file_operations tegra210_emc_debug_available_rates_fops = {
>> -	.open = tegra210_emc_debug_available_rates_open,
>> -	.read = seq_read,
>> -	.llseek = seq_lseek,
>> -	.release = single_release,
>> -};
>>  
> It looks you leave here two blank lines. If so, please fix it - only one
> blank line.
Thanks for the reminder, I have removed the duplicate blank lines in next version.

Thanks,
>
>>  static int tegra210_emc_debug_min_rate_get(void *data, u64 *rate)
>>  {
> Best regards,
> Krzysztof
>
> .
>


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-09-26 14:26 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-22 14:33 [PATCH 0/4] memory: tegra: Use DEFINE_SHOW_ATTRIBUTE to simplify code Liu Shixin
2022-09-22 14:33 ` [PATCH 1/4] memory: tegra20-emc: use " Liu Shixin
2022-09-22 14:33 ` [PATCH 2/4] memory: tegra30-emc: " Liu Shixin
2022-09-22 14:33 ` [PATCH 3/4] memory: tegra210-emc: " Liu Shixin
2022-09-26  9:26   ` Krzysztof Kozlowski
2022-09-26 12:37     ` Liu Shixin
2022-09-22 14:33 ` [PATCH 4/4] memory: tegra186-emc: " Liu Shixin
2022-09-26  9:26 ` [PATCH 0/4] memory: tegra: Use " Krzysztof Kozlowski

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).