From patchwork Mon Jan 8 05:41:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: venkat.prashanth2498@gmail.com X-Patchwork-Id: 10149063 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 4A186601BE for ; Mon, 8 Jan 2018 05:41:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3D0B4287AC for ; Mon, 8 Jan 2018 05:41:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3174F287C0; Mon, 8 Jan 2018 05:41: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.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID 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 AA312287AC for ; Mon, 8 Jan 2018 05:41:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755488AbeAHFlZ (ORCPT ); Mon, 8 Jan 2018 00:41:25 -0500 Received: from mail-pg0-f68.google.com ([74.125.83.68]:35971 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755458AbeAHFlY (ORCPT ); Mon, 8 Jan 2018 00:41:24 -0500 Received: by mail-pg0-f68.google.com with SMTP id j2so3675543pgv.3 for ; Sun, 07 Jan 2018 21:41:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=ogUXuVJDnKRWJTyZWZXX/teGBH8IZ8Orc/3NeSMexl0=; b=PoNNevl1SqSC9TRoTgreyMS47FqLgDzK3jxSZjEHzLu00YHz6b5EKf4jdQEUsi7evl xwykjSwPk/7pNSNtqgyzU8UyuL9bQv8fydNOIEHuQAkHavvueJQb4IT52srvWem9taxg iEENIbrIMVCRMro0d4tzYeMnWp2QwHKRlWrMicuPd4WNUSj5fVb6pqx6fMG/qPw43I9G pCv/QQOWeV/5ihRNEi1VfXYzOxkMqV0wnfQ0cyvrkja4WtqJLKakwnJnwz0VX9MGChTb iGb3fpiEcS3piLsA1SUlmTeraezaNyUYZRvpckDPpbHZFA01KoV4+DM7Qtt+A1KNcZpJ vcyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=ogUXuVJDnKRWJTyZWZXX/teGBH8IZ8Orc/3NeSMexl0=; b=euSyDLEJz/LdB6KwgUx/C9L2T2bRhwgq3E2qriav9+5fXHcL8L9BWV7TowTeke89g0 DxSvo2vKX0+bjzXcNMWv3LwOM7ovOEhFa6buRQI4A4c+KURQovKTtljJK7BwBIZH0JYa COtcEshZXHBDjya2d6JjpzR3bdYsDcNnAb4fUqozXW9TWgQ/lpzrvyRvpozawGlO6f3G g3bQKrvX88H0MebPGmCi/VkQyhJyXSWHYAPgx1PNVJDfYh9Wgy0mNvhhmxKI4XU5rMuU nsCHpjsnMngIrW6SDqhOoFaMNt7Hgj+BDXFNhh2EAfo+EICH2D/RwwXdEWvJAJVJu7XC FrDA== X-Gm-Message-State: AKGB3mIDHYPCdpunZA0Qf6qJtylVcN+r1blmOQAYcBF+NW56FSQZ9gY+ FFVTajoJYgr1st+R0a+3iu0= X-Google-Smtp-Source: ACJfBovbs1hYjRbxGJ84e6XE27Qm21pmE/0Ww2HgMDDkwsCkp0JXmv3Oh2bE2PW16yt3LiQBOffbeQ== X-Received: by 10.98.16.85 with SMTP id y82mr9881746pfi.150.1515390084167; Sun, 07 Jan 2018 21:41:24 -0800 (PST) Received: from localhost.localdomain ([117.251.225.224]) by smtp.gmail.com with ESMTPSA id q72sm27751688pfi.42.2018.01.07.21.41.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 07 Jan 2018 21:41:23 -0800 (PST) From: venkat.prashanth2498@gmail.com To: lars@metafoo.de, Michael.Hennerich@analog.com, jic23@kernel.org Cc: knaack.h@gmx.de, pmeerw@pmeerw.net, linux-iio@vger.kernel.org, Venkat Prashanth B U Subject: [PATCH] imu:adis16400_core: fix debugfs_simple_attr.cocci warnings Date: Mon, 8 Jan 2018 11:11:17 +0530 Message-Id: <1515390077-3278-1-git-send-email-venkat.prashanth2498@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Venkat Prashanth B U 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: Venkat Prashanth B U --- Change Log v1:- - Fixed indentation issue. - changed the subject line appropriately. --- drivers/iio/imu/adis16400_core.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) -- 1.9.1 :wq -- To unsubscribe from this list: send the line "unsubscribe linux-iio" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/iio/imu/adis16400_core.c b/drivers/iio/imu/adis16400_core.c index 46a5690..b199c73 100644 --- a/drivers/iio/imu/adis16400_core.c +++ b/drivers/iio/imu/adis16400_core.c @@ -85,7 +85,7 @@ static int adis16400_show_product_id(void *arg, u64 *val) return 0; } -DEFINE_SIMPLE_ATTRIBUTE(adis16400_product_id_fops, +DEFINE_DEBUGFS_ATTRIBUTE(adis16400_product_id_fops, adis16400_show_product_id, NULL, "%lld\n"); static int adis16400_show_flash_count(void *arg, u64 *val) @@ -102,7 +102,7 @@ static int adis16400_show_flash_count(void *arg, u64 *val) return 0; } -DEFINE_SIMPLE_ATTRIBUTE(adis16400_flash_count_fops, +DEFINE_DEBUGFS_ATTRIBUTE(adis16400_flash_count_fops, adis16400_show_flash_count, NULL, "%lld\n"); static int adis16400_debugfs_init(struct iio_dev *indio_dev) @@ -110,15 +110,16 @@ static int adis16400_debugfs_init(struct iio_dev *indio_dev) struct adis16400_state *st = iio_priv(indio_dev); if (st->variant->flags & ADIS16400_HAS_SERIAL_NUMBER) - debugfs_create_file("serial_number", 0400, + debugfs_create_file_unsafe("serial_number", 0400, indio_dev->debugfs_dentry, st, &adis16400_serial_number_fops); if (st->variant->flags & ADIS16400_HAS_PROD_ID) - debugfs_create_file("product_id", 0400, + debugfs_create_file_unsafe("product_id", 0400, indio_dev->debugfs_dentry, st, &adis16400_product_id_fops); - debugfs_create_file("flash_count", 0400, indio_dev->debugfs_dentry, - st, &adis16400_flash_count_fops); + debugfs_create_file_unsafe("flash_count", 0400, + indio_dev->debugfs_dentry, st, + &adis16400_flash_count_fops); return 0; }