[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YkGn6/B4XHhb72YC@ninjato>
Date: Mon, 28 Mar 2022 14:19:55 +0200
From: Wolfram Sang <wsa+renesas@...g-engineering.com>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc: linux-gpio@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-renesas-soc@...r.kernel.org
Subject: Re: [PATCH v7 1/1] gpio: add sloppy logic analyzer using polling
> > I don't like assigning 'priv' memebers twice, so I'd like to keep it as
> > is.
>
> But this will give better understanding of the steps the code performs, no?
IMO the current version is readable :)
> (Because this function basically contains two steps at once. I assume it's
> done this way due to absence of vrealloc(), right?)
>
> But we have kvrealloc(). Can it be used here?
This has a huge disadvantage: realloc() requests new memory before the
old one is discarded. If you want to make a huge buffer bigger, this can
lead to OOM. The old contents do not matter, so the old buffer can go
away in favor of the new one.
> > > Can it be wrapped by DEFINE_SHOW_ATTRIBUTE()?
> >
> > I don't see a way. Do you?
>
> Me neither. I mixed this up with (not upstreamed yet) DEFINE_STORE_ATTRIBUTE.
Still no cigar. That one is for rw files. Mine is writable only, so I use
e.g. no_llseek.
Probably, the above macro should be named, DEFINE_SHOWSTORE_ATTRIBUTE.
But I see this macro is stalled since late 2020 anyhow.
Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)
Powered by blists - more mailing lists