From: Axel Lin Date: Mon, 24 Feb 2014 13:04:30 +0000 (+0800) Subject: NFC: Remove redundant test for dev->n_targets in nfc_find_target X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=365a721adbdfe5f6577a66b9b74c12dc98fbb4a3;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git NFC: Remove redundant test for dev->n_targets in nfc_find_target Without this test, it returns NULL if dev->n_targets is 0 anyway. Signed-off-by: Axel Lin Signed-off-by: Samuel Ortiz --- diff --git a/net/nfc/core.c b/net/nfc/core.c index ada92316f723..be5d50c6d81d 100644 --- a/net/nfc/core.c +++ b/net/nfc/core.c @@ -280,9 +280,6 @@ static struct nfc_target *nfc_find_target(struct nfc_dev *dev, u32 target_idx) { int i; - if (dev->n_targets == 0) - return NULL; - for (i = 0; i < dev->n_targets; i++) { if (dev->targets[i].idx == target_idx) return &dev->targets[i];