Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1644549pxk; Fri, 18 Sep 2020 19:56:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz56NFC1G5neFnr+pUnEU2LyaIF74kKfq6+x9m+G90dX9WQJ2Cj4LgMcjUaykED7/8Wu1Ch X-Received: by 2002:a05:6402:78b:: with SMTP id d11mr43537524edy.341.1600484199005; Fri, 18 Sep 2020 19:56:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600484198; cv=none; d=google.com; s=arc-20160816; b=TXK6blt9tGblX+BmFaZ+0vfjmQXTfv2ANFtMOFaaOt018y+m+jDi+khZN+435oTv8T Xnq6i2qWzg9MAXPZc7PN5sQI6TRf7U9IK+VCLRnV0g5l1bu61drWj4PjMAatw22+FJ+j IMbnPnTHwq4QuXPjGhpmCk7FYjRKYOd+OP8mZopsw5EdT6mLuTHto02+mZAAIXuXTZ9N 2szFA0d2gHt/cuJUFWjkw59eLM/ogJwfKO0ybqoNK3SphKGDuX9qpV+2nt3uF2r5WvNB k1uc35kK7ByM2qyzR2QFMZRy5/5H1J+WyttmSvHqp/ZcOS6Fnah0ZUmd+awFFfz+0bWY xiXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=iNgFgjaHSjUt++kNuEUw4vnGXwfeO4ApERafxWunGPs=; b=g622XMHdmBzqby8f6ch+4XiyC5PfODODdKTeoobIsWqSdo8DKXiefnw9kkLiLFspVH FnoUrJsWngquQsr1olDkvxQLUYYVQ/e+ZapB6mecfDg+YzWWX7tz+y815Xxg3/kryjsK FP2S8oI3m3frIIliDeMzC7XJ93M7oJNq9iNGLvzRQhlDxGUGDM1+X5fym0H4RNh6fPks gwXTTP9RDUei0qc4SYBRv6sZxVxmuP2aoc4fhCAoR3ob37GHZV8l2m0utT5jEGNqQglJ Jq2ODDhK+NqjOJZjh+oxcwr+h/fPSD+2HXToGZt+TmyYXQ3jo+o/M9r1ktU5/u3Iimug bmuw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y3si3724565edr.538.2020.09.18.19.56.15; Fri, 18 Sep 2020 19:56:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726510AbgISCwR (ORCPT + 99 others); Fri, 18 Sep 2020 22:52:17 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:13321 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726388AbgISCv7 (ORCPT ); Fri, 18 Sep 2020 22:51:59 -0400 Received: from DGGEMS413-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id BCA858E493A633CE3F62; Sat, 19 Sep 2020 10:51:35 +0800 (CST) Received: from localhost.localdomain.localdomain (10.175.113.25) by DGGEMS413-HUB.china.huawei.com (10.3.19.213) with Microsoft SMTP Server id 14.3.487.0; Sat, 19 Sep 2020 10:51:25 +0800 From: Qinglang Miao To: David Kershner , CC: , Qinglang Miao Subject: [PATCH -next v2] drivers: visorbus: Convert to DEFINE_SHOW_ATTRIBUTE Date: Sat, 19 Sep 2020 10:51:57 +0800 Message-ID: <20200919025157.17200-1-miaoqinglang@huawei.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.113.25] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code. Signed-off-by: Qinglang Miao --- v2: based on linux-next(20200917), and can be applied to mainline cleanly now. drivers/visorbus/visorbus_main.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/drivers/visorbus/visorbus_main.c b/drivers/visorbus/visorbus_main.c index 152fd29f0..b5417f1e7 100644 --- a/drivers/visorbus/visorbus_main.c +++ b/drivers/visorbus/visorbus_main.c @@ -471,18 +471,7 @@ static int bus_info_debugfs_show(struct seq_file *seq, void *v) return 0; } -static int bus_info_debugfs_open(struct inode *inode, struct file *file) -{ - return single_open(file, bus_info_debugfs_show, inode->i_private); -} - -static const struct file_operations bus_info_debugfs_fops = { - .owner = THIS_MODULE, - .open = bus_info_debugfs_open, - .read = seq_read, - .llseek = seq_lseek, - .release = single_release, -}; +DEFINE_SHOW_ATTRIBUTE(bus_info_debugfs); static void dev_periodic_work(struct timer_list *t) { -- 2.23.0