diff options
author | Linus Torvalds <torvalds@g5.osdl.org> | 2006-04-02 15:58:45 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-04-02 15:58:45 -0400 |
commit | 63589ed0785ffc715777a54ccb96cdfaea9edbc0 (patch) | |
tree | 8ef3e50b7f87a5a2f5b0d96d1e22a1277c2381c0 /ipc | |
parent | 24c7cd0630f76f0eb081d539c53893d9f15787e8 (diff) | |
parent | a580290c3e64bb695158a090d02d1232d9609311 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/bunk/trivial
* git://git.kernel.org/pub/scm/linux/kernel/git/bunk/trivial: (48 commits)
Documentation: fix minor kernel-doc warnings
BUG_ON() Conversion in drivers/net/
BUG_ON() Conversion in drivers/s390/net/lcs.c
BUG_ON() Conversion in mm/slab.c
BUG_ON() Conversion in mm/highmem.c
BUG_ON() Conversion in kernel/signal.c
BUG_ON() Conversion in kernel/signal.c
BUG_ON() Conversion in kernel/ptrace.c
BUG_ON() Conversion in ipc/shm.c
BUG_ON() Conversion in fs/freevxfs/
BUG_ON() Conversion in fs/udf/
BUG_ON() Conversion in fs/sysv/
BUG_ON() Conversion in fs/inode.c
BUG_ON() Conversion in fs/fcntl.c
BUG_ON() Conversion in fs/dquot.c
BUG_ON() Conversion in md/raid10.c
BUG_ON() Conversion in md/raid6main.c
BUG_ON() Conversion in md/raid5.c
Fix minor documentation typo
BFP->BPF in Documentation/networking/tuntap.txt
...
Diffstat (limited to 'ipc')
-rw-r--r-- | ipc/shm.c | 15 | ||||
-rw-r--r-- | ipc/util.c | 6 |
2 files changed, 9 insertions, 12 deletions
@@ -91,8 +91,8 @@ static inline int shm_addid(struct shmid_kernel *shp) | |||
91 | static inline void shm_inc (int id) { | 91 | static inline void shm_inc (int id) { |
92 | struct shmid_kernel *shp; | 92 | struct shmid_kernel *shp; |
93 | 93 | ||
94 | if(!(shp = shm_lock(id))) | 94 | shp = shm_lock(id); |
95 | BUG(); | 95 | BUG_ON(!shp); |
96 | shp->shm_atim = get_seconds(); | 96 | shp->shm_atim = get_seconds(); |
97 | shp->shm_lprid = current->tgid; | 97 | shp->shm_lprid = current->tgid; |
98 | shp->shm_nattch++; | 98 | shp->shm_nattch++; |
@@ -142,8 +142,8 @@ static void shm_close (struct vm_area_struct *shmd) | |||
142 | 142 | ||
143 | mutex_lock(&shm_ids.mutex); | 143 | mutex_lock(&shm_ids.mutex); |
144 | /* remove from the list of attaches of the shm segment */ | 144 | /* remove from the list of attaches of the shm segment */ |
145 | if(!(shp = shm_lock(id))) | 145 | shp = shm_lock(id); |
146 | BUG(); | 146 | BUG_ON(!shp); |
147 | shp->shm_lprid = current->tgid; | 147 | shp->shm_lprid = current->tgid; |
148 | shp->shm_dtim = get_seconds(); | 148 | shp->shm_dtim = get_seconds(); |
149 | shp->shm_nattch--; | 149 | shp->shm_nattch--; |
@@ -283,8 +283,7 @@ asmlinkage long sys_shmget (key_t key, size_t size, int shmflg) | |||
283 | err = -EEXIST; | 283 | err = -EEXIST; |
284 | } else { | 284 | } else { |
285 | shp = shm_lock(id); | 285 | shp = shm_lock(id); |
286 | if(shp==NULL) | 286 | BUG_ON(shp==NULL); |
287 | BUG(); | ||
288 | if (shp->shm_segsz < size) | 287 | if (shp->shm_segsz < size) |
289 | err = -EINVAL; | 288 | err = -EINVAL; |
290 | else if (ipcperms(&shp->shm_perm, shmflg)) | 289 | else if (ipcperms(&shp->shm_perm, shmflg)) |
@@ -774,8 +773,8 @@ invalid: | |||
774 | up_write(¤t->mm->mmap_sem); | 773 | up_write(¤t->mm->mmap_sem); |
775 | 774 | ||
776 | mutex_lock(&shm_ids.mutex); | 775 | mutex_lock(&shm_ids.mutex); |
777 | if(!(shp = shm_lock(shmid))) | 776 | shp = shm_lock(shmid); |
778 | BUG(); | 777 | BUG_ON(!shp); |
779 | shp->shm_nattch--; | 778 | shp->shm_nattch--; |
780 | if(shp->shm_nattch == 0 && | 779 | if(shp->shm_nattch == 0 && |
781 | shp->shm_perm.mode & SHM_DEST) | 780 | shp->shm_perm.mode & SHM_DEST) |
diff --git a/ipc/util.c b/ipc/util.c index 23151ef32590..5e785a29e1e6 100644 --- a/ipc/util.c +++ b/ipc/util.c | |||
@@ -266,8 +266,7 @@ struct kern_ipc_perm* ipc_rmid(struct ipc_ids* ids, int id) | |||
266 | { | 266 | { |
267 | struct kern_ipc_perm* p; | 267 | struct kern_ipc_perm* p; |
268 | int lid = id % SEQ_MULTIPLIER; | 268 | int lid = id % SEQ_MULTIPLIER; |
269 | if(lid >= ids->entries->size) | 269 | BUG_ON(lid >= ids->entries->size); |
270 | BUG(); | ||
271 | 270 | ||
272 | /* | 271 | /* |
273 | * do not need a rcu_dereference()() here to force ordering | 272 | * do not need a rcu_dereference()() here to force ordering |
@@ -275,8 +274,7 @@ struct kern_ipc_perm* ipc_rmid(struct ipc_ids* ids, int id) | |||
275 | */ | 274 | */ |
276 | p = ids->entries->p[lid]; | 275 | p = ids->entries->p[lid]; |
277 | ids->entries->p[lid] = NULL; | 276 | ids->entries->p[lid] = NULL; |
278 | if(p==NULL) | 277 | BUG_ON(p==NULL); |
279 | BUG(); | ||
280 | ids->in_use--; | 278 | ids->in_use--; |
281 | 279 | ||
282 | if (lid == ids->max_id) { | 280 | if (lid == ids->max_id) { |