Skip to content

Commit

Permalink
CRISv10: remove redundant tests on unsigned
Browse files Browse the repository at this point in the history
Since dmanr is unsigned, negatives are wrapped and caught by the other test.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Acked-by: Jesper Nilsson <jesper.nilsson@axis.com>
  • Loading branch information
Roel Kluin authored and Jesper Nilsson committed Jun 23, 2009
1 parent 768c314 commit 7b99483
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arch/cris/arch-v10/kernel/dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ int cris_request_dma(unsigned int dmanr, const char * device_id,
unsigned long int gens;
int fail = -EINVAL;

if ((dmanr < 0) || (dmanr >= MAX_DMA_CHANNELS)) {
if (dmanr >= MAX_DMA_CHANNELS) {
printk(KERN_CRIT "cris_request_dma: invalid DMA channel %u\n", dmanr);
return -EINVAL;
}
Expand Down Expand Up @@ -213,7 +213,7 @@ int cris_request_dma(unsigned int dmanr, const char * device_id,
void cris_free_dma(unsigned int dmanr, const char * device_id)
{
unsigned long flags;
if ((dmanr < 0) || (dmanr >= MAX_DMA_CHANNELS)) {
if (dmanr >= MAX_DMA_CHANNELS) {
printk(KERN_CRIT "cris_free_dma: invalid DMA channel %u\n", dmanr);
return;
}
Expand Down

0 comments on commit 7b99483

Please sign in to comment.