Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3233005yba; Tue, 16 Apr 2019 07:21:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqxOjv164fUyF2Iy+0vCxBPJA79J32ortHBjG8hBKtxx2OhnVQXeERP0le9ugjDF1ATAdaKV X-Received: by 2002:a17:902:ec0b:: with SMTP id cy11mr82852096plb.21.1555424470007; Tue, 16 Apr 2019 07:21:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555424470; cv=none; d=google.com; s=arc-20160816; b=zYWO5gyFVXjQ8H3GLabQANqLquAkLXl/cSB+D85gGQt83PYVqYJXXZhILWweiCI9PG nl8rCbHtdoH44Lhmo6VsLmyPeTxEUfUNWsR/9RaurMoOrvco0JuBL4Z8g0Lip7J1UxHy 1pTAeXsy2UKtDduFx4LFdpPgGzyzKd0iQRiXAILg/9fNSJ3fmLkiML02p0Z+W1xAmnAg z/UumUEpUURdG7Sk3R0AsvuZZOFOpLF2+NBnkQVuiY/bK2O7PKzSvLAfi/01EbjHmsGa /WjGyNe4pPxUIRZTZ668hi9qWnuC8AiQkUHU1FKSfDR99fLLpQaAvcg4YI7b5TW7fuIx NNJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=AhHqvuu2FCW0rdcWNCv60+6ET+4pf64GFEWug4w5/wc=; b=osMyED+OnkTH8n8A8jM++WIYi7zs+hyf/kikzP3+Zjz4CXw77As26U7KHpqNCKY/eo 80e7ARrgQlg294zV4uHRpuEg9tFjzq2SDk1KfFbD8j/fCz+G1ZuVNbRexznumtx0XaeN 95OADKzjQzh9upBpXQKrweIenyrYKnjqiR/seq7fOVhWw2y21VG6koS7w5ZG91ZJy1RX 4C0qiMdiYMGrbvifXMsjZCfp1WZwDuMWV3B4jnNEOPM/WOqXMAFHrfTqdj9QdO0aFFEc esm5CsMw21glAzIAQ7gWS6ZX59Njtqf9TiVqmA+a65q4LnQRgXQW6U1/GG+HNTrOjIbh EeDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=YrNaqqPz; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 30si35881847plb.235.2019.04.16.07.20.53; Tue, 16 Apr 2019 07:21:09 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=YrNaqqPz; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729588AbfDPOUK (ORCPT + 99 others); Tue, 16 Apr 2019 10:20:10 -0400 Received: from mail.kernel.org ([198.145.29.99]:58944 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729373AbfDPOUI (ORCPT ); Tue, 16 Apr 2019 10:20:08 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E49BC223FE; Tue, 16 Apr 2019 14:20:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1555424407; bh=IY2W6JNagtS5qvKfZZCDS1NDtJL+OzlFe6fejKbJ03Q=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=YrNaqqPzy7NPDaY+M1aiyUj7p8JqsELVY7jLnf8HT2eLC7xvNY/0+KmFvpPodF3U1 LJwBpgIbps45h5WsPAFPg/OEvUhucO0S7QNGziCARd6LDutTWd27ZSssO5k1tP2R8C Ma8bD8dHgWZEDuZufBmu36PynsIovhdpDSYS1CPs= Date: Tue, 16 Apr 2019 15:46:55 +0200 From: Greg Kroah-Hartman To: "Life is hard, and then you die" Cc: Jonathan Corbet , "Rafael J. Wysocki" , Andy Shevchenko , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] debugfs: make debugfs_create_u32_array() return void Message-ID: <20190416134655.GA21555@kroah.com> References: <20190415082506.25610-1-ronald@innovation.ch> <20190415082506.25610-3-ronald@innovation.ch> <20190415084844.GA26101@kroah.com> <20190415232959.GC13033@innovation.ch> <20190416132925.GA17483@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190416132925.GA17483@kroah.com> User-Agent: Mutt/1.11.4 (2019-03-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The single user of debugfs_create_u32_array() does not care about the return value of it, so make it return void as there is no need to do anything with the return value. Signed-off-by: Greg Kroah-Hartman --- Documentation/filesystems/debugfs.txt | 2 +- fs/debugfs/file.c | 13 ++++--------- include/linux/debugfs.h | 12 +++++------- 3 files changed, 10 insertions(+), 17 deletions(-) diff --git a/Documentation/filesystems/debugfs.txt b/Documentation/filesystems/debugfs.txt index 4f45f71149cb..6320e86d2294 100644 --- a/Documentation/filesystems/debugfs.txt +++ b/Documentation/filesystems/debugfs.txt @@ -168,7 +168,7 @@ byte offsets over a base for the register block. If you want to dump an u32 array in debugfs, you can create file with: - struct dentry *debugfs_create_u32_array(const char *name, umode_t mode, + void debugfs_create_u32_array(const char *name, umode_t mode, struct dentry *parent, u32 *array, u32 elements); diff --git a/fs/debugfs/file.c b/fs/debugfs/file.c index 4fce1da7db23..2c17039c6287 100644 --- a/fs/debugfs/file.c +++ b/fs/debugfs/file.c @@ -1004,24 +1004,19 @@ static const struct file_operations u32_array_fops = { * @array as data. If the @mode variable is so set it can be read from. * Writing is not supported. Seek within the file is also not supported. * Once array is created its size can not be changed. - * - * The function returns a pointer to dentry on success. If debugfs is not - * enabled in the kernel, the value -%ENODEV will be returned. */ -struct dentry *debugfs_create_u32_array(const char *name, umode_t mode, - struct dentry *parent, - u32 *array, u32 elements) +void debugfs_create_u32_array(const char *name, umode_t mode, + struct dentry *parent, u32 *array, u32 elements) { struct array_data *data = kmalloc(sizeof(*data), GFP_KERNEL); if (data == NULL) - return NULL; + return; data->array = array; data->elements = elements; - return debugfs_create_file_unsafe(name, mode, parent, data, - &u32_array_fops); + debugfs_create_file_unsafe(name, mode, parent, data, &u32_array_fops); } EXPORT_SYMBOL_GPL(debugfs_create_u32_array); diff --git a/include/linux/debugfs.h b/include/linux/debugfs.h index 3b0ba54cc4d5..58424eb3b329 100644 --- a/include/linux/debugfs.h +++ b/include/linux/debugfs.h @@ -133,9 +133,8 @@ struct dentry *debugfs_create_regset32(const char *name, umode_t mode, void debugfs_print_regs32(struct seq_file *s, const struct debugfs_reg32 *regs, int nregs, void __iomem *base, char *prefix); -struct dentry *debugfs_create_u32_array(const char *name, umode_t mode, - struct dentry *parent, - u32 *array, u32 elements); +void debugfs_create_u32_array(const char *name, umode_t mode, + struct dentry *parent, u32 *array, u32 elements); struct dentry *debugfs_create_devm_seqfile(struct device *dev, const char *name, struct dentry *parent, @@ -353,11 +352,10 @@ static inline bool debugfs_initialized(void) return false; } -static inline struct dentry *debugfs_create_u32_array(const char *name, umode_t mode, - struct dentry *parent, - u32 *array, u32 elements) +static inline void debugfs_create_u32_array(const char *name, umode_t mode, + struct dentry *parent, u32 *array, + u32 elements) { - return ERR_PTR(-ENODEV); } static inline struct dentry *debugfs_create_devm_seqfile(struct device *dev, -- 2.21.0