RE: [PATCH v2 05/10] x86/mce/genpool: Make mce_gen_pool_create() return explicit error codes

From: Zhuo, Qiuxu
Date: Fri Oct 18 2024 - 23:29:57 EST


> From: Mehta, Sohil <sohil.mehta@xxxxxxxxx>
> [...]
> > diff --git a/arch/x86/kernel/cpu/mce/genpool.c
> > b/arch/x86/kernel/cpu/mce/genpool.c
> > index 4284749ec803..ffa28769dea6 100644
> > --- a/arch/x86/kernel/cpu/mce/genpool.c
> > +++ b/arch/x86/kernel/cpu/mce/genpool.c
> > @@ -120,20 +120,20 @@ static int mce_gen_pool_create(void) {
> > int mce_numrecords, mce_poolsz, order;
> > struct gen_pool *gpool;
> > - int ret = -ENOMEM;
> > void *mce_pool;
> > + int ret;
> >
>
> Nit: Maybe move the uninitialized ret along with the other ints in the first
> line?

OK, that will save one line of code.
I'll update this in the next version.

> I had suggested something very similar but Boris felt that the current code as-
> is reads better. But that was in a slightly different context.
> https://lore.kernel.org/lkml/20240307170901.GBZen0re6AvpscLaTM@fat_crat
> e.local/

Thanks for sharing this ... 😊

-Qiuxu