mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Wolfram Sang <wsa+renesas@sang-engineering.com>,
	linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-renesas-soc@vger.kernel.org
Subject: Re: [PATCH v7 1/1] gpio: add sloppy logic analyzer using polling
Date: Mon, 28 Mar 2022 15:51:31 +0300	[thread overview]
Message-ID: <YkGvU3l1Lq7OlYKK@smile.fi.intel.com> (raw)
In-Reply-To: <YkGn6/B4XHhb72YC@ninjato>

On Mon, Mar 28, 2022 at 02:19:55PM +0200, Wolfram Sang wrote:
> 
> > > 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 :)

OK!

...

> > (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.

Fair enough.

...

> > > > 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.

Right, not applicable here anyway.

-- 
With Best Regards,
Andy Shevchenko



      reply	other threads:[~2022-03-28 12:52 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-17  8:50 [PATCH v7 0/1] gpio: add simple " Wolfram Sang
2022-03-17  8:50 ` [PATCH v7 1/1] gpio: add sloppy " Wolfram Sang
2022-03-21 13:51   ` Andy Shevchenko
2022-03-28  9:37     ` Wolfram Sang
2022-03-28 10:49       ` Andy Shevchenko
2022-03-28 12:19         ` Wolfram Sang
2022-03-28 12:51           ` Andy Shevchenko [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YkGvU3l1Lq7OlYKK@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=wsa+renesas@sang-engineering.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®