Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 190925
b: refs/heads/master
c: b1f3bb4
h: refs/heads/master
i:
  190923: 51431e7
v: v3
  • Loading branch information
Thomas Gleixner authored and Geert Uytterhoeven committed May 17, 2010
1 parent 48a496f commit 013813e
Show file tree
Hide file tree
Showing 35 changed files with 106 additions and 166 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7d32c0aca4fbd0319c860d12af5fae3e88c760e6
refs/heads/master: b1f3bb494e8acddeb972331c2ac642b3c7bceeb9
4 changes: 2 additions & 2 deletions trunk/arch/alpha/include/asm/atomic.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
#define ATOMIC_INIT(i) ( (atomic_t) { (i) } )
#define ATOMIC64_INIT(i) ( (atomic64_t) { (i) } )

#define atomic_read(v) (*(volatile int *)&(v)->counter)
#define atomic64_read(v) (*(volatile long *)&(v)->counter)
#define atomic_read(v) ((v)->counter + 0)
#define atomic64_read(v) ((v)->counter + 0)

#define atomic_set(v,i) ((v)->counter = (i))
#define atomic64_set(v,i) ((v)->counter = (i))
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/arm/include/asm/atomic.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
* strex/ldrex monitor on some implementations. The reason we can use it for
* atomic_set() is the clrex or dummy strex done on every exception return.
*/
#define atomic_read(v) (*(volatile int *)&(v)->counter)
#define atomic_read(v) ((v)->counter)
#define atomic_set(v,i) (((v)->counter) = (i))

#if __LINUX_ARM_ARCH__ >= 6
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/avr32/include/asm/atomic.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

#define ATOMIC_INIT(i) { (i) }

#define atomic_read(v) (*(volatile int *)&(v)->counter)
#define atomic_read(v) ((v)->counter)
#define atomic_set(v, i) (((v)->counter) = i)

/*
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/cris/include/asm/atomic.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

#define ATOMIC_INIT(i) { (i) }

#define atomic_read(v) (*(volatile int *)&(v)->counter)
#define atomic_read(v) ((v)->counter)
#define atomic_set(v,i) (((v)->counter) = (i))

/* These should be written in asm but we do it in C for now. */
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/frv/include/asm/atomic.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
#define smp_mb__after_atomic_inc() barrier()

#define ATOMIC_INIT(i) { (i) }
#define atomic_read(v) (*(volatile int *)&(v)->counter)
#define atomic_read(v) ((v)->counter)
#define atomic_set(v, i) (((v)->counter) = (i))

#ifndef CONFIG_FRV_OUTOFLINE_ATOMIC_OPS
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/h8300/include/asm/atomic.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

#define ATOMIC_INIT(i) { (i) }

#define atomic_read(v) (*(volatile int *)&(v)->counter)
#define atomic_read(v) ((v)->counter)
#define atomic_set(v, i) (((v)->counter) = i)

#include <asm/system.h>
Expand Down
4 changes: 2 additions & 2 deletions trunk/arch/ia64/include/asm/atomic.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
#define ATOMIC_INIT(i) ((atomic_t) { (i) })
#define ATOMIC64_INIT(i) ((atomic64_t) { (i) })

#define atomic_read(v) (*(volatile int *)&(v)->counter)
#define atomic64_read(v) (*(volatile long *)&(v)->counter)
#define atomic_read(v) ((v)->counter)
#define atomic64_read(v) ((v)->counter)

#define atomic_set(v,i) (((v)->counter) = (i))
#define atomic64_set(v,i) (((v)->counter) = (i))
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/m32r/include/asm/atomic.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
*
* Atomically reads the value of @v.
*/
#define atomic_read(v) (*(volatile int *)&(v)->counter)
#define atomic_read(v) ((v)->counter)

/**
* atomic_set - set atomic variable
Expand Down
29 changes: 9 additions & 20 deletions trunk/arch/m68k/bvme6000/rtc.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#include <linux/types.h>
#include <linux/errno.h>
#include <linux/miscdevice.h>
#include <linux/smp_lock.h>
#include <linux/ioport.h>
#include <linux/capability.h>
#include <linux/fcntl.h>
Expand All @@ -35,10 +34,9 @@
static unsigned char days_in_mo[] =
{0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};

static char rtc_status;
static atomic_t rtc_status = ATOMIC_INIT(1);

static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
unsigned long arg)
static long rtc_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
{
volatile RtcPtr_t rtc = (RtcPtr_t)BVME_RTC_BASE;
unsigned char msr;
Expand Down Expand Up @@ -132,29 +130,20 @@ static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
}

/*
* We enforce only one user at a time here with the open/close.
* Also clear the previous interrupt data on an open, and clean
* up things on a close.
* We enforce only one user at a time here with the open/close.
*/

static int rtc_open(struct inode *inode, struct file *file)
{
lock_kernel();
if(rtc_status) {
unlock_kernel();
if (!atomic_dec_and_test(&rtc_status)) {
atomic_inc(&rtc_status);
return -EBUSY;
}

rtc_status = 1;
unlock_kernel();
return 0;
}

static int rtc_release(struct inode *inode, struct file *file)
{
lock_kernel();
rtc_status = 0;
unlock_kernel();
atomic_inc(&rtc_status);
return 0;
}

Expand All @@ -163,9 +152,9 @@ static int rtc_release(struct inode *inode, struct file *file)
*/

static const struct file_operations rtc_fops = {
.ioctl = rtc_ioctl,
.open = rtc_open,
.release = rtc_release,
.unlocked_ioctl = rtc_ioctl,
.open = rtc_open,
.release = rtc_release,
};

static struct miscdevice rtc_dev = {
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/m68k/include/asm/atomic_mm.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

#define ATOMIC_INIT(i) { (i) }

#define atomic_read(v) (*(volatile int *)&(v)->counter)
#define atomic_read(v) ((v)->counter)
#define atomic_set(v, i) (((v)->counter) = i)

static inline void atomic_add(int i, atomic_t *v)
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/m68k/include/asm/atomic_no.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

#define ATOMIC_INIT(i) { (i) }

#define atomic_read(v) (*(volatile int *)&(v)->counter)
#define atomic_read(v) ((v)->counter)
#define atomic_set(v, i) (((v)->counter) = i)

static __inline__ void atomic_add(int i, atomic_t *v)
Expand Down
19 changes: 5 additions & 14 deletions trunk/arch/m68k/mvme16x/rtc.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#include <linux/types.h>
#include <linux/errno.h>
#include <linux/miscdevice.h>
#include <linux/smp_lock.h>
#include <linux/ioport.h>
#include <linux/capability.h>
#include <linux/fcntl.h>
Expand All @@ -36,8 +35,7 @@ static const unsigned char days_in_mo[] =

static atomic_t rtc_ready = ATOMIC_INIT(1);

static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
unsigned long arg)
static long rtc_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
{
volatile MK48T08ptr_t rtc = (MK48T08ptr_t)MVME_RTC_BASE;
unsigned long flags;
Expand Down Expand Up @@ -120,22 +118,15 @@ static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
}

/*
* We enforce only one user at a time here with the open/close.
* Also clear the previous interrupt data on an open, and clean
* up things on a close.
* We enforce only one user at a time here with the open/close.
*/

static int rtc_open(struct inode *inode, struct file *file)
{
lock_kernel();
if( !atomic_dec_and_test(&rtc_ready) )
{
atomic_inc( &rtc_ready );
unlock_kernel();
return -EBUSY;
}
unlock_kernel();

return 0;
}

Expand All @@ -150,9 +141,9 @@ static int rtc_release(struct inode *inode, struct file *file)
*/

static const struct file_operations rtc_fops = {
.ioctl = rtc_ioctl,
.open = rtc_open,
.release = rtc_release,
.unlocked_ioctl = rtc_ioctl,
.open = rtc_open,
.release = rtc_release,
};

static struct miscdevice rtc_dev=
Expand Down
4 changes: 2 additions & 2 deletions trunk/arch/mips/include/asm/atomic.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
*
* Atomically reads the value of @v.
*/
#define atomic_read(v) (*(volatile int *)&(v)->counter)
#define atomic_read(v) ((v)->counter)

/*
* atomic_set - set atomic variable
Expand Down Expand Up @@ -410,7 +410,7 @@ static __inline__ int atomic_add_unless(atomic_t *v, int a, int u)
* @v: pointer of type atomic64_t
*
*/
#define atomic64_read(v) (*(volatile long *)&(v)->counter)
#define atomic64_read(v) ((v)->counter)

/*
* atomic64_set - set atomic variable
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/mn10300/include/asm/atomic.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
* Atomically reads the value of @v. Note that the guaranteed
* useful range of an atomic_t is only 24 bits.
*/
#define atomic_read(v) (*(volatile int *)&(v)->counter)
#define atomic_read(v) ((v)->counter)

/**
* atomic_set - set atomic variable
Expand Down
4 changes: 2 additions & 2 deletions trunk/arch/parisc/include/asm/atomic.h
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ static __inline__ void atomic_set(atomic_t *v, int i)

static __inline__ int atomic_read(const atomic_t *v)
{
return (*(volatile int *)&(v)->counter);
return v->counter;
}

/* exported interface */
Expand Down Expand Up @@ -286,7 +286,7 @@ atomic64_set(atomic64_t *v, s64 i)
static __inline__ s64
atomic64_read(const atomic64_t *v)
{
return (*(volatile long *)&(v)->counter);
return v->counter;
}

#define atomic64_add(i,v) ((void)(__atomic64_add_return( ((s64)(i)),(v))))
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/sh/include/asm/atomic.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

#define ATOMIC_INIT(i) ( (atomic_t) { (i) } )

#define atomic_read(v) (*(volatile int *)&(v)->counter)
#define atomic_read(v) ((v)->counter)
#define atomic_set(v,i) ((v)->counter = (i))

#if defined(CONFIG_GUSA_RB)
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/sparc/include/asm/atomic_32.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ extern int atomic_cmpxchg(atomic_t *, int, int);
extern int atomic_add_unless(atomic_t *, int, int);
extern void atomic_set(atomic_t *, int);

#define atomic_read(v) (*(volatile int *)&(v)->counter)
#define atomic_read(v) ((v)->counter)

#define atomic_add(i, v) ((void)__atomic_add_return( (int)(i), (v)))
#define atomic_sub(i, v) ((void)__atomic_add_return(-(int)(i), (v)))
Expand Down
4 changes: 2 additions & 2 deletions trunk/arch/sparc/include/asm/atomic_64.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
#define ATOMIC_INIT(i) { (i) }
#define ATOMIC64_INIT(i) { (i) }

#define atomic_read(v) (*(volatile int *)&(v)->counter)
#define atomic64_read(v) (*(volatile long *)&(v)->counter)
#define atomic_read(v) ((v)->counter)
#define atomic64_read(v) ((v)->counter)

#define atomic_set(v, i) (((v)->counter) = i)
#define atomic64_set(v, i) (((v)->counter) = i)
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/x86/include/asm/atomic.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
*/
static inline int atomic_read(const atomic_t *v)
{
return (*(volatile int *)&(v)->counter);
return v->counter;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/x86/include/asm/atomic64_64.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/
static inline long atomic64_read(const atomic64_t *v)
{
return (*(volatile long *)&(v)->counter);
return v->counter;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/xtensa/include/asm/atomic.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
*
* Atomically reads the value of @v.
*/
#define atomic_read(v) (*(volatile int *)&(v)->counter)
#define atomic_read(v) ((v)->counter)

/**
* atomic_set - set atomic variable
Expand Down
6 changes: 0 additions & 6 deletions trunk/fs/logfs/dev_bdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -303,19 +303,13 @@ static void bdev_put_device(struct super_block *sb)
close_bdev_exclusive(logfs_super(sb)->s_bdev, FMODE_READ|FMODE_WRITE);
}

static int bdev_can_write_buf(struct super_block *sb, u64 ofs)
{
return 0;
}

static const struct logfs_device_ops bd_devops = {
.find_first_sb = bdev_find_first_sb,
.find_last_sb = bdev_find_last_sb,
.write_sb = bdev_write_sb,
.readpage = bdev_readpage,
.writeseg = bdev_writeseg,
.erase = bdev_erase,
.can_write_buf = bdev_can_write_buf,
.sync = bdev_sync,
.put_device = bdev_put_device,
};
Expand Down
Loading

0 comments on commit 013813e

Please sign in to comment.