From patchwork Thu Nov 23 07:27:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: kernel test robot X-Patchwork-Id: 10072419 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5FA756056E for ; Thu, 23 Nov 2017 07:28:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 50EF929ED9 for ; Thu, 23 Nov 2017 07:28:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 45D9429EDF; Thu, 23 Nov 2017 07:28:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8AA1929ED9 for ; Thu, 23 Nov 2017 07:28:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752002AbdKWH2X (ORCPT ); Thu, 23 Nov 2017 02:28:23 -0500 Received: from mga09.intel.com ([134.134.136.24]:17078 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751914AbdKWH2W (ORCPT ); Thu, 23 Nov 2017 02:28:22 -0500 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Nov 2017 23:28:21 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.44,440,1505804400"; d="scan'208";a="1247558485" Received: from bee.sh.intel.com (HELO bee) ([10.239.97.14]) by fmsmga002.fm.intel.com with ESMTP; 22 Nov 2017 23:28:20 -0800 Received: from kbuild by bee with local (Exim 4.84_2) (envelope-from ) id 1eHm1X-0003Pp-MW; Thu, 23 Nov 2017 15:34:15 +0800 Date: Thu, 23 Nov 2017 15:27:23 +0800 From: kbuild test robot To: Felix Fietkau Cc: kbuild-all@01.org, linux-wireless@vger.kernel.org, kvalo@codeaurora.org Subject: [PATCH] mt76: fix debugfs_simple_attr.cocci warnings Message-ID: <20171123072723.GA16326@lkp-ne02> References: <20171120193549.80831-4-nbd@nbd.name> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20171120193549.80831-4-nbd@nbd.name> User-Agent: Mutt/1.5.23 (2014-03-12) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: fengguang.wu@intel.com X-SA-Exim-Scanned: No (on bee); SAEximRunCond expanded to false Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Signed-off-by: Fengguang Wu --- 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);