From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5F4F1C282DA for ; Fri, 19 Apr 2019 19:05:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2CD4D20643 for ; Fri, 19 Apr 2019 19:05:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=zytor.com header.i=@zytor.com header.b="Ru4x/qWz" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727738AbfDSTDx (ORCPT ); Fri, 19 Apr 2019 15:03:53 -0400 Received: from terminus.zytor.com ([198.137.202.136]:42949 "EHLO mail.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729083AbfDSTDs (ORCPT ); Fri, 19 Apr 2019 15:03:48 -0400 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTPS id x3JHSrnQ363196 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Fri, 19 Apr 2019 10:28:53 -0700 DKIM-Filter: OpenDKIM Filter v2.11.0 terminus.zytor.com x3JHSrnQ363196 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zytor.com; s=2019041745; t=1555694935; bh=ctfbVfLvz/n7x0FJwS6+0WTxIFExYZ84TpbQW5OG+ig=; h=Date:From:Cc:Reply-To:In-Reply-To:References:To:Subject:From; b=Ru4x/qWzzDHaq1XUjiHfYiXvzV2UmrHc88WnrIuRuViuphYpQjk6vTaRLLxIiFH7I 9EOQLHxPDqy+SzR734m2yuWNQgBbXHVEBv53KsYeFV7QYnS9bqMUJHjmchTDJyidae wuWeGux5rRU5eOPz3R/bnrNtaSgFTAfuhZlWACHUpt3/dvbtwtRmLuuSvrgi7s70q/ 8AId6SX0fjYMlXpyVNekC4UqqfbopmEcy0D+wEwyqlBNRjP22H2a2gWCxz3xvUke2A 2Pz97zjfcZmXbDpvlN1mAOCStXmSCdda/darBNpswewWxq9/GPbp/v0WON115rv90z +r3QRlTXj/QpQ== Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id x3JHSqMP363193; Fri, 19 Apr 2019 10:28:52 -0700 Date: Fri, 19 Apr 2019 10:28:52 -0700 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for YueHaibing Message-ID: Cc: tony.luck@intel.com, mingo@kernel.org, torvalds@linux-foundation.org, tglx@linutronix.de, hpa@zytor.com, yazen.ghannam@amd.com, peterz@infradead.org, vishal.l.verma@intel.com, yuehaibing@huawei.com, bp@alien8.de, linux-kernel@vger.kernel.org Reply-To: linux-kernel@vger.kernel.org, bp@alien8.de, yuehaibing@huawei.com, vishal.l.verma@intel.com, peterz@infradead.org, yazen.ghannam@amd.com, hpa@zytor.com, torvalds@linux-foundation.org, tglx@linutronix.de, mingo@kernel.org, tony.luck@intel.com In-Reply-To: <1545981853-70877-1-git-send-email-yuehaibing@huawei.com> References: <1545981853-70877-1-git-send-email-yuehaibing@huawei.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:ras/core] x86/mce: Fix debugfs_simple_attr.cocci warnings Git-Commit-ID: 28156d7678431312b463361b23a218a1b5645ba5 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 28156d7678431312b463361b23a218a1b5645ba5 Gitweb: https://git.kernel.org/tip/28156d7678431312b463361b23a218a1b5645ba5 Author: YueHaibing AuthorDate: Fri, 28 Dec 2018 07:24:13 +0000 Committer: Ingo Molnar CommitDate: Fri, 19 Apr 2019 19:25:08 +0200 x86/mce: Fix debugfs_simple_attr.cocci warnings 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 Signed-off-by: YueHaibing Cc: Borislav Petkov Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Tony Luck Cc: Vishal Verma Cc: Yazen Ghannam Cc: kernel-janitors@vger.kernel.org Link: http://lkml.kernel.org/r/1545981853-70877-1-git-send-email-yuehaibing@huawei.com Signed-off-by: Ingo Molnar --- arch/x86/kernel/cpu/mce/core.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/x86/kernel/cpu/mce/core.c b/arch/x86/kernel/cpu/mce/core.c index 58925e7ccb27..3e081428117c 100644 --- a/arch/x86/kernel/cpu/mce/core.c +++ b/arch/x86/kernel/cpu/mce/core.c @@ -2429,8 +2429,8 @@ static int fake_panic_set(void *data, u64 val) return 0; } -DEFINE_SIMPLE_ATTRIBUTE(fake_panic_fops, fake_panic_get, - fake_panic_set, "%llu\n"); +DEFINE_DEBUGFS_ATTRIBUTE(fake_panic_fops, fake_panic_get, fake_panic_set, + "%llu\n"); static int __init mcheck_debugfs_init(void) { @@ -2439,8 +2439,8 @@ static int __init mcheck_debugfs_init(void) dmce = mce_get_debugfs_dir(); if (!dmce) return -ENOMEM; - ffake_panic = debugfs_create_file("fake_panic", 0444, dmce, NULL, - &fake_panic_fops); + ffake_panic = debugfs_create_file_unsafe("fake_panic", 0444, dmce, + NULL, &fake_panic_fops); if (!ffake_panic) return -ENOMEM;