Re: [PATCH] Introduce atomic_long_t and asm-generic/atomic.h

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 12 Dec 2005, Andrew Morton wrote:

> It assumes that sizeof(long) = sizeof(int) ifndef ATOMIC64_INIT.  Which is
> true, but there are still problems.  For example, I'd reasonably expect this:

If ATOMIC64_INIT is not defined then atomic_t == atomic_long_t. Everything 
beyond that comes already with atomic_t.

> 	printk("%ld", atomic_long_read(v));
> 
> to not produce a warning.  It may also lead to long*/int* warnings or build
> errors.

The mm_counter_t logic in include/linux/sched.h already does the same as 
this patch. So we already have that issue.

> Also, it kind-of assumes that each 64-bit arch uses `long' for its 64-bit
> value.  sh64, for example, appears to use `long long'.

sh64 has no atomic64 support. And so atomic_long will be 32bit.

Hmmm.. Maybe rename atomic_long_t to something else?

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux