Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1298248

Re: i2c-core: One function call less in acpi_i2c_space_handler() after error detection

From Wolfram Sang <wsa@the-dreams.de>
Newsgroups linux.kernel
Subject Re: i2c-core: One function call less in acpi_i2c_space_handler() after error detection
Date 2015-12-26 19:50 +0100
Message-ID <qK24F-4vv-5@gated-at.bofh.it> (permalink)
References <qJQPT-5Ub-1@gated-at.bofh.it> <qJR9f-6fG-1@gated-at.bofh.it> <qJRLX-6t9-5@gated-at.bofh.it> <qJSRI-77i-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

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.

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] i2c-core: One function call less in acpi_i2c_space_handler()  after error detection SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-26 07:40 +0100
  Re: [PATCH] i2c-core: One function call less in  acpi_i2c_space_handler() after error detection kbuild test robot <lkp@intel.com> - 2015-12-26 07:50 +0100
    [PATCH v2] i2c-core: One function call less in  acpi_i2c_space_handler() after error detection SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-26 08:10 +0100
      Re: [PATCH v2] i2c-core: One function call less in  acpi_i2c_space_handler() after error detection Wolfram Sang <wsa@the-dreams.de> - 2015-12-26 08:50 +0100
        Re: i2c-core: One function call less in acpi_i2c_space_handler()  after error detection SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-26 10:00 +0100
          Re: i2c-core: One function call less in acpi_i2c_space_handler()  after error detection Wolfram Sang <wsa@the-dreams.de> - 2015-12-26 19:50 +0100
            Re: i2c-core: One function call less in acpi_i2c_space_handler()  after error detection SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-26 20:40 +0100

csiph-web