提交 365a721a 编写于 作者: A Axel Lin 提交者: Samuel Ortiz

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: NAxel Lin <axel.lin@ingics.com>
Signed-off-by: NSamuel Ortiz <sameo@linux.intel.com>
上级 7ebb88e5
...@@ -280,9 +280,6 @@ static struct nfc_target *nfc_find_target(struct nfc_dev *dev, u32 target_idx) ...@@ -280,9 +280,6 @@ static struct nfc_target *nfc_find_target(struct nfc_dev *dev, u32 target_idx)
{ {
int i; int i;
if (dev->n_targets == 0)
return NULL;
for (i = 0; i < dev->n_targets; i++) { for (i = 0; i < dev->n_targets; i++) {
if (dev->targets[i].idx == target_idx) if (dev->targets[i].idx == target_idx)
return &dev->targets[i]; return &dev->targets[i];
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册