From patchwork Sun Jan 7 09:01:57 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: 10148141 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 7E041601A1 for ; Sun, 7 Jan 2018 09:02:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 602DE28893 for ; Sun, 7 Jan 2018 09:02:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 51B33288A9; Sun, 7 Jan 2018 09:02:13 +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 9645C28893 for ; Sun, 7 Jan 2018 09:02:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752106AbeAGJCG (ORCPT ); Sun, 7 Jan 2018 04:02:06 -0500 Received: from mail-pl0-f66.google.com ([209.85.160.66]:39003 "EHLO mail-pl0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752069AbeAGJCF (ORCPT ); Sun, 7 Jan 2018 04:02:05 -0500 Received: by mail-pl0-f66.google.com with SMTP id bi12so5816528plb.6 for ; Sun, 07 Jan 2018 01:02:04 -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=e6TOKrmAMfgABwPCW29rAb4tP8HaIb0QCX7tjLEV+JE=; b=Bb/RCQNH7tClThZAibm223Qi52rGw6rdsKvHza2F/GxM4y8t0JTwL4Ts88eXTmVIQj tg5AB2Hfa9WLhZ1OdkJHn+n9x8wUWUXJdEpFG0+aRWereIIXlOK3kKb/aUg6rAHY5l0t W58XW5x6lt4FGEfK1Q3SBqlCzIDL7n/rBTomH6R3RwUGDq1QgbWNuK9oMRSBjGzQ+etK xqYe7CNbjyr/sRwe70NdKrzTB7M1ZnRDE/Zm5A0MDOppv6QRKAYHwC9gtUeIdPpmUyqe hhNYweKd6FIstYb8PDqiLW/lnMfPwYwjg6NnZT9w2D9HnTqe/FUL7RuRfk38wWIcvON/ 42sg== 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=e6TOKrmAMfgABwPCW29rAb4tP8HaIb0QCX7tjLEV+JE=; b=fBebGQBviZVB2lSvsiKW92KaUADVwDqS8PmArEVY5H5DrcPEqNZUxH/nOAF06M8hUZ JcRV/qre6/gGchD1/zH8vxhZPV66mFKC0HHT3QpgnHOls6oAiNsyUHd8I5A1fxoabVU3 2zpEOC6by6k2HgevRLRO5mAmfpwG6+r3Sldb/BYoD/xbAcFtsfRF4kHZU4KRr0/iLMNE QE5HcJFD8Tomy9G1Gr2s4YAihNShH/jthvcwb7Oh98lAuKwiaSDXsBXNCiKETmezVmCb zaYa9huX5DOnNpgGDPz4o7u3LPQBlSdE/etD4AgPX3yOxB+5EDA8UTS+t6QxEpwWPdke Ac4Q== X-Gm-Message-State: AKGB3mI3Rrgz9O7kCoNebzNWIsg8fw1z4Q3CQgW73mZ3oKj9xwfXsXUU 9fMkdKxWtPqRKaR3+7u8sfg= X-Google-Smtp-Source: ACJfBov+5iKn9MTXvzqwWgWBtUPFWOrh+m8Ne1zXU4sUx5GTdwIH1m4h5QBiui+AkWw96lMd8bVsdQ== X-Received: by 10.159.195.3 with SMTP id bd3mr8712733plb.426.1515315724442; Sun, 07 Jan 2018 01:02:04 -0800 (PST) Received: from localhost.localdomain ([117.209.200.231]) by smtp.gmail.com with ESMTPSA id r13sm17307688pgq.25.2018.01.07.01.02.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 07 Jan 2018 01:02:03 -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] gyro:adis16136: fix debugfs_simple_attr.cocci warnings Date: Sun, 7 Jan 2018 14:31:57 +0530 Message-Id: <1515315717-3950-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 --- drivers/iio/gyro/adis16136.c | 15 +++++++++------ 1 file changed, 9 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/gyro/adis16136.c b/drivers/iio/gyro/adis16136.c index 90ec4be..fcd4d61 100644 --- a/drivers/iio/gyro/adis16136.c +++ b/drivers/iio/gyro/adis16136.c @@ -124,7 +124,7 @@ static int adis16136_show_product_id(void *arg, u64 *val) return 0; } -DEFINE_SIMPLE_ATTRIBUTE(adis16136_product_id_fops, +DEFINE_DEBUGFS_ATTRIBUTE(adis16136_product_id_fops, adis16136_show_product_id, NULL, "%llu\n"); static int adis16136_show_flash_count(void *arg, u64 *val) @@ -142,18 +142,21 @@ static int adis16136_show_flash_count(void *arg, u64 *val) return 0; } -DEFINE_SIMPLE_ATTRIBUTE(adis16136_flash_count_fops, +DEFINE_DEBUGFS_ATTRIBUTE(adis16136_flash_count_fops, adis16136_show_flash_count, NULL, "%lld\n"); static int adis16136_debugfs_init(struct iio_dev *indio_dev) { struct adis16136 *adis16136 = iio_priv(indio_dev); - debugfs_create_file("serial_number", 0400, indio_dev->debugfs_dentry, - adis16136, &adis16136_serial_fops); - debugfs_create_file("product_id", 0400, indio_dev->debugfs_dentry, + debugfs_create_file_unsafe("serial_number", 0400, + indio_dev->debugfs_dentry, adis16136, + &adis16136_serial_fops); + debugfs_create_file_unsafe("product_id", 0400, + indio_dev->debugfs_dentry, adis16136, &adis16136_product_id_fops); - debugfs_create_file("flash_count", 0400, indio_dev->debugfs_dentry, + debugfs_create_file_unsafe("flash_count", 0400, + indio_dev->debugfs_dentry, adis16136, &adis16136_flash_count_fops); return 0;