mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: "Uwe Kleine-König" <uwe@kleine-koenig.org>
To: barebox@lists.infradead.org
Cc: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Subject: [PATCH 0/2] gpiolib: minor optimization
Date: Mon, 27 Jan 2020 12:44:51 +0100	[thread overview]
Message-ID: <20200127114453.366-1-uwe@kleine-koenig.org> (raw)

From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Hello,

while working on gpiolib I noticed that gpio_request_one() repeatedly
checks the validity of the gpio_info obtained by gpio_to_desc().

This series introduces some helper functions (prefixed gpioinfo_) that
take an gpio_info instead of a plain gpio number and assume this pointer
to be valid.

The saved runtime is probably too small to measure, so I didn't even
try. Semantically there is no change intended.

Best regards
Uwe

Uwe Kleine-König (2):
  gpiolib: reorder functions
  gpiolib: introduce helper functions working on gpio_info structs

 drivers/gpio/gpiolib.c | 243 +++++++++++++++++++++++++----------------
 1 file changed, 150 insertions(+), 93 deletions(-)

-- 
2.24.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

             reply	other threads:[~2020-01-27 11:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-27 11:44 Uwe Kleine-König [this message]
2020-01-27 11:44 ` [PATCH 1/2] gpiolib: reorder functions Uwe Kleine-König
2020-01-27 11:44 ` [PATCH 2/2] gpiolib: introduce helper functions working on gpio_info structs Uwe Kleine-König
2020-01-27 13:14 ` [PATCH 0/2] gpiolib: minor optimization Sascha Hauer

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=20200127114453.366-1-uwe@kleine-koenig.org \
    --to=uwe@kleine-koenig.org \
    --cc=barebox@lists.infradead.org \
    --cc=u.kleine-koenig@pengutronix.de \
    /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