From patchwork Thu Jan 11 04:58:22 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: 10156941 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 690E0602B3 for ; Thu, 11 Jan 2018 04:58:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5B6C02865F for ; Thu, 11 Jan 2018 04:58:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4F959286A8; Thu, 11 Jan 2018 04:58:37 +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 E1B6F2865F for ; Thu, 11 Jan 2018 04:58:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753762AbeAKE6f (ORCPT ); Wed, 10 Jan 2018 23:58:35 -0500 Received: from mail-pf0-f196.google.com ([209.85.192.196]:40184 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753746AbeAKE6e (ORCPT ); Wed, 10 Jan 2018 23:58:34 -0500 Received: by mail-pf0-f196.google.com with SMTP id i66so585259pfd.7 for ; Wed, 10 Jan 2018 20:58:34 -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=ZzM7brfF6Z7iuFfd1OTV/BbrK/N+96rmE9OS8Tkt8TI=; b=N2eBk6wHJlqoQomCJh3pE5OaQ3E/zHzp7eYjmEJRkukG555oQLLag/dVw82Z/LXb8L ZIrDVTIMKDgLgy+cYcvuS3z1UY4oCb89OEE5CBguKRScloFRjcyBJMP6R75Uj1qtA3O6 D98U8t1p/1dnLSgBgAjP6/R1b5w8R4USvkTPXfrtfj53TJOWaP39py1Bp5l2yWn1qt4N 2NWzolQPSUeSsKunel1IeLolqPmQfAWGvIA/dzYdHVa2hozOHil2OnfrUyG3dJTCfFPL jYC7PuiAvK99tJ7Zerda2MIiB96vgsWLUb/1NSot7rMgw3A0jGfnH7y82sjG7VCKTmoe GcTg== 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=ZzM7brfF6Z7iuFfd1OTV/BbrK/N+96rmE9OS8Tkt8TI=; b=rEX3ZTVCN5s7cIqo4LERTrgcMf42WlbcO3GVYAoqLfNG4szxihltSMTAXnOnpRN4BY uz3mQFiQn0IBS+1/O7z2wmxki9cvGhNM6mCqUNSSfDMxx0ki3Gs6GOwzq9zoYIfihIML Tf3CNPhQm6om+Vlue9EfRNchVIbAn/ZttzbwcGCTGvhBIKddq2i7CGiuFHWwyKCg+cUy FfhsX56XNPl98XHQEY+B19+/Zsvp9oZFR28q7mXINLnxiqvd9JdoepFtekWt60v2MXld 5jCF2viVmJATapMIhIHIK6cvINd4TTxEE9OsHDF/oJ8Ha3zerTYckfxQA8hkRgwGRPAT n97Q== X-Gm-Message-State: AKGB3mJ30oPHuItD/vpENvdb3sLvmO1eoANDOHhoWJKCyf2xZbldkuSx TFwQ9ne6LSiJAZg6BNL3PoM= X-Google-Smtp-Source: ACJfBosT5FQhNutqwopaj076Fp+8LKLr+bgzb7tgJzeE3sASIcxJ2m+mE8MZK/+RoifeJNf66UwOiA== X-Received: by 10.98.185.16 with SMTP id z16mr19118827pfe.140.1515646714131; Wed, 10 Jan 2018 20:58:34 -0800 (PST) Received: from localhost.localdomain ([117.219.203.172]) by smtp.gmail.com with ESMTPSA id n6sm39100904pfg.188.2018.01.10.20.58.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 10 Jan 2018 20:58:33 -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 v2] imu:adis16400_core: fix debugfs_simple_attr.cocci warnings Date: Thu, 11 Jan 2018 10:28:22 +0530 Message-Id: <1515646702-2846-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 -- 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; }