From: Wiktor Lawski Date: Wed, 19 Sep 2012 13:20:44 +0000 (+0200) Subject: nfctype1: Improve nfctype1_read readability X-Git-Tag: 0.7~30 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ff2553027cb10a62978bc8293828929b12aeb4bb;p=platform%2Fupstream%2Fneard.git nfctype1: Improve nfctype1_read readability WHEN either uid is NULL or uid_length is not equal to UID_LENGTH AND uid is not NULL, uid_length must to be NOT equal to UID_LENGTH, so additional conditional in if statement is not necessary. It will be always true. It is only harder to analyze function code. --- diff --git a/plugins/nfctype1.c b/plugins/nfctype1.c index 7fb4e0c..d7ba35e 100644 --- a/plugins/nfctype1.c +++ b/plugins/nfctype1.c @@ -412,7 +412,7 @@ static int nfctype1_read(uint32_t adapter_idx, uid = near_tag_get_nfcid(adapter_idx, target_idx, &uid_length); if (uid == NULL || uid_length != UID_LENGTH) { - if (uid != NULL && uid_length != UID_LENGTH) { + if (uid != NULL) { near_error("Invalid UID"); g_free(uid);