From 06fc1b203b7914912546a3b442ee2d510814065e Mon Sep 17 00:00:00 2001 From: Jacob Garber Date: Fri, 24 May 2019 17:53:05 -0600 Subject: common: Remove unnecessary null check supported_modes is an array of structs, and addresses of array elements cannot be null. BUG=none BRANCH=none TEST=none Change-Id: I1268e024ba8b2469d1bc70be27b3e98044a7ac04 Signed-off-by: Jacob Garber Found-by: Coverity CID 141742 Reviewed-on: https://chromium-review.googlesource.com/1629279 Legacy-Commit-Queue: Commit Bot Reviewed-by: Daisuke Nojiri --- common/usb_pd_policy.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/common/usb_pd_policy.c b/common/usb_pd_policy.c index 7675fe200b..ab512b81bd 100644 --- a/common/usb_pd_policy.c +++ b/common/usb_pd_policy.c @@ -417,9 +417,6 @@ int allocate_mode(int port, uint16_t svid) /* Allocate ... if SVID == 0 enter default supported policy */ for (i = 0; i < supported_modes_cnt; i++) { - if (!&supported_modes[i]) - continue; - for (j = 0; j < pe[port].svid_cnt; j++) { struct svdm_svid_data *svidp = &pe[port].svids[j]; if ((svidp->svid != supported_modes[i].svid) || -- cgit v1.2.1