mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Robert P. J. Day" <rpjday@crashcourse.ca>
To: Pekka J Enberg <penberg@cs.helsinki.fi>
Cc: npiggin@suse.de,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] SLQB: Use _RET_IP_ instead of __builtin_return_address(0)
Date: Sun, 3 May 2009 08:19:39 -0400 (EDT)	[thread overview]
Message-ID: <alpine.LFD.2.00.0905030816050.7072@localhost.localdomain> (raw)
In-Reply-To: <Pine.LNX.4.64.0905031513410.32397@melkki.cs.Helsinki.FI>

On Sun, 3 May 2009, Pekka J Enberg wrote:

> From: Pekka Enberg <penberg@cs.helsinki.fi>
>
> This patch changes SLQB to use the shorter _RET_IP_ form for consistency
> with SLUB and to prepare SQLB for eventual kmemtrace hooks.

... big snip ...

>  void *kmem_cache_alloc(struct kmem_cache *s, gfp_t gfpflags)
>  {
> -	return __kmem_cache_alloc(s, gfpflags, __builtin_return_address(0));
> +	return __kmem_cache_alloc(s, gfpflags, _RET_IP_);
>  }

  since i originally pointed out this possible simplification, i might
as well also point out that the above is not necessarily correct.  in
include/linux/kernel.h:

#define _RET_IP_   (unsigned long)__builtin_return_address(0)

as in, _RET_IP_ represents the **(unsigned long)** cast of that
(void*) value.  so, technically, that's not merely an aesthetic
replacement.  is that still what you wanted?

rday
--

========================================================================
Robert P. J. Day                               Waterloo, Ontario, CANADA

        Linux Consulting, Training and Annoying Kernel Pedantry.

Web page:                                          http://crashcourse.ca
Linked In:                             http://www.linkedin.com/in/rpjday
Twitter:                                       http://twitter.com/rpjday
========================================================================

  reply	other threads:[~2009-05-03 12:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-03 12:14 Pekka J Enberg
2009-05-03 12:19 ` Robert P. J. Day [this message]
2009-05-03 12:22   ` Robert P. J. Day
2009-05-05  8:22 ` Nick Piggin

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=alpine.LFD.2.00.0905030816050.7072@localhost.localdomain \
    --to=rpjday@crashcourse.ca \
    --cc=linux-kernel@vger.kernel.org \
    --cc=npiggin@suse.de \
    --cc=penberg@cs.helsinki.fi \
    /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®