From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Wang Nan <wangnan0@huawei.com>
Cc: lizefan@huawei.com, pi3orama@163.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/5] perf tools: Parsing libbpf return value using err.h
Date: Tue, 3 Nov 2015 12:20:36 -0300 [thread overview]
Message-ID: <20151103152036.GP21609@kernel.org> (raw)
In-Reply-To: <20151103151716.GO21609@kernel.org>
Em Tue, Nov 03, 2015 at 12:17:16PM -0300, Arnaldo Carvalho de Melo escreveu:
> Em Tue, Nov 03, 2015 at 10:44:44AM +0000, Wang Nan escreveu:
> > +++ b/tools/perf/tests/llvm.c
> > @@ -27,7 +27,7 @@ static int test__bpf_parsing(void *obj_buf, size_t obj_buf_sz)
> > struct bpf_object *obj;
> > obj = bpf_object__open_buffer(obj_buf, obj_buf_sz, NULL);
> > - if (!obj)
> > + if (IS_ERR(obj) || !obj)
> Well, since we've adopted IS_ERR() from the kernel, we better try to
> follow how it is used there, no?
> Since you move to use ERR_PTR(), you probably will never return NULL,
> right? So whay the (|| !obj) part?
> The kernel has an IS_ERR_OR_NULL() interface tho, trying to figure out
> when that would be appropriate...
I think you should change the error reporting convention _and_ the users
at the same time, i.e. please merge this patch with the next and use
plain:
if (IS_ERR(obj))
Instead, ok?
- Arnaldo
next prev parent reply other threads:[~2015-11-03 15:20 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-03 10:44 [PATCH 0/5] perf bpf: Improve error code delivering and output Wang Nan
2015-11-03 10:44 ` [PATCH 1/5] perf test: Keep test result clean if '-v' not set Wang Nan
2015-11-03 11:19 ` Namhyung Kim
2015-11-08 7:27 ` [tip:perf/urgent] " tip-bot for Wang Nan
2015-11-03 10:44 ` [PATCH 2/5] perf tools: Mute libbpf when " Wang Nan
2015-11-03 10:49 ` Wangnan (F)
2015-11-08 7:27 ` [tip:perf/urgent] perf bpf: " tip-bot for Wang Nan
2015-11-03 10:44 ` [PATCH 3/5] perf tools: Parsing libbpf return value using err.h Wang Nan
2015-11-03 15:17 ` Arnaldo Carvalho de Melo
2015-11-03 15:20 ` Arnaldo Carvalho de Melo [this message]
2015-11-03 10:44 ` [PATCH 4/5] bpf tools: Improve libbpf error reporting Wang Nan
2015-11-03 10:44 ` [PATCH 5/5] perf tools: Improve BPF related error messages output Wang Nan
2015-11-03 15:43 ` [PATCH 0/5] perf bpf: Improve error code delivering and output Arnaldo Carvalho de Melo
2015-11-04 1:43 ` Wangnan (F)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20151103152036.GP21609@kernel.org \
--to=acme@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lizefan@huawei.com \
--cc=pi3orama@163.com \
--cc=wangnan0@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.