linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] mt7601u: Convert to DEFINE_SHOW_ATTRIBUTE
@ 2020-07-16  8:57 Qinglang Miao
  2020-07-16 15:20 ` Jakub Kicinski
  2020-08-02 15:11 ` Kalle Valo
  0 siblings, 2 replies; 6+ messages in thread
From: Qinglang Miao @ 2020-07-16  8:57 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Jakub Kicinski; +Cc: linux-wireless, open list

Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code.

Signed-off-by: Qinglang Miao <miaoqinglang@huawei.com>
---
 .../net/wireless/mediatek/mt7601u/debugfs.c   | 34 ++++---------------
 1 file changed, 6 insertions(+), 28 deletions(-)

diff --git a/drivers/net/wireless/mediatek/mt7601u/debugfs.c b/drivers/net/wireless/mediatek/mt7601u/debugfs.c
index eaabba20d..20669eacb 100644
--- a/drivers/net/wireless/mediatek/mt7601u/debugfs.c
+++ b/drivers/net/wireless/mediatek/mt7601u/debugfs.c
@@ -30,7 +30,7 @@ mt76_reg_get(void *data, u64 *val)
 DEFINE_DEBUGFS_ATTRIBUTE(fops_regval, mt76_reg_get, mt76_reg_set, "0x%08llx\n");
 
 static int
-mt7601u_ampdu_stat_read(struct seq_file *file, void *data)
+mt7601u_ampdu_stat_show(struct seq_file *file, void *data)
 {
 	struct mt7601u_dev *dev = file->private;
 	int i, j;
@@ -73,21 +73,10 @@ mt7601u_ampdu_stat_read(struct seq_file *file, void *data)
 	return 0;
 }
 
-static int
-mt7601u_ampdu_stat_open(struct inode *inode, struct file *f)
-{
-	return single_open(f, mt7601u_ampdu_stat_read, inode->i_private);
-}
-
-static const struct file_operations fops_ampdu_stat = {
-	.open = mt7601u_ampdu_stat_open,
-	.read_iter = seq_read_iter,
-	.llseek = seq_lseek,
-	.release = single_release,
-};
+DEFINE_SHOW_ATTRIBUTE(mt7601u_ampdu_stat);
 
 static int
-mt7601u_eeprom_param_read(struct seq_file *file, void *data)
+mt7601u_eeprom_param_show(struct seq_file *file, void *data)
 {
 	struct mt7601u_dev *dev = file->private;
 	struct mt7601u_rate_power *rp = &dev->ee->power_rate_table;
@@ -131,18 +120,7 @@ mt7601u_eeprom_param_read(struct seq_file *file, void *data)
 	return 0;
 }
 
-static int
-mt7601u_eeprom_param_open(struct inode *inode, struct file *f)
-{
-	return single_open(f, mt7601u_eeprom_param_read, inode->i_private);
-}
-
-static const struct file_operations fops_eeprom_param = {
-	.open = mt7601u_eeprom_param_open,
-	.read_iter = seq_read_iter,
-	.llseek = seq_lseek,
-	.release = single_release,
-};
+DEFINE_SHOW_ATTRIBUTE(mt7601u_eeprom_param);
 
 void mt7601u_init_debugfs(struct mt7601u_dev *dev)
 {
@@ -157,6 +135,6 @@ void mt7601u_init_debugfs(struct mt7601u_dev *dev)
 
 	debugfs_create_u32("regidx", 0600, dir, &dev->debugfs_reg);
 	debugfs_create_file("regval", 0600, dir, dev, &fops_regval);
-	debugfs_create_file("ampdu_stat", 0400, dir, dev, &fops_ampdu_stat);
-	debugfs_create_file("eeprom_param", 0400, dir, dev, &fops_eeprom_param);
+	debugfs_create_file("ampdu_stat", 0400, dir, dev, &mt7601u_ampdu_stat_fops);
+	debugfs_create_file("eeprom_param", 0400, dir, dev, &mt7601u_eeprom_param_fops);
 }
-- 
2.17.1


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

* Re: [PATCH -next] mt7601u: Convert to DEFINE_SHOW_ATTRIBUTE
  2020-07-16  8:57 [PATCH -next] mt7601u: Convert to DEFINE_SHOW_ATTRIBUTE Qinglang Miao
@ 2020-07-16 15:20 ` Jakub Kicinski
  2020-09-19  2:49   ` miaoqinglang
  2020-08-02 15:11 ` Kalle Valo
  1 sibling, 1 reply; 6+ messages in thread
From: Jakub Kicinski @ 2020-07-16 15:20 UTC (permalink / raw)
  To: Qinglang Miao; +Cc: Greg Kroah-Hartman, linux-wireless, open list

On Thu, 16 Jul 2020 16:57:49 +0800 Qinglang Miao wrote:
> Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code.
> 
> Signed-off-by: Qinglang Miao <miaoqinglang@huawei.com>

Acked-by: Jakub Kicinski <kubakici@wp.pl>

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

* Re: [PATCH -next] mt7601u: Convert to DEFINE_SHOW_ATTRIBUTE
  2020-07-16  8:57 [PATCH -next] mt7601u: Convert to DEFINE_SHOW_ATTRIBUTE Qinglang Miao
  2020-07-16 15:20 ` Jakub Kicinski
@ 2020-08-02 15:11 ` Kalle Valo
  1 sibling, 0 replies; 6+ messages in thread
From: Kalle Valo @ 2020-08-02 15:11 UTC (permalink / raw)
  To: Qinglang Miao
  Cc: Greg Kroah-Hartman, Jakub Kicinski, linux-wireless, open list

Qinglang Miao <miaoqinglang@huawei.com> wrote:

> Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code.
> 
> Signed-off-by: Qinglang Miao <miaoqinglang@huawei.com>
> Acked-by: Jakub Kicinski <kubakici@wp.pl>

Fails to apply to wireless-drivers-next:

fatal: sha1 information is lacking or useless (drivers/net/wireless/mediatek/mt7601u/debugfs.c).
error: could not build fake ancestor
Applying: mt7601u: Convert to DEFINE_SHOW_ATTRIBUTE
Patch failed at 0001 mt7601u: Convert to DEFINE_SHOW_ATTRIBUTE
The copy of the patch that failed is found in: .git/rebase-apply/patch

Patch set to Changes Requested.

-- 
https://patchwork.kernel.org/patch/11666949/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


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

* Re: [PATCH -next] mt7601u: Convert to DEFINE_SHOW_ATTRIBUTE
  2020-07-16 15:20 ` Jakub Kicinski
@ 2020-09-19  2:49   ` miaoqinglang
  2020-10-09 15:42     ` Kalle Valo
  0 siblings, 1 reply; 6+ messages in thread
From: miaoqinglang @ 2020-09-19  2:49 UTC (permalink / raw)
  To: Jakub Kicinski; +Cc: Greg Kroah-Hartman, linux-wireless, open list



在 2020/7/16 23:20, Jakub Kicinski 写道:
> On Thu, 16 Jul 2020 16:57:49 +0800 Qinglang Miao wrote:
>> Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code.
>>
>> Signed-off-by: Qinglang Miao <miaoqinglang@huawei.com>
> 
> Acked-by: Jakub Kicinski <kubakici@wp.pl>
> 
Hi Jakub,

I noticed that this patch has been acked by you and not patched into 
linux-next. There's little difference now so resent a new patch against 
linux-next(20200917), and it can be applied to mainline cleanly now.

Thanks.

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

* Re: [PATCH -next] mt7601u: Convert to DEFINE_SHOW_ATTRIBUTE
  2020-09-19  2:49   ` miaoqinglang
@ 2020-10-09 15:42     ` Kalle Valo
  2020-10-09 15:45       ` Kalle Valo
  0 siblings, 1 reply; 6+ messages in thread
From: Kalle Valo @ 2020-10-09 15:42 UTC (permalink / raw)
  To: miaoqinglang
  Cc: Jakub Kicinski, Greg Kroah-Hartman, linux-wireless, open list

miaoqinglang <miaoqinglang@huawei.com> writes:

> 在 2020/7/16 23:20, Jakub Kicinski 写道:
>> On Thu, 16 Jul 2020 16:57:49 +0800 Qinglang Miao wrote:
>>> Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code.
>>>
>>> Signed-off-by: Qinglang Miao <miaoqinglang@huawei.com>
>>
>> Acked-by: Jakub Kicinski <kubakici@wp.pl>
>>
> Hi Jakub,
>
> I noticed that this patch has been acked by you and not patched into
> linux-next. There's little difference now so resent a new patch
> against linux-next(20200917), and it can be applied to mainline
> cleanly now.

This patch didn't apply to wireless-drivers-next and my script sent you
an email about it:

https://patchwork.kernel.org/patch/11666949/

Please rebase over latest wireless-drivers-next and resend as v2.

-- 
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

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

* Re: [PATCH -next] mt7601u: Convert to DEFINE_SHOW_ATTRIBUTE
  2020-10-09 15:42     ` Kalle Valo
@ 2020-10-09 15:45       ` Kalle Valo
  0 siblings, 0 replies; 6+ messages in thread
From: Kalle Valo @ 2020-10-09 15:45 UTC (permalink / raw)
  To: miaoqinglang
  Cc: Jakub Kicinski, Greg Kroah-Hartman, linux-wireless, open list

Kalle Valo <kvalo@codeaurora.org> writes:

> miaoqinglang <miaoqinglang@huawei.com> writes:
>
>> 在 2020/7/16 23:20, Jakub Kicinski 写道:
>>> On Thu, 16 Jul 2020 16:57:49 +0800 Qinglang Miao wrote:
>>>> Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code.
>>>>
>>>> Signed-off-by: Qinglang Miao <miaoqinglang@huawei.com>
>>>
>>> Acked-by: Jakub Kicinski <kubakici@wp.pl>
>>>
>> Hi Jakub,
>>
>> I noticed that this patch has been acked by you and not patched into
>> linux-next. There's little difference now so resent a new patch
>> against linux-next(20200917), and it can be applied to mainline
>> cleanly now.
>
> This patch didn't apply to wireless-drivers-next and my script sent you
> an email about it:
>
> https://patchwork.kernel.org/patch/11666949/
>
> Please rebase over latest wireless-drivers-next and resend as v2.

Nevermind, I see that you sent v2 already and that was applied. Sorry
for the noise.

-- 
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

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

end of thread, other threads:[~2020-10-09 15:45 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-16  8:57 [PATCH -next] mt7601u: Convert to DEFINE_SHOW_ATTRIBUTE Qinglang Miao
2020-07-16 15:20 ` Jakub Kicinski
2020-09-19  2:49   ` miaoqinglang
2020-10-09 15:42     ` Kalle Valo
2020-10-09 15:45       ` Kalle Valo
2020-08-02 15:11 ` Kalle Valo

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