Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2052681imu; Wed, 12 Dec 2018 08:44:00 -0800 (PST) X-Google-Smtp-Source: AFSGD/WjHa9LrbHfNzA0BGSSVkmkakkx7Rd73J4Zy0S/c9sT9X34b6DiASl21l6Foe0ZbBIii9Bf X-Received: by 2002:a63:1321:: with SMTP id i33mr391801pgl.380.1544633040113; Wed, 12 Dec 2018 08:44:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544633040; cv=none; d=google.com; s=arc-20160816; b=tZta7x3xT/BHDi4RFDCaudOmj1PCzKW7i7VNd4x+wo73IJ2THMriuP3JJEhttQmPOp zdSLtrPYt17nI4FYdxHGoOD7qtIVV2BWDXJ2KTrRLqlfJtd+Lfr9eDB8dcvQBIkHdc1l CUF+/miBjSOYEKOGZlzSQFQEekJ4qNKveg7Jy+V0YRfuOYA9yma1k56UF3QIkZTpuxvi pQ/mdLSq3vgdYayPXniuRGDAE/BQWl0CwU2h8e2QBcalBd3ZLeaKho/YRuSVWAX5TwuJ ElLOcpaN4O+N6JZo84CTIq8Fr7BPafrSWG0yWfWXqI/pNYgIkrzfe1l3CtRqSIwE4S7Y NedA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=gR98btrArpXgzNlFBMpM5+u+hymqUmJwdF9GWqwhALE=; b=yySFXWID2c9wjsudvHwqSOqWdS1mAo+5PlZaqpJCZ8X0fzpSVtck8Drn5/kx8E0Mdm YODLdhxqRp2oL6Clkqs8h77ObXxaHm0vg4Th+Zw3qAlic2ws6jsiD4Vjk/M5kGAHNeWa 85z7pxYDLLK0dKKwqadztyD6n+HCS2K+qkLszYZyMQKIXKpRA27JWY07nI3IAdId6HtE pO6As4NDEwD75mLQQNrmWT6emvsRHzYe9H/fskd45i3caHFGkccGBVH0vkQm8IvnAQDT BRfm2YDQ+BfoPhD4B2EJaL71LSNX93NXvicsAb5jdSOdVAax63bFb01023JNPg38v55L EKQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=qF9xcejg; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g2si14972673plp.130.2018.12.12.08.43.45; Wed, 12 Dec 2018 08:44:00 -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=@gmail.com header.s=20161025 header.b=qF9xcejg; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727941AbeLLQl0 (ORCPT + 99 others); Wed, 12 Dec 2018 11:41:26 -0500 Received: from mail-it1-f196.google.com ([209.85.166.196]:53820 "EHLO mail-it1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726358AbeLLQlZ (ORCPT ); Wed, 12 Dec 2018 11:41:25 -0500 Received: by mail-it1-f196.google.com with SMTP id g85so9980126ita.3 for ; Wed, 12 Dec 2018 08:41:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=gR98btrArpXgzNlFBMpM5+u+hymqUmJwdF9GWqwhALE=; b=qF9xcejgGz+zDTbCzD8jlk1x1cy6fCMFt8RLIRM+l3JtR0mQOlFxvDVZtnjjOxpaza 7oxqezBH7Bzoa5mINDEi/bcWs4g6ljZD0d6K5hQWEh5cuqskg8uRAuWfEsEsJi28zww5 YEJBHEvaGlVksDG7a3PgelIP/Etk0qwZY31++UnxiieQz8tP+mK0xcMn4sn01UgFJFd6 R2t+VvNJnHtdCBKoq70HAglSw2h6Y2ecA0JIgcLFbThAS5WDAg79fgRA/8eShuJk92be MLZKi70Ps9byAXky4JpIuz6nY4A4LX9OF2KJWuDhJUcIzy4xvY0U24ExC9Y5SS6Qe8Vi g1UA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=gR98btrArpXgzNlFBMpM5+u+hymqUmJwdF9GWqwhALE=; b=iAA9T8S1uNxz0DXAlhwn45qIkcbq5+cGyREDrB+69jlM2iCsfhxtL3DNnUWuwlMEsP Q6cEDwWJc0LdO0yopjIXYSFxe0a6SM5w0xjoa7PgNbRku6V9cy+/EfulD22A79LUrYfG Ry4xVvOEJMi4GBo6nD74shtHTkmfLPlh2MKKUhqfxJUC6A+fWi8YaLVdgr3sH219Q53K flvLy7sPdF7Du3qEKcto+Hj4op2aK4giMRPwW+3iBavA7AMelK5GooA8CgLH6lJPTnKg nfHMTw0KSomnRUp1IyTa9BWgN+o+XGIWi18q/SwMLHaWjI3M9SMd3GE0j6vzKEHO+aVZ WJfw== X-Gm-Message-State: AA+aEWbnv5/oaA9B/zHjLRbZOSbt6FujnLXR5Yy1gUWS/2ZF0s4PqC+a QX+/7tStbm6+Bl6mH45577nXhtnrzhxar/hMZBnsnY7M X-Received: by 2002:a05:660c:250:: with SMTP id t16mr3532082itk.78.1544632884446; Wed, 12 Dec 2018 08:41:24 -0800 (PST) MIME-Version: 1.0 References: <20181210160327.20811-1-tiny.windzz@gmail.com> <20181210102157.6fa8fd8b@cakuba.netronome.com> In-Reply-To: <20181210102157.6fa8fd8b@cakuba.netronome.com> From: Frank Lee Date: Thu, 13 Dec 2018 00:41:13 +0800 Message-ID: Subject: Re: [PATCH] bpf: convert to DEFINE_SHOW_ATTRIBUTE To: jakub.kicinski@netronome.com Cc: davem@davemloft.net, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Dec 11, 2018 at 2:22 AM Jakub Kicinski wrote: > > 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:". The newer has been sent. Thanks, Yangtao > > > 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) >