From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Google-Smtp-Source: AB8JxZr5RsThn7R29WPJqY17TqqaRPUcYT8Tblc7qDv6p5EEhkPVAHqDYILcS00plWfOJRM/MYkn ARC-Seal: i=1; a=rsa-sha256; t=1524899758; cv=none; d=google.com; s=arc-20160816; b=ox9v9OFHyeX/Er6Rj33VKruY/evdSC94WFV/t9IeJGv5KfWliY6/ngNfhLDDczVLiW whEyMmw2ZUruSgV9URt69oYIhV17yT/UQyoy9r0+DrpUhPh5FNZ/T42Zstq6ADYacuSG Ao8QXv3xMyquYTF+hxQj1ZKT46T4QHqGXs29tNeOry6eQjy2xPgq35MLDVTXzgSw/a6t NCS3eLHpQAam8gBAE3vqhE8qTgCIhhQwDJ8gduQQP5b4EbdsU8PG+k7+WJz5HFo+Pwuy E/8RKw6Uurxkn8uYNUHn8TyQCJeMaw7MOuj697/EG20irpBL6hKK5LluktK7cqsM4DvP +sIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:user-agent:message-id:subject:cc:to:from:date :arc-authentication-results; bh=TiPC3/qCxp5qvpo1IdrWQEfHi8hjDIWpreEI3CSsbIM=; b=GoyTBQSS0GsHk1eE2hJve0yS3U2hLBCe8TIakNKlf6x6KbuboAn1r69zuPIEYb1bc7 WEgRuhV2nhVOOtpW18iJhxlqzVITLMfbiBm69Im4RrNGZ5tWG7mBpCathLdJLCvIB/MW 8DKf9yL9kZa4PvDIrtlCD5vGTzl10aQisyFFSXl0QlXabRWLGEjsOqh7iPOqJX+iLFOR AKHJMoKzFMjcIvXFneBAP/em0wx8ay1OpcbRzCtBggexeinLgDbu8e2+dBBqITGF0Ivq 1/PmZd6rJBzjE5SRvWDm1wMpLKWaispfE+pK+bs8en9xdUqcXlKprLjymZWKtKZnw+Vr hhpg== ARC-Authentication-Results: i=1; mx.google.com; spf=neutral (google.com: 192.134.164.83 is neither permitted nor denied by domain of julia.lawall@lip6.fr) smtp.mailfrom=julia.lawall@lip6.fr Authentication-Results: mx.google.com; spf=neutral (google.com: 192.134.164.83 is neither permitted nor denied by domain of julia.lawall@lip6.fr) smtp.mailfrom=julia.lawall@lip6.fr X-IronPort-AV: E=Sophos;i="5.49,338,1520895600"; d="scan'208";a="324880146" Date: Sat, 28 Apr 2018 09:15:57 +0200 (CEST) From: Julia Lawall X-X-Sender: jll@hadrien To: Sujeev Dias cc: Greg Kroah-Hartman , Arnd Bergmann , linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Tony Truong , kbuild-all@01.org Subject: [PATCH] mhi_bus: controller: fix debugfs_simple_attr.cocci warnings Message-ID: User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: =?utf-8?q?1598973289034377334?= X-GMAIL-MSGID: =?utf-8?q?1598973289034377334?= X-Mailing-List: linux-kernel@vger.kernel.org List-ID: From: Fengguang Wu Use DEFINE_DEBUGFS_ATTRIBUTE rather than DEFINE_SIMPLE_ATTRIBUTE for debugfs files. 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: 6190c08efd64 ("mhi_bus: controller: MHI support for QCOM modems") CC: Sujeev Dias Signed-off-by: Fengguang Wu Signed-off-by: Julia Lawall --- url: https://github.com/0day-ci/linux/commits/Sujeev-Dias/mhi_bus-core-Add-support-for-MHI-host-interface/20180428-065959 :::::: branch date: 4 hours ago :::::: commit date: 4 hours ago mhi_qcom.c | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) --- a/drivers/bus/mhi/controllers/mhi_qcom.c +++ b/drivers/bus/mhi/controllers/mhi_qcom.c @@ -335,11 +335,11 @@ int mhi_debugfs_trigger_m3(void *data, u return 0; } -DEFINE_SIMPLE_ATTRIBUTE(debugfs_trigger_m0_fops, NULL, - mhi_debugfs_trigger_m0, "%llu\n"); +DEFINE_DEBUGFS_ATTRIBUTE(debugfs_trigger_m0_fops, NULL, + mhi_debugfs_trigger_m0, "%llu\n"); -DEFINE_SIMPLE_ATTRIBUTE(debugfs_trigger_m3_fops, NULL, - mhi_debugfs_trigger_m3, "%llu\n"); +DEFINE_DEBUGFS_ATTRIBUTE(debugfs_trigger_m3_fops, NULL, + mhi_debugfs_trigger_m3, "%llu\n"); static int mhi_init_debugfs_trigger_go(void *data, u64 val) { @@ -351,8 +351,8 @@ static int mhi_init_debugfs_trigger_go(v return 0; } -DEFINE_SIMPLE_ATTRIBUTE(mhi_init_debugfs_trigger_go_fops, NULL, - mhi_init_debugfs_trigger_go, "%llu\n"); +DEFINE_DEBUGFS_ATTRIBUTE(mhi_init_debugfs_trigger_go_fops, NULL, + mhi_init_debugfs_trigger_go, "%llu\n"); int mhi_init_debugfs_debug_show(struct seq_file *m, void *d) @@ -434,8 +434,8 @@ static ssize_t mhi_init_debugfs_debug_wr } mhi_dev->debug_mode = true; - debugfs_create_file("go", 0444, mhi_cntrl->parent, mhi_cntrl, - &mhi_init_debugfs_trigger_go_fops); + debugfs_create_file_unsafe("go", 0444, mhi_cntrl->parent, mhi_cntrl, + &mhi_init_debugfs_trigger_go_fops); pr_info( "%s: ret:%d pcidev:0x%x smm_cfg:%u timeout:%u\n", __func__, ret, args[1], mhi_dev->smmu_cfg, @@ -504,10 +504,12 @@ int mhi_pci_probe(struct pci_dev *pci_de pm_runtime_allow(&pci_dev->dev); if (mhi_cntrl->dentry) { - debugfs_create_file("m0", 0444, mhi_cntrl->dentry, mhi_cntrl, - &debugfs_trigger_m0_fops); - debugfs_create_file("m3", 0444, mhi_cntrl->dentry, mhi_cntrl, - &debugfs_trigger_m3_fops); + debugfs_create_file_unsafe("m0", 0444, mhi_cntrl->dentry, + mhi_cntrl, + &debugfs_trigger_m0_fops); + debugfs_create_file_unsafe("m3", 0444, mhi_cntrl->dentry, + mhi_cntrl, + &debugfs_trigger_m3_fops); } MHI_LOG("Return successful\n");