Re: [PATCH] kobject: return -ENOSPC when add_uevent_var() fails

From: Rafael J. Wysocki
Date: Fri Jun 07 2019 - 08:30:42 EST


On Fri, Jun 7, 2019 at 2:02 PM Masahiro Yamada
<yamada.masahiro@xxxxxxxxxxxxx> wrote:
>
> On Wed, Jun 5, 2019 at 5:53 AM Rafael J. Wysocki <rafael@xxxxxxxxxx> wrote:
> >
> > On Tue, Jun 4, 2019 at 8:00 PM Masahiro Yamada
> > <yamada.masahiro@xxxxxxxxxxxxx> wrote:
> > >
> > > This function never attempts to allocate memory, so returning -ENOMEM
> > > looks weird to me.
> >
> > And why is the "looks weird to me" a good enough reason for making
> > changes like this?
>
>
> Since the code is read much more than written,
> this change eliminates the question of "why -ENOMEM here?"

And you are sure that nobody relies on the current return value?