linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
To: kernel-TqfNSX0MhmxHKSADF0wUEw@public.gmane.org
Cc: Stephen Warren <swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>,
	Lee Jones <lee-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Eric Anholt <eric-WhKQ6XTQaPysTnJN9+BGXg@public.gmane.org>,
	linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-rpi-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Subject: Re: [PATCH 1/3] spi: added spi_resource management
Date: Tue, 1 Dec 2015 21:04:10 +0000	[thread overview]
Message-ID: <20151201210410.GU1929@sirena.org.uk> (raw)
In-Reply-To: <1448888695-2260-2-git-send-email-kernel-TqfNSX0MhmxHKSADF0wUEw@public.gmane.org>

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

On Mon, Nov 30, 2015 at 01:04:52PM +0000, kernel-TqfNSX0MhmxHKSADF0wUEw@public.gmane.org wrote:

> +static struct spi_res *__spi_res_alloc(struct spi_device *spi,
> +				       spi_res_release_t release,
> +				       size_t size,
> +				       gfp_t gfp)

This has exactly one (tiny) user.  Why is it a separate function?

> +	sres = kzalloc(tot_size, gfp);
> +	if (unlikely(!sres))
> +		return NULL;

Don't use likely() or unlikely() annotations unless the code is *really*
performance critical, just let the optimiser get on with things.  The
annotations most likely cost more time in reading the code than they'll
ever save.

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

  parent reply	other threads:[~2015-12-01 21:04 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-30 13:04 [PATCH 0/3] spi: spi-message transformation framework kernel-TqfNSX0MhmxHKSADF0wUEw
     [not found] ` <1448888695-2260-1-git-send-email-kernel-TqfNSX0MhmxHKSADF0wUEw@public.gmane.org>
2015-11-30 13:04   ` [PATCH 1/3] spi: added spi_resource management kernel-TqfNSX0MhmxHKSADF0wUEw
     [not found]     ` <1448888695-2260-2-git-send-email-kernel-TqfNSX0MhmxHKSADF0wUEw@public.gmane.org>
2015-12-01 21:04       ` Mark Brown [this message]
     [not found]         ` <20151201210410.GU1929-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2015-12-02  7:30           ` Martin Sperl
     [not found]             ` <56C9120A-8979-4156-B3C4-5851D695BDF0-TqfNSX0MhmxHKSADF0wUEw@public.gmane.org>
2015-12-02 12:29               ` Mark Brown
     [not found]                 ` <20151202122953.GG1929-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2015-12-02 13:04                   ` Martin Sperl
     [not found]                     ` <565EEC58.4040006-TqfNSX0MhmxHKSADF0wUEw@public.gmane.org>
2015-12-02 13:32                       ` Mark Brown
     [not found]                         ` <20151202133232.GK1929-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2015-12-02 13:53                           ` Martin Sperl
2015-11-30 13:04   ` [PATCH 2/3] spi: add initial set of spi_transfer transformation methods kernel-TqfNSX0MhmxHKSADF0wUEw
     [not found]     ` <1448888695-2260-3-git-send-email-kernel-TqfNSX0MhmxHKSADF0wUEw@public.gmane.org>
2015-12-01 21:29       ` Mark Brown
     [not found]         ` <20151201212929.GV1929-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2015-12-02  7:25           ` Martin Sperl
     [not found]             ` <35C5C134-8291-4856-8916-7EDDFB07A0A9-TqfNSX0MhmxHKSADF0wUEw@public.gmane.org>
2015-12-03  0:36               ` Mark Brown
     [not found]                 ` <20151203003618.GQ1929-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2015-12-03  6:22                   ` Martin Sperl
     [not found]                     ` <91B0D66C-97E5-4683-8896-091C4BD7FCAF-TqfNSX0MhmxHKSADF0wUEw@public.gmane.org>
2015-12-03 14:34                       ` Mark Brown
     [not found]                         ` <20151203143417.GE5727-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2015-12-03 15:33                           ` Martin Sperl
     [not found]                             ` <9DF774BE-EA2B-40E8-9CBF-E0A06AB5A751-TqfNSX0MhmxHKSADF0wUEw@public.gmane.org>
2015-12-03 18:04                               ` Mark Brown
2015-11-30 13:04   ` [PATCH 3/3] spi: bcm2835: moved to the spi_transfer transformation to avoid HW restrictions kernel-TqfNSX0MhmxHKSADF0wUEw

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=20151201210410.GU1929@sirena.org.uk \
    --to=broonie-dgejt+ai2ygdnm+yrofe0a@public.gmane.org \
    --cc=eric-WhKQ6XTQaPysTnJN9+BGXg@public.gmane.org \
    --cc=kernel-TqfNSX0MhmxHKSADF0wUEw@public.gmane.org \
    --cc=lee-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=linux-rpi-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.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).