Commit e447d3588e1c5944f607083cb509663f8015d420
Committed by
Grant Likely
1 parent
079a176d87
Exists in
master
and in
7 other branches
spi/orion: Drop unnecessary null test
list_for_each_entry binds its first argument to a non-null value, and thus any null test on the value of that argument is superfluous. The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // <smpl> @@ iterator I; expression x,E; @@ I(x,...) { <... - (x != NULL) && E ...> } // </smpl> Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Showing 1 changed file with 2 additions and 2 deletions Side-by-side Diff
drivers/spi/orion_spi.c
... | ... | @@ -404,7 +404,7 @@ |
404 | 404 | goto msg_rejected; |
405 | 405 | } |
406 | 406 | |
407 | - if ((t != NULL) && t->bits_per_word) | |
407 | + if (t->bits_per_word) | |
408 | 408 | bits_per_word = t->bits_per_word; |
409 | 409 | |
410 | 410 | if ((bits_per_word != 8) && (bits_per_word != 16)) { |
... | ... | @@ -415,7 +415,7 @@ |
415 | 415 | goto msg_rejected; |
416 | 416 | } |
417 | 417 | /*make sure buffer length is even when working in 16 bit mode*/ |
418 | - if ((t != NULL) && (t->bits_per_word == 16) && (t->len & 1)) { | |
418 | + if ((t->bits_per_word == 16) && (t->len & 1)) { | |
419 | 419 | dev_err(&spi->dev, |
420 | 420 | "message rejected : " |
421 | 421 | "odd data length (%d) while in 16 bit mode\n", |