libpsm2/libpsm2-gcc7.patch
2017-05-19 19:12:45 +00:00

64 lines
2.2 KiB
Diff

From 52aa214e81aeb5b998f83e7426a25a8697039e8e Mon Sep 17 00:00:00 2001
From: Aravind Gopalakrishnan <Aravind.Gopalakrishnan@intel.com>
Date: Wed, 12 Apr 2017 11:38:55 -0700
Subject: [PATCH] Fix build failures caught by gcc 7.x
This fixes build problems reported in Fedora BZ 1423872 .
Tested using mock build system against Fedora rawhide and seems to work fine.
Signed-off-by: Aravind Gopalakrishnan <Aravind.Gopalakrishnan@intel.com>
---
psm_ep.c | 10 +++++-----
ptl_ips/ips_recvhdrq.c | 2 +-
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/psm_ep.c b/psm_ep.c
index 00149a5..2b1ebee 100644
--- a/psm_ep.c
+++ b/psm_ep.c
@@ -922,7 +922,7 @@ __psm2_ep_open(psm2_uuid_t const unique_job_key,
int i, num_rails = 0;
char *uname = "HFI_UNIT";
char *pname = "HFI_PORT";
- char uvalue[4], pvalue[4];
+ char uvalue[6], pvalue[6];
int devid_enabled[PTL_MAX_INIT];
union psmi_envvar_val devs;
@@ -964,8 +964,8 @@ __psm2_ep_open(psm2_uuid_t const unique_job_key,
/* If multi-rail is used, set the first ep unit/port */
if (num_rails > 0) {
- snprintf(uvalue, 4, "%1d", units[0]);
- snprintf(pvalue, 4, "%1d", ports[0]);
+ snprintf(uvalue, 6, "%1d", units[0]);
+ snprintf(pvalue, 6, "%1d", ports[0]);
setenv(uname, uvalue, 1);
setenv(pname, pvalue, 1);
}
@@ -999,8 +999,8 @@ __psm2_ep_open(psm2_uuid_t const unique_job_key,
if (psmi_device_is_enabled(devid_enabled, PTL_DEVID_IPS)) {
for (i = 1; i < num_rails; i++) {
- snprintf(uvalue, 4, "%1d", units[i]);
- snprintf(pvalue, 4, "%1d", ports[i]);
+ snprintf(uvalue, 6, "%1d", units[i]);
+ snprintf(pvalue, 6, "%1d", ports[i]);
setenv(uname, uvalue, 1);
setenv(pname, pvalue, 1);
diff --git a/ptl_ips/ips_recvhdrq.c b/ptl_ips/ips_recvhdrq.c
index 7bd6557..4b2617f 100644
--- a/ptl_ips/ips_recvhdrq.c
+++ b/ptl_ips/ips_recvhdrq.c
@@ -825,7 +825,7 @@ psm2_error_t ips_recvhdrq_scan_cca (struct ips_recvhdrq *recvq)
&ctrlscb, ctrlscb.cksum, 0);
}
}
- else if_pt (_is_cca_becn_set(rcv_ev.p_hdr) << (IPS_RECV_EVENT_BECN - 1) ) {
+ else if_pt (0 != (_is_cca_becn_set(rcv_ev.p_hdr) << (IPS_RECV_EVENT_BECN - 1))) {
struct ips_epstate_entry *epstaddr = ips_epstate_lookup(recvq->epstate,
rcv_ev.p_hdr->connidx);