Remove comparisons which are not necessary.
Reported by: Coverity CID: 1237826, 1237844, 1237847 MFC after: 1 week