mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jan Hudec <bulb@cimice.maxinet.cz>
To: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] warnkill trivia 2/2
Date: Tue, 3 Sep 2002 00:24:05 +0200	[thread overview]
Message-ID: <20020902222405.GA30964@vagabond> (raw)
In-Reply-To: <20020901112856.GL32122@louise.pinerecords.com>

On Sun, Sep 01, 2002 at 01:28:56PM +0200, Tomas Szepe wrote:
> >    From: Tomas Szepe <szepe@pinerecords.com>
> >    Date: Sun, 1 Sep 2002 12:56:43 +0200
> > 
> >    2.4.20-pre5: prevent sparc32's atomic_read() from possibly discarding
> >    const qualifiers from pointers passed as its argument.
> >    
> >    -static __inline__ int atomic_read(atomic_t *v)
> >    +static __inline__ int atomic_read(const atomic_t *v)
> > 
> > So the atomic_t is const is it?  That's news to me.
> > 
> > I think you mean something like "atomic_t const * v" which means the
> > pointer is constant, not the value.
> 
> Precisely.
> 

No, you don't. Having the pointer constant means the symbolic argument
can't be changed inside the function. But it means nothing at all to the
caller, because the caller's variable itself is never changed by the
call. 

> 
> diff -u linux-2.4.20-pre5/include/asm-sparc/atomic.h linux-2.4.20-pre5.n/include/asm-sparc/atomic.h
> --- linux-2.4.20-pre5/include/asm-sparc/atomic.h	2001-11-08 17:42:19.000000000 +0100
> +++ linux-2.4.20-pre5.n/include/asm-sparc/atomic.h	2002-09-01 12:29:36.000000000 +0200
> @@ -35,7 +35,7 @@
>  
>  #define ATOMIC_INIT(i)	{ (i << 8) }
>  
> -static __inline__ int atomic_read(atomic_t *v)
> +static __inline__ int atomic_read(atomic_t const *v)
>  {
>  	int ret = v->counter;
-------------------------------------------------------------------------------
						 Jan 'Bulb' Hudec <bulb@ucw.cz>

  parent reply	other threads:[~2002-09-04  8:02 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-01 10:56 Tomas Szepe
2002-09-01 10:57 ` David S. Miller
2002-09-01 11:28   ` Tomas Szepe
2002-09-01 11:25     ` David S. Miller
2002-09-01 11:37       ` Tomas Szepe
2002-09-01 11:35         ` David S. Miller
2002-09-01 12:10           ` Tomas Szepe
2002-09-01 12:16             ` David S. Miller
2002-09-01 12:39               ` Tomas Szepe
2002-09-01 21:57                 ` Bruce Guenter
2002-09-02 22:24     ` Jan Hudec [this message]
2002-09-01 15:27 ` [PATCH] warnkill trivia 2/2 (correction) Tomas Szepe
2002-09-01 14:52 [PATCH] warnkill trivia 2/2 Mikael Pettersson
2002-09-01 14:56 ` Tomas Szepe

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=20020902222405.GA30964@vagabond \
    --to=bulb@cimice.maxinet.cz \
    --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

Powered by JetHome