Skip to content

Commit

Permalink
FRV: BUG to BUG_ON changes
Browse files Browse the repository at this point in the history
Change some BUG()'s to BUG_ON()'s.

Signed-off-by: Stoyan Gaydarov <stoyboyker@gmail.com>
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Stoyan Gaydarov authored and Linus Torvalds committed Jun 11, 2009
1 parent d2f11bf commit db5c444
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 17 deletions.
7 changes: 2 additions & 5 deletions arch/frv/include/asm/pci.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,7 @@ static inline void pci_dma_sync_single(struct pci_dev *hwdev,
dma_addr_t dma_handle,
size_t size, int direction)
{
if (direction == PCI_DMA_NONE)
BUG();
BUG_ON(direction == PCI_DMA_NONE);

frv_cache_wback_inv((unsigned long)bus_to_virt(dma_handle),
(unsigned long)bus_to_virt(dma_handle) + size);
Expand All @@ -105,9 +104,7 @@ static inline void pci_dma_sync_sg(struct pci_dev *hwdev,
int nelems, int direction)
{
int i;

if (direction == PCI_DMA_NONE)
BUG();
BUG_ON(direction == PCI_DMA_NONE);

for (i = 0; i < nelems; i++)
frv_cache_wback_inv(sg_dma_address(&sg[i]),
Expand Down
6 changes: 2 additions & 4 deletions arch/frv/kernel/uaccess.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ long strncpy_from_user(char *dst, const char __user *src, long count)
char *p, ch;
long err = -EFAULT;

if (count < 0)
BUG();
BUG_ON(count < 0);

p = dst;

Expand Down Expand Up @@ -76,8 +75,7 @@ long strnlen_user(const char __user *src, long count)
long err = 0;
char ch;

if (count < 0)
BUG();
BUG_ON(count < 0);

#ifndef CONFIG_MMU
if ((unsigned long) src < memory_start)
Expand Down
6 changes: 2 additions & 4 deletions arch/frv/mb93090-mb00/pci-dma-nommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,7 @@ EXPORT_SYMBOL(dma_free_coherent);
dma_addr_t dma_map_single(struct device *dev, void *ptr, size_t size,
enum dma_data_direction direction)
{
if (direction == DMA_NONE)
BUG();
BUG_ON(direction == DMA_NONE);

frv_cache_wback_inv((unsigned long) ptr, (unsigned long) ptr + size);

Expand Down Expand Up @@ -151,8 +150,7 @@ int dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
frv_cache_wback_inv(sg_dma_address(&sg[i]),
sg_dma_address(&sg[i]) + sg_dma_len(&sg[i]));

if (direction == DMA_NONE)
BUG();
BUG_ON(direction == DMA_NONE);

return nents;
}
Expand Down
6 changes: 2 additions & 4 deletions arch/frv/mb93090-mb00/pci-dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@ EXPORT_SYMBOL(dma_free_coherent);
dma_addr_t dma_map_single(struct device *dev, void *ptr, size_t size,
enum dma_data_direction direction)
{
if (direction == DMA_NONE)
BUG();
BUG_ON(direction == DMA_NONE);

frv_cache_wback_inv((unsigned long) ptr, (unsigned long) ptr + size);

Expand Down Expand Up @@ -81,8 +80,7 @@ int dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
void *vaddr;
int i;

if (direction == DMA_NONE)
BUG();
BUG_ON(direction == DMA_NONE);

dampr2 = __get_DAMPR(2);

Expand Down

0 comments on commit db5c444

Please sign in to comment.