Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1199283 > unrolled thread
| Started by | Steven Rostedt <rostedt@goodmis.org> |
|---|---|
| First post | 2015-08-03 23:40 +0200 |
| Last post | 2015-08-04 04:30 +0200 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: [PATCH 00/15] trivial: Drop unlikely before IS_ERR(_OR_NULL) Steven Rostedt <rostedt@goodmis.org> - 2015-08-03 23:40 +0200
Re: [PATCH 00/15] trivial: Drop unlikely before IS_ERR(_OR_NULL) Viresh Kumar <viresh.kumar@linaro.org> - 2015-08-04 04:30 +0200
| From | Steven Rostedt <rostedt@goodmis.org> |
|---|---|
| Date | 2015-08-03 23:40 +0200 |
| Subject | Re: [PATCH 00/15] trivial: Drop unlikely before IS_ERR(_OR_NULL) |
| Message-ID | <pTvCF-6Zh-15@gated-at.bofh.it> |
On Fri, 31 Jul 2015 13:23:10 +0300
"Kirill A. Shutemov" <kirill@shutemov.name> wrote:
> On Fri, Jul 31, 2015 at 11:41:09AM +0200, Vlastimil Babka wrote:
> > On 07/31/2015 10:38 AM, Viresh Kumar wrote:
> > >Hi,
> > >
> > >This cleans up the usage of IS_ERR(_OR_NULL)(), where the callers have
> > >added additional unlikely compiler flag to them. It also fixes the
> > >definition of IS_ERR_OR_NULL(), to use unlikely for all checks it does.
> >
> > [+CC Steven Rostedt]
> >
> > Any idea what the compiler does in the case of
> > "if (likely(IS_ERR(...)))"? There are apparently such cases in the source.
>
> We have two cases in code:
>
> drivers/rtc/rtc-gemini.c: if (likely(IS_ERR(rtc->rtc_dev)))
> drivers/staging/lustre/lustre/obdclass/lu_object.c: if (likely(IS_ERR(shadow) && PTR_ERR(shadow) == -ENOENT)) {
>
> The first one is mistake, I think. Or do we expect rtc_device_register()
> to fail?
>
> The second is redundant. "if (PTR_ERR(shadow) == -ENOENT)" should do the
> job.
>
Yep, those look like bugs to me.
-- Steve
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [next] | [standalone]
| From | Viresh Kumar <viresh.kumar@linaro.org> |
|---|---|
| Date | 2015-08-04 04:30 +0200 |
| Message-ID | <pTA9j-5jk-5@gated-at.bofh.it> |
| In reply to | #1199283 |
On 03-08-15, 17:38, Steven Rostedt wrote:
> On Fri, 31 Jul 2015 13:23:10 +0300
> "Kirill A. Shutemov" <kirill@shutemov.name> wrote:
> > We have two cases in code:
> >
> > drivers/rtc/rtc-gemini.c: if (likely(IS_ERR(rtc->rtc_dev)))
> > drivers/staging/lustre/lustre/obdclass/lu_object.c: if (likely(IS_ERR(shadow) && PTR_ERR(shadow) == -ENOENT)) {
> >
> > The first one is mistake, I think. Or do we expect rtc_device_register()
> > to fail?
> >
> > The second is redundant. "if (PTR_ERR(shadow) == -ENOENT)" should do the
> > job.
> >
>
> Yep, those look like bugs to me.
Yeah, I have fixed both of them :)
--
viresh
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web