[OPAE] [PATCH 1/3] pcie: Fix missing braces around feature_is_UAFU()
Jia Zhang <zhang.jia at linux.alibaba.com> Wed, 04 Apr 2018 13:11:42 +0800
| Newsgroups | dev.linux.lists.opae |
|---|---|
| Message-ID | <[email protected]> |
--===============4120221381671820542==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
This commit resolves the following build warning.
opae-intel-fpga-driver/drivers/fpga/intel/pcie.c: In function =E2=80=98pars=
e_feature_afus=E2=80=99:
opae-intel-fpga-driver/drivers/fpga/intel/pcie.c:886:3: warning: this =E2=
=80=98if=E2=80=99 clause does not guard... [-Wmisleading-indentation]
if (feature_is_UAFU(binfo))
^~
opae-intel-fpga-driver/drivers/fpga/intel/pcie.c:888:4: note: ...this state=
ment, but the latter is misleadingly indented as if it were guarded by the =
=E2=80=98if=E2=80=99
if (ret)
^~
Assuming a non-AFU feature is enumerated, it might be wrongly handled
and then causes parse_feature_afus() returns an error.
Signed-off-by: Jia Zhang <zhang.jia(a)linux.alibaba.com>
---
drivers/fpga/intel/pcie.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/fpga/intel/pcie.c b/drivers/fpga/intel/pcie.c
index f4f3d70..a84d8a0 100644
--- a/drivers/fpga/intel/pcie.c
+++ b/drivers/fpga/intel/pcie.c
@@ -883,10 +883,11 @@ static int parse_feature_afus(struct build_feature_de=
vs_info *binfo,
afu_hdr =3D (struct feature_afu_header *) (hdr + 1);
header.csr =3D readq(&afu_hdr->csr);
=
- if (feature_is_UAFU(binfo))
+ if (feature_is_UAFU(binfo)) {
ret =3D parse_feature_port_uafu(binfo, hdr);
if (ret)
return ret;
+ }
=
if (!header.next_afu)
break;
-- =
2.12.2
--===============4120221381671820542==--