From patchwork Sun Jan 7 08:29:33 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: 10148121 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 A6F4B601A1 for ; Sun, 7 Jan 2018 08:29:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 889D828560 for ; Sun, 7 Jan 2018 08:29:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7B66F28920; Sun, 7 Jan 2018 08:29:46 +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 223A628560 for ; Sun, 7 Jan 2018 08:29:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751673AbeAGI3l (ORCPT ); Sun, 7 Jan 2018 03:29:41 -0500 Received: from mail-pf0-f193.google.com ([209.85.192.193]:37447 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751541AbeAGI3k (ORCPT ); Sun, 7 Jan 2018 03:29:40 -0500 Received: by mail-pf0-f193.google.com with SMTP id n6so3996195pfa.4 for ; Sun, 07 Jan 2018 00:29:40 -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=U+6DiU26U9AYc9F3DAEqkgJbhTErz+i105mWEcLH3aw=; b=kupL0FKPC11f+Zh0RjROWmhOegg3tHr+S2W/DMj6AfgZrD9ZDoSw23NuKJEaT8GRct ML0mB5kXY0fBG2+scPVGZC6S6gUah63iN2g9ZhPTzYNscfqz+rEEmDm0XTcDO/BDkMhD 9LoadThEcisdfMRYk4gcm+J3uWqmfH2LDkBHZIAVe9sbqDbbqN1caoQkR4Mw8YnXV81k 9mNlKJ8PKdfjlMLS02pGSCbPjt0RCQLc0iR98KvMm9if3s1eF/f63H/CtgRwWZi3oH2f 2xSLexvsRVQW52zh+u5wHTil/XvuVuy/bvQhjFQfZJQMAKGm1dUlZzQ+eyj4MB+JkThF BNLw== 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=U+6DiU26U9AYc9F3DAEqkgJbhTErz+i105mWEcLH3aw=; b=g1ywFlsi9xvpOeYVzJBToPMMQv+LjFUD+4Ks5anOlygk159B3d5T1p5JufJfbXYoc6 CzfGekmtwOopNUpNz2ODjOcXOVpJmnPrIbk74bH8UhIXreRNpf6+LRb4bnEJLEa2mOnb vazuA0VQx5x5vhlej7xTd5RYX+jprv39JepNyJc/UbfhTDIwXL5eoRGbdZHnuwjk+89S hlgNrGl+QjpYn2fvCbSQudYfOSMKgf+5p6N1ZlJSSQVIgYTyeHAvkDSpaRzivNXNBOdX HNd/vZ1mQ5uXPowiGpe9Agzp5qYSPIgVtrv0C87DbG0VnkYwzFPLBBhThMlAjb59AP8z FA3g== X-Gm-Message-State: AKGB3mLl2n7qMv/OgyFjJ42UMyyFxt9ALdhNXwWzlCfF8iTShVZ3HWWH v7DFvn9p1D62MPRe/j+QPo0= X-Google-Smtp-Source: ACJfBov9CO6QqMW0Gi/tn894c1l3MxBXD4aa0vShRMelDoBEm5NUbNVMAwEgRFrVxzhRZmiKPJp7GQ== X-Received: by 10.98.202.8 with SMTP id n8mr7605971pfg.184.1515313780147; Sun, 07 Jan 2018 00:29:40 -0800 (PST) Received: from localhost.localdomain ([117.209.200.231]) by smtp.gmail.com with ESMTPSA id 69sm23032761pft.11.2018.01.07.00.29.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 07 Jan 2018 00:29:39 -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] drivers:iio:imu:adis16400_core fix debugfs_attr_simple Date: Sun, 7 Jan 2018 13:59:33 +0530 Message-Id: <1515313773-3265-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/imu/adis16400_core.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 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..644c86d 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,14 +110,14 @@ 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, +debugfs_create_file_unsafe("flash_count", 0400, indio_dev->debugfs_dentry, st, &adis16400_flash_count_fops); return 0;