Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp4035239imu; Mon, 10 Dec 2018 11:59:15 -0800 (PST) X-Google-Smtp-Source: AFSGD/Uq7OGbmJmqnsieu3IxpXy8l71vjQTq70msRXUqSecTv8nI5JmouOHsG/DJpiEpUAmK947J X-Received: by 2002:a17:902:654a:: with SMTP id d10mr13070100pln.324.1544471955036; Mon, 10 Dec 2018 11:59:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544471954; cv=none; d=google.com; s=arc-20160816; b=l7yN5y2P6RlByyashq49UiK8C1nXHfqAl3SxDzMRuzQkh+I3lPYL9v6q8KG/5m6Eot DJXZIKrviK7Grbn/lJvPgAfDoF7Qhkh9aATWcuMRGOThF9Oi77zM3hV4uwwodK/mzyqv sNjz8JnQNKCKygp3QTg3SoekTx8ebee9+riMmJ9mIhvvLPlor+SNC0Q2wvwsL7NicdmU dh8wAnawmVvOvA67gdoGiaCpLzMOQBbK44VnmM6GPSYguGH/3g7ebOdDk4J2/SnB8Dmn mVD5iPyDo8uvK6wlo+aowmU/pfXMCpO8JeKBlcMDGfCig219++TtgPy00+PlHzvHHV7I WR5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date:dkim-signature; bh=lTY3D4r5yGkpD3rZ57IKw7/+ANtgLoTbxcVlf5RMU84=; b=zoartOWeh/s+i6MvMS3Nl8Qmu5SL1NUjSzB4FSP7YE5a0KX3Irpjg5+tbG9D/8bdaN wvv7G1CqdsmnXJcUN55AkJKw45YpEI0CLRHdnDB6Vx7WSpsxcaPu2h8ewWiLGibtkfNg RfboD8/Y4KVDMM6Em7ZfYABM4smcpZriTmgoH5Du/4suj0ldWpIBauLGk9rzcfWwQjpr pNNBjP0kdSVtIWoEMa64oATJxINSd9mzWOaPTNaJ6MYfOAGcmAb+3gLR5fi/NhG4Fqsa 3IdLydG+C07+EQn6B1LGNeAiC/IW3FfdHIU8NC7XFnXAfXBwIZAcAUTmviudkemh3NbZ x70Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@netronome-com.20150623.gappssmtp.com header.s=20150623 header.b=FCNk+qrI; 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 v32si11292057plb.369.2018.12.10.11.58.59; Mon, 10 Dec 2018 11:59:14 -0800 (PST) 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=@netronome-com.20150623.gappssmtp.com header.s=20150623 header.b=FCNk+qrI; 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 S1728656AbeLJSWD (ORCPT + 99 others); Mon, 10 Dec 2018 13:22:03 -0500 Received: from mail-pg1-f193.google.com ([209.85.215.193]:44455 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727781AbeLJSWC (ORCPT ); Mon, 10 Dec 2018 13:22:02 -0500 Received: by mail-pg1-f193.google.com with SMTP id t13so5328783pgr.11 for ; Mon, 10 Dec 2018 10:22:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netronome-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :organization:mime-version:content-transfer-encoding; bh=lTY3D4r5yGkpD3rZ57IKw7/+ANtgLoTbxcVlf5RMU84=; b=FCNk+qrIqQAwS6xX3xacqkE6qfO6S45Jqg8d8x23q2HoPVYQvK8/7tB62pQw46EDWA BpGTcjUYpcRaSbSZowy8DFoJzWhsA6kyNzGY5dqQtFCPczib/ft6oz7cwxLKl1aVsNru 6mOU5m9h669OYo0edttPmoz6Sb6bwlOg/o7ifXU+n1bVeLISJaIqZd99Hnnngy18GZH4 MZWJLirtG3HWUE3CU+2VehGhGyK3smEcFLLR1/I/yk8ORrjlVGSqFGDWSWZTdWqB+KSX Ib6Fh08Az475VBLTu57202hKy3tkciSyJmeXa5UMH41LRU0hROWKJcYXE9JlYbaOpZhb bNCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:organization:mime-version:content-transfer-encoding; bh=lTY3D4r5yGkpD3rZ57IKw7/+ANtgLoTbxcVlf5RMU84=; b=tvpG8InjWS5oYjEG4eonR2HrP6Azlq3WaVvPFKAGuVgwLO8KvpBIZbCpxWPIO0bJ7P nxmlZpI/IPwKUrqHwRrwOIT+7sX9RmeKXgsVdYg1u2lbx1m+KruxXp8L8eYU2LFRgny6 gGRRrEqsS/W3KDi7s5ie4UmXJJnHs8RAdFrwyvYsjTKaNmDlgNIJ6l42eAsZ2AHkvNkT lmDs8pUWovvkdKtQJVMeDy19/qQ9+jC6NmrfASDlGGmmQgfzSxmh4g6aq2E7HxmruJ/q 2vvFHfrEvksbRLC7weMHndHXEWPK5hPbfYGZ/TZyUtaMc8C4P03tqOmi5uJySS6xVCgJ 1JBA== X-Gm-Message-State: AA+aEWYZ2ptFUyCN8L6KBG0aUgTsEgBbTrLKsrEesW7vpseuABZ9aftQ 3xJeuWI5qjjYhdCsG/S5Z/lJIQ== X-Received: by 2002:a63:7219:: with SMTP id n25mr11835982pgc.324.1544466121232; Mon, 10 Dec 2018 10:22:01 -0800 (PST) Received: from cakuba.netronome.com (c-73-162-4-14.hsd1.ca.comcast.net. [73.162.4.14]) by smtp.gmail.com with ESMTPSA id 85sm17315851pfw.17.2018.12.10.10.22.00 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 10 Dec 2018 10:22:01 -0800 (PST) Date: Mon, 10 Dec 2018 10:21:57 -0800 From: Jakub Kicinski To: Yangtao Li Cc: davem@davemloft.net, linux-kernel@vger.kernel.org Subject: Re: [PATCH] bpf: convert to DEFINE_SHOW_ATTRIBUTE Message-ID: <20181210102157.6fa8fd8b@cakuba.netronome.com> In-Reply-To: <20181210160327.20811-1-tiny.windzz@gmail.com> References: <20181210160327.20811-1-tiny.windzz@gmail.com> Organization: Netronome Systems, Ltd. MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 10 Dec 2018 11:03:27 -0500, Yangtao Li wrote: > Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code. > > Signed-off-by: Yangtao Li Acked-by: Jakub Kicinski Please post v2 with the subject prefix set to "netdevsim:" rather than "bpf:". > drivers/net/netdevsim/bpf.c | 16 ++-------------- > 1 file changed, 2 insertions(+), 14 deletions(-) > > diff --git a/drivers/net/netdevsim/bpf.c b/drivers/net/netdevsim/bpf.c > index cb3518474f0e..14b4d9774708 100644 > --- a/drivers/net/netdevsim/bpf.c > +++ b/drivers/net/netdevsim/bpf.c > @@ -48,7 +48,7 @@ struct nsim_bpf_bound_map { > struct list_head l; > }; > > -static int nsim_debugfs_bpf_string_read(struct seq_file *file, void *data) > +static int nsim_bpf_string_show(struct seq_file *file, void *data) > { > const char **str = file->private; > > @@ -57,19 +57,7 @@ static int nsim_debugfs_bpf_string_read(struct seq_file *file, void *data) > > return 0; > } > - > -static int nsim_debugfs_bpf_string_open(struct inode *inode, struct file *f) > -{ > - return single_open(f, nsim_debugfs_bpf_string_read, inode->i_private); > -} > - > -static const struct file_operations nsim_bpf_string_fops = { > - .owner = THIS_MODULE, > - .open = nsim_debugfs_bpf_string_open, > - .release = single_release, > - .read = seq_read, > - .llseek = seq_lseek > -}; > +DEFINE_SHOW_ATTRIBUTE(nsim_bpf_string); > > static int > nsim_bpf_verify_insn(struct bpf_verifier_env *env, int insn_idx, int prev_insn)