linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Wolfram Sang <wsa@the-dreams.de>
To: SF Markus Elfring <elfring@users.sourceforge.net>
Cc: linux-i2c@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>,
	kernel-janitors@vger.kernel.org,
	Julia Lawall <julia.lawall@lip6.fr>
Subject: Re: i2c-core: One function call less in acpi_i2c_space_handler() after error detection
Date: Sat, 26 Dec 2015 19:41:52 +0100	[thread overview]
Message-ID: <20151226184152.GA882@tetsubishi> (raw)
In-Reply-To: <567E553B.5080005@users.sourceforge.net>

[-- Attachment #1: Type: text/plain, Size: 758 bytes --]

On Sat, Dec 26, 2015 at 09:52:11AM +0100, SF Markus Elfring wrote:
> >> The kfree() function was called in one case by the
> >> acpi_i2c_space_handler() function during error handling
> >> even if the passed variable "client" contained a null pointer.
> > 
> > This is OK. kfree() is known to be NULL-tolerant and we rely on it in
> > various places to keep the code simpler.
> 
> I would appreciate if an unnecessary function call can be avoided here
> so that the affected exception handling can become also a bit more efficient.

Simpler code is easier to maintain. See your patch, you didn't get it
correctly at your first try. Also, this is not a hot path, so I see
it as a micro-optimization also adding complexity. I don't favor that.


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

  reply	other threads:[~2015-12-26 18:41 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <566ABCD9.1060404@users.sourceforge.net>
2015-12-26  6:34 ` [PATCH] i2c-core: One function call less in acpi_i2c_space_handler() after error detection SF Markus Elfring
2015-12-26  6:47   ` kbuild test robot
2015-12-26  7:08     ` [PATCH v2] " SF Markus Elfring
2015-12-26  7:48       ` Wolfram Sang
2015-12-26  8:52         ` SF Markus Elfring
2015-12-26 18:41           ` Wolfram Sang [this message]
2015-12-26 19:30             ` SF Markus Elfring
2016-09-23 19:42 ` [PATCH 0/4] i2c-dev: Fine-tuning for four function implementations SF Markus Elfring
2016-09-23 19:44   ` [PATCH 1/4] i2c-dev: Use kmalloc_array() in i2cdev_ioctl_rdwr() SF Markus Elfring
2016-09-23 19:45   ` [PATCH 2/4] i2c-dev: Improve another size determination " SF Markus Elfring
2016-09-23 19:46   ` [PATCH 3/4] i2c-dev: Rename jump labels in i2cdev_attach_adapter() SF Markus Elfring
2016-09-23 19:47   ` [PATCH 4/4] i2c-dev: Adjust checks for null pointers in three functions SF Markus Elfring

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=20151226184152.GA882@tetsubishi \
    --to=wsa@the-dreams.de \
    --cc=elfring@users.sourceforge.net \
    --cc=julia.lawall@lip6.fr \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).