linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: kbuild test robot <lkp@intel.com>
To: Felix Fietkau <nbd@nbd.name>
Cc: kbuild-all@01.org, linux-wireless@vger.kernel.org, kvalo@codeaurora.org
Subject: [PATCH] mt76: fix debugfs_simple_attr.cocci warnings
Date: Thu, 23 Nov 2017 15:27:23 +0800	[thread overview]
Message-ID: <20171123072723.GA16326@lkp-ne02> (raw)
In-Reply-To: <20171120193549.80831-4-nbd@nbd.name>

drivers/net/wireless/mediatek/mt76/debugfs.c:36:0-23: WARNING: fops_regval should be defined with DEFINE_DEBUGFS_ATTRIBUTE

 Use DEFINE_DEBUGFS_ATTRIBUTE rather than DEFINE_SIMPLE_ATTRIBUTE
 for debugfs files.

Semantic patch information:
 Rationale: DEFINE_SIMPLE_ATTRIBUTE + debugfs_create_file()
 imposes some significant overhead as compared to
 DEFINE_DEBUGFS_ATTRIBUTE + debugfs_create_file_unsafe().

Generated by: scripts/coccinelle/api/debugfs/debugfs_simple_attr.cocci

Fixes: a5f6039c8f9c ("mt76: add driver code for MT76x2e")
CC: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
---

Please take the patch only if it's a positive warning. Thanks!

 debugfs.c |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

--- a/drivers/net/wireless/mediatek/mt76/debugfs.c
+++ b/drivers/net/wireless/mediatek/mt76/debugfs.c
@@ -33,7 +33,8 @@ mt76_reg_get(void *data, u64 *val)
 	return 0;
 }
 
-DEFINE_SIMPLE_ATTRIBUTE(fops_regval, mt76_reg_get, mt76_reg_set, "0x%08llx\n");
+DEFINE_DEBUGFS_ATTRIBUTE(fops_regval, mt76_reg_get, mt76_reg_set,
+			 "0x%08llx\n");
 
 static int
 mt76_queues_read(struct seq_file *s, void *data)
@@ -65,8 +66,8 @@ struct dentry *mt76_register_debugfs(str
 
 	debugfs_create_u8("led_pin", S_IRUSR | S_IWUSR, dir, &dev->led_pin);
 	debugfs_create_u32("regidx", S_IRUSR | S_IWUSR, dir, &dev->debugfs_reg);
-	debugfs_create_file("regval", S_IRUSR | S_IWUSR, dir, dev,
-			    &fops_regval);
+	debugfs_create_file_unsafe("regval", S_IRUSR | S_IWUSR, dir, dev,
+				   &fops_regval);
 	debugfs_create_blob("eeprom", S_IRUSR, dir, &dev->eeprom);
 	if (dev->otp.data)
 		debugfs_create_blob("otp", S_IRUSR, dir, &dev->otp);

  parent reply	other threads:[~2017-11-23  7:28 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-20 19:35 [PATCH v7 0/3] mt76: add new wireless driver for MediaTek MT76x2 PCIe chips Felix Fietkau
2017-11-20 19:35 ` [PATCH v7 1/3] dt-bindings: net: add mt76 wireless device binding Felix Fietkau
2017-11-20 21:34   ` Rob Herring
2017-11-21  7:08   ` [v7,1/3] " Kalle Valo
     [not found]   ` <20171121070837.AA354607EA@smtp.codeaurora.org>
2017-11-21  8:45     ` Felix Fietkau
2017-11-20 19:35 ` [PATCH v7 2/3] mt76: add common code shared between multiple chipsets Felix Fietkau
2017-11-20 19:35 ` [PATCH v7 3/3] mt76: add driver code for MT76x2e Felix Fietkau
2017-11-23  7:05   ` kbuild test robot
2017-11-23  7:42     ` Kalle Valo
2017-11-23  7:27   ` kbuild test robot
2017-11-23  7:27   ` kbuild test robot [this message]
2017-12-07 13:42     ` [PATCH] mt76: fix debugfs_simple_attr.cocci warnings Kalle Valo
2017-12-08  1:29       ` Fengguang Wu
2017-11-23  7:27   ` [PATCH] mt76: fix returnvar.cocci warnings kbuild test robot
2017-12-07 13:43     ` Kalle Valo
  -- strict thread matches above, loose matches on Subject: below --
2017-02-02 14:06 [PATCH] mt76: fix debugfs_simple_attr.cocci warnings Julia Lawall

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171123072723.GA16326@lkp-ne02 \
    --to=lkp@intel.com \
    --cc=kbuild-all@01.org \
    --cc=kvalo@codeaurora.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=nbd@nbd.name \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).