lkml.org 
[lkml]   [2024]   [Feb]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 1/5] pwm: dwc: drop redundant error check
On Thu, Feb 08, 2024 at 08:46:44AM +0100, Uwe Kleine-König wrote:
> On Thu, Feb 08, 2024 at 12:35:25PM +0530, Raag Jadav wrote:
> > pcim_iomap_table() fails only if pcim_iomap_regions() fails. No need to
> > check for failure if the latter is already successful.
>
> Is this really true? pcim_iomap_table() calls devres_alloc_node() which
> might fail if the allocation fails. (Yes, I know
> https://lwn.net/Articles/627419/, but the rule is still to check for
> errors, right?)

We do not add a dead code to the kernel, right?

> What am I missing?

Mysterious ways of the twisted PCI devres code.
Read the above commit message again :-)

For your convenience I can elaborate. pcim_iomap_table() calls _first_
devres_find() which _will_ succeed if the pcim_iomap_regions() previously
succeeded. Does it help to understand how it designed?

--
With Best Regards,
Andy Shevchenko



\
 
 \ /
  Last update: 2024-05-27 14:55    [W:0.093 / U:0.492 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site