* [PATCH 01/32] libibumad: include umad_str.h in umad_str.c
[not found] ` <1476381095-20041-1-git-send-email-hch-jcswGhMUV9g@public.gmane.org>
@ 2016-10-13 17:51 ` Christoph Hellwig
[not found] ` <1476381095-20041-2-git-send-email-hch-jcswGhMUV9g@public.gmane.org>
2016-10-13 17:51 ` [PATCH 02/32] libibumad: create sysfs.h instead of using extern declarations in umad.c Christoph Hellwig
` (15 subsequent siblings)
16 siblings, 1 reply; 40+ messages in thread
From: Christoph Hellwig @ 2016-10-13 17:51 UTC (permalink / raw)
To: linux-rdma-u79uwXL29TY76Z2rM5mHXA
So that we have the prototypes available in the implementation file
and do get proper type checking for them.
Signed-off-by: Christoph Hellwig <hch-jcswGhMUV9g@public.gmane.org>
---
libibumad/umad_str.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/libibumad/umad_str.c b/libibumad/umad_str.c
index 79d51af..d4832e1 100644
--- a/libibumad/umad_str.c
+++ b/libibumad/umad_str.c
@@ -40,6 +40,7 @@
#include <infiniband/umad_sm.h>
#include <infiniband/umad_sa.h>
#include <infiniband/umad_cm.h>
+#include "umad_str.h"
const char * umad_class_str(uint8_t mgmt_class)
{
--
2.1.4
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 40+ messages in thread
* [PATCH 02/32] libibumad: create sysfs.h instead of using extern declarations in umad.c
[not found] ` <1476381095-20041-1-git-send-email-hch-jcswGhMUV9g@public.gmane.org>
2016-10-13 17:51 ` [PATCH 01/32] libibumad: include umad_str.h in umad_str.c Christoph Hellwig
@ 2016-10-13 17:51 ` Christoph Hellwig
[not found] ` <1476381095-20041-3-git-send-email-hch-jcswGhMUV9g@public.gmane.org>
2016-10-13 17:51 ` [PATCH 03/32] libibumad: use NULL instead of 0 for NULL pointers Christoph Hellwig
` (14 subsequent siblings)
16 siblings, 1 reply; 40+ messages in thread
From: Christoph Hellwig @ 2016-10-13 17:51 UTC (permalink / raw)
To: linux-rdma-u79uwXL29TY76Z2rM5mHXA
So that we have the prototypes available in the implementation file
and do get proper type checking for them.
Signed-off-by: Christoph Hellwig <hch-jcswGhMUV9g@public.gmane.org>
---
libibumad/sysfs.c | 1 +
libibumad/sysfs.h | 10 ++++++++++
libibumad/umad.c | 7 +------
3 files changed, 12 insertions(+), 6 deletions(-)
create mode 100644 libibumad/sysfs.h
diff --git a/libibumad/sysfs.c b/libibumad/sysfs.c
index 011e411..83f89b4 100644
--- a/libibumad/sysfs.c
+++ b/libibumad/sysfs.c
@@ -44,6 +44,7 @@
#include <byteswap.h>
#include <netinet/in.h>
#include <infiniband/arch.h>
+#include "sysfs.h"
static int ret_code(void)
{
diff --git a/libibumad/sysfs.h b/libibumad/sysfs.h
new file mode 100644
index 0000000..7f8cbfe
--- /dev/null
+++ b/libibumad/sysfs.h
@@ -0,0 +1,10 @@
+#ifndef _UMAD_SYSFS_H
+#define _UMAD_SYSFS_H
+
+extern int sys_read_string(const char *dir_name, const char *file_name, char *str, int len);
+extern int sys_read_guid(const char *dir_name, const char *file_name, uint64_t * net_guid);
+extern int sys_read_gid(const char *dir_name, const char *file_name, uint8_t * gid);
+extern int sys_read_uint64(const char *dir_name, const char *file_name, uint64_t * u);
+extern int sys_read_uint(const char *dir_name, const char *file_name, unsigned *u);
+
+#endif /* _UMAD_SYSFS_H */
diff --git a/libibumad/umad.c b/libibumad/umad.c
index 0c969f1..8860b99 100644
--- a/libibumad/umad.c
+++ b/libibumad/umad.c
@@ -53,6 +53,7 @@
#define IB_OPENIB_OUI (0x001405)
#include <valgrind/memcheck.h>
+#include "sysfs.h"
typedef struct ib_user_mad_reg_req {
uint32_t id;
@@ -77,12 +78,6 @@ struct ib_user_mad_reg_req2 {
uint8_t reserved[3];
};
-extern int sys_read_string(const char *dir_name, const char *file_name, char *str, int len);
-extern int sys_read_guid(const char *dir_name, const char *file_name, uint64_t * net_guid);
-extern int sys_read_gid(const char *dir_name, const char *file_name, uint8_t * gid);
-extern int sys_read_uint64(const char *dir_name, const char *file_name, uint64_t * u);
-extern int sys_read_uint(const char *dir_name, const char *file_name, unsigned *u);
-
#define IBWARN(fmt, args...) fprintf(stderr, "ibwarn: [%d] %s: " fmt "\n", getpid(), __func__, ## args)
#define TRACE if (umaddebug) IBWARN
--
2.1.4
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 40+ messages in thread
* [PATCH 03/32] libibumad: use NULL instead of 0 for NULL pointers
[not found] ` <1476381095-20041-1-git-send-email-hch-jcswGhMUV9g@public.gmane.org>
2016-10-13 17:51 ` [PATCH 01/32] libibumad: include umad_str.h in umad_str.c Christoph Hellwig
2016-10-13 17:51 ` [PATCH 02/32] libibumad: create sysfs.h instead of using extern declarations in umad.c Christoph Hellwig
@ 2016-10-13 17:51 ` Christoph Hellwig
[not found] ` <1476381095-20041-4-git-send-email-hch-jcswGhMUV9g@public.gmane.org>
2016-10-13 17:51 ` [PATCH 04/32] libibumad: mark symbols as static where possible Christoph Hellwig
` (13 subsequent siblings)
16 siblings, 1 reply; 40+ messages in thread
From: Christoph Hellwig @ 2016-10-13 17:51 UTC (permalink / raw)
To: linux-rdma-u79uwXL29TY76Z2rM5mHXA
Signed-off-by: Christoph Hellwig <hch-jcswGhMUV9g@public.gmane.org>
---
libibumad/sysfs.c | 8 ++++----
libibumad/umad.c | 17 +++++++++--------
2 files changed, 13 insertions(+), 12 deletions(-)
diff --git a/libibumad/sysfs.c b/libibumad/sysfs.c
index 83f89b4..730374d 100644
--- a/libibumad/sysfs.c
+++ b/libibumad/sysfs.c
@@ -95,7 +95,7 @@ int sys_read_guid(const char *dir_name, const char *file_name, uint64_t * net_gu
for (s = buf, i = 0; i < 4; i++) {
if (!(str = strsep(&s, ": \t\n")))
return -EINVAL;
- guid = (guid << 16) | (strtoul(str, 0, 16) & 0xffff);
+ guid = (guid << 16) | (strtoul(str, NULL, 16) & 0xffff);
}
*net_guid = htonll(guid);
@@ -115,7 +115,7 @@ int sys_read_gid(const char *dir_name, const char *file_name, uint8_t * gid)
for (s = buf, i = 0; i < 8; i++) {
if (!(str = strsep(&s, ": \t\n")))
return -EINVAL;
- ugid[i] = htons(strtoul(str, 0, 16) & 0xffff);
+ ugid[i] = htons(strtoul(str, NULL, 16) & 0xffff);
}
return 0;
@@ -129,7 +129,7 @@ int sys_read_uint64(const char *dir_name, const char *file_name, uint64_t * u)
if ((r = sys_read_string(dir_name, file_name, buf, sizeof(buf))) < 0)
return r;
- *u = strtoull(buf, 0, 0);
+ *u = strtoull(buf, NULL, 0);
return 0;
}
@@ -142,7 +142,7 @@ int sys_read_uint(const char *dir_name, const char *file_name, unsigned *u)
if ((r = sys_read_string(dir_name, file_name, buf, sizeof(buf))) < 0)
return r;
- *u = strtoul(buf, 0, 0);
+ *u = strtoul(buf, NULL, 0);
return 0;
}
diff --git a/libibumad/umad.c b/libibumad/umad.c
index 8860b99..c1b7338 100644
--- a/libibumad/umad.c
+++ b/libibumad/umad.c
@@ -215,7 +215,7 @@ static int release_ca(umad_ca_t * ca)
continue;
release_port(ca->ports[i]);
free(ca->ports[i]);
- ca->ports[i] = 0;
+ ca->ports[i] = NULL;
}
return 0;
}
@@ -320,13 +320,13 @@ static const char *resolve_ca_name(const char *ca_name, int *best_port)
if (ca_name) {
if (resolve_ca_port(ca_name, best_port) < 0)
- return 0;
+ return NULL;
return ca_name;
}
/* Get the list of CA names */
if ((n = umad_get_cas_names((void *)names, UMAD_MAX_DEVICES)) < 0)
- return 0;
+ return NULL;
/* Find the first existing CA with an active port */
for (caidx = 0; caidx < n; caidx++) {
@@ -354,7 +354,8 @@ static const char *resolve_ca_name(const char *ca_name, int *best_port)
}
DEBUG("phys found %d on %s port %d",
- phys_found, phys_found >= 0 ? names[phys_found] : 0, port_found);
+ phys_found, phys_found >= 0 ? names[phys_found] : NULL,
+ port_found);
if (phys_found >= 0) {
if (best_port)
*best_port = port_found;
@@ -404,7 +405,7 @@ static int get_ca(const char *ca_name, umad_ca_t * ca)
if (!(dir = opendir(dir_name)))
return -ENOENT;
- if ((r = scandir(dir_name, &namelist, 0, alphasort)) < 0) {
+ if ((r = scandir(dir_name, &namelist, NULL, alphasort)) < 0) {
ret = errno < 0 ? errno : -EIO;
goto error;
}
@@ -544,7 +545,7 @@ int umad_get_cas_names(char cas[][UMAD_CA_NAME_LEN], int max)
TRACE("max %d", max);
- n = scandir(SYS_INFINIBAND, &namelist, 0, alphasort);
+ n = scandir(SYS_INFINIBAND, &namelist, NULL, alphasort);
if (n > 0) {
for (i = 0; i < n; i++) {
if (strcmp(namelist[i]->d_name, ".") &&
@@ -573,7 +574,7 @@ int umad_get_ca_portguids(const char *ca_name, uint64_t * portguids, int max)
int ports = 0, i;
TRACE("ca name %s max port guids %d", ca_name, max);
- if (!(ca_name = resolve_ca_name(ca_name, 0)))
+ if (!(ca_name = resolve_ca_name(ca_name, NULL)))
return -ENODEV;
if (umad_get_ca(ca_name, &ca) < 0)
@@ -650,7 +651,7 @@ int umad_get_ca(const char *ca_name, umad_ca_t * ca)
int r;
TRACE("ca_name %s", ca_name);
- if (!(ca_name = resolve_ca_name(ca_name, 0)))
+ if (!(ca_name = resolve_ca_name(ca_name, NULL)))
return -ENODEV;
if (find_cached_ca(ca_name, ca) > 0)
--
2.1.4
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 40+ messages in thread
* [PATCH 04/32] libibumad: mark symbols as static where possible
[not found] ` <1476381095-20041-1-git-send-email-hch-jcswGhMUV9g@public.gmane.org>
` (2 preceding siblings ...)
2016-10-13 17:51 ` [PATCH 03/32] libibumad: use NULL instead of 0 for NULL pointers Christoph Hellwig
@ 2016-10-13 17:51 ` Christoph Hellwig
[not found] ` <1476381095-20041-5-git-send-email-hch-jcswGhMUV9g@public.gmane.org>
2016-10-13 17:51 ` [PATCH 05/32] srp_daemon: use NULL instead of 0 for NULL pointers Christoph Hellwig
` (12 subsequent siblings)
16 siblings, 1 reply; 40+ messages in thread
From: Christoph Hellwig @ 2016-10-13 17:51 UTC (permalink / raw)
To: linux-rdma-u79uwXL29TY76Z2rM5mHXA
Signed-off-by: Christoph Hellwig <hch-jcswGhMUV9g@public.gmane.org>
---
libibumad/tests/umad_reg2_compat.c | 10 +++++-----
libibumad/tests/umad_register2.c | 12 ++++++------
libibumad/umad.c | 2 +-
3 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/libibumad/tests/umad_reg2_compat.c b/libibumad/tests/umad_reg2_compat.c
index 264882c..9224372 100644
--- a/libibumad/tests/umad_reg2_compat.c
+++ b/libibumad/tests/umad_reg2_compat.c
@@ -42,7 +42,7 @@
#define UNLIKELY_MGMT_CLASS 0x2F
#define UNLIKELY_RMPP_MGMT_CLASS 0x4F
-int test_failures = 0;
+static int test_failures = 0;
/** =========================================================================
* Stolen from OpenSM's register
@@ -69,7 +69,7 @@ static void set_bit64(int b, uint64_t *buf)
*addr |= mask;
}
-void dump_reg_attr(struct umad_reg_attr *reg_attr)
+static void dump_reg_attr(struct umad_reg_attr *reg_attr)
{
printf("\nmgmt_class %u\n"
"mgmt_class_version %u\n"
@@ -85,7 +85,7 @@ void dump_reg_attr(struct umad_reg_attr *reg_attr)
reg_attr->rmpp_version);
}
-int open_test_device(void)
+static int open_test_device(void)
{
int fd = umad_open_port(NULL, 0);
if (fd < 0) {
@@ -96,7 +96,7 @@ int open_test_device(void)
return fd;
}
-void test_register(void)
+static void test_register(void)
{
int agent_id;
long method_mask[16 / sizeof(long)];
@@ -147,7 +147,7 @@ void test_register(void)
}
-void test_fall_back(void)
+static void test_fall_back(void)
{
int rc = 0;
struct umad_reg_attr reg_attr;
diff --git a/libibumad/tests/umad_register2.c b/libibumad/tests/umad_register2.c
index 7a9b655..477bd29 100644
--- a/libibumad/tests/umad_register2.c
+++ b/libibumad/tests/umad_register2.c
@@ -57,9 +57,9 @@ struct ib_user_mad_reg_req2 {
uint8_t reserved[3];
};
-int test_failures = 0;
+static int test_failures = 0;
-void dump_reg_attr(struct umad_reg_attr *reg_attr)
+static void dump_reg_attr(struct umad_reg_attr *reg_attr)
{
printf("\nmgmt_class %u\n"
"mgmt_class_version %u\n"
@@ -75,7 +75,7 @@ void dump_reg_attr(struct umad_reg_attr *reg_attr)
reg_attr->rmpp_version);
}
-int open_test_device(void)
+static int open_test_device(void)
{
int fd = umad_open_port(NULL, 0);
if (fd < 0) {
@@ -86,7 +86,7 @@ int open_test_device(void)
return fd;
}
-void test_fail(void)
+static void test_fail(void)
{
int rc = 0;
struct umad_reg_attr reg_attr;
@@ -194,7 +194,7 @@ out:
printf("\n *****\nEnd invalid tests\n");
}
-void test_oui(void)
+static void test_oui(void)
{
int rc = 0;
struct umad_reg_attr reg_attr;
@@ -251,7 +251,7 @@ out:
printf("\n End valid oui tests\n *****\n");
}
-void check_register2_support(void)
+static void check_register2_support(void)
{
struct ib_user_mad_reg_req2 req;
int fd;
diff --git a/libibumad/umad.c b/libibumad/umad.c
index c1b7338..1ac2948 100644
--- a/libibumad/umad.c
+++ b/libibumad/umad.c
@@ -83,7 +83,7 @@ struct ib_user_mad_reg_req2 {
#define TRACE if (umaddebug) IBWARN
#define DEBUG if (umaddebug) IBWARN
-int umaddebug = 0;
+static int umaddebug = 0;
#define UMAD_DEV_FILE_SZ 256
--
2.1.4
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 40+ messages in thread
* [PATCH 05/32] srp_daemon: use NULL instead of 0 for NULL pointers
[not found] ` <1476381095-20041-1-git-send-email-hch-jcswGhMUV9g@public.gmane.org>
` (3 preceding siblings ...)
2016-10-13 17:51 ` [PATCH 04/32] libibumad: mark symbols as static where possible Christoph Hellwig
@ 2016-10-13 17:51 ` Christoph Hellwig
[not found] ` <1476381095-20041-6-git-send-email-hch-jcswGhMUV9g@public.gmane.org>
2016-10-13 17:51 ` [PATCH 06/32] srp_daemon: mark symbols as static where possible Christoph Hellwig
` (11 subsequent siblings)
16 siblings, 1 reply; 40+ messages in thread
From: Christoph Hellwig @ 2016-10-13 17:51 UTC (permalink / raw)
To: linux-rdma-u79uwXL29TY76Z2rM5mHXA
Signed-off-by: Christoph Hellwig <hch-jcswGhMUV9g@public.gmane.org>
---
srp_daemon/srp_daemon.c | 34 +++++++++++++++++-----------------
1 file changed, 17 insertions(+), 17 deletions(-)
diff --git a/srp_daemon/srp_daemon.c b/srp_daemon/srp_daemon.c
index f16674d..2317508 100644
--- a/srp_daemon/srp_daemon.c
+++ b/srp_daemon/srp_daemon.c
@@ -189,7 +189,7 @@ int srpd_sys_read_gid(char *dir_name, char *file_name, uint8_t *gid)
for (s = buf, i = 0 ; i < 8; i++) {
if (!(str = strsep(&s, ": \t\n")))
return -EINVAL;
- ugid[i] = htons(strtoul(str, 0, 16) & 0xffff);
+ ugid[i] = htons(strtoul(str, NULL, 16) & 0xffff);
}
return 0;
@@ -203,7 +203,7 @@ int srpd_sys_read_uint64(char *dir_name, char *file_name, uint64_t *u)
if ((r = srpd_sys_read_string(dir_name, file_name, buf, sizeof(buf))) < 0)
return r;
- *u = strtoull(buf, 0, 0);
+ *u = strtoull(buf, NULL, 0);
return 0;
}
@@ -356,36 +356,36 @@ int is_enabled_by_rules_file(struct target_details *target)
do {
rule++;
if (conf->rules[rule].id_ext[0] != '\0' &&
- strtoull(target->id_ext, 0, 16) !=
- strtoull(conf->rules[rule].id_ext, 0, 16))
+ strtoull(target->id_ext, NULL, 16) !=
+ strtoull(conf->rules[rule].id_ext, NULL, 16))
continue;
if (conf->rules[rule].ioc_guid[0] != '\0' &&
ntohll(target->ioc_prof.guid) !=
- strtoull(conf->rules[rule].ioc_guid, 0, 16))
+ strtoull(conf->rules[rule].ioc_guid, NULL, 16))
continue;
if (conf->rules[rule].dgid[0] != '\0') {
char tmp = conf->rules[rule].dgid[16];
conf->rules[rule].dgid[16] = '\0';
- if (strtoull(conf->rules[rule].dgid, 0, 16) !=
+ if (strtoull(conf->rules[rule].dgid, NULL, 16) !=
target->subnet_prefix) {
conf->rules[rule].dgid[16] = tmp;
continue;
}
conf->rules[rule].dgid[16] = tmp;
- if (strtoull(&conf->rules[rule].dgid[16], 0, 16) !=
+ if (strtoull(&conf->rules[rule].dgid[16], NULL, 16) !=
target->h_guid)
continue;
}
if (conf->rules[rule].service_id[0] != '\0' &&
- strtoull(conf->rules[rule].service_id, 0, 16) !=
+ strtoull(conf->rules[rule].service_id, NULL, 16) !=
target->h_service_id)
continue;
if (conf->rules[rule].pkey[0] != '\0' &&
- (uint16_t)strtoul(conf->rules[rule].pkey, 0, 16) !=
+ (uint16_t)strtoul(conf->rules[rule].pkey, NULL, 16) !=
target->pkey)
continue;
@@ -436,7 +436,7 @@ static int add_non_exist_target(struct target_details *target)
strncpy(subdir_name_ptr, subdir->d_name,
MAX_SCSI_HOST_DIR_NAME_LENGTH - prefix_len);
if (!check_equal_uint64(scsi_host_dir, "id_ext",
- strtoull(target->id_ext, 0, 16)))
+ strtoull(target->id_ext, NULL, 16)))
continue;
if (!check_equal_uint16(scsi_host_dir, "pkey", target->pkey) &&
!config->execute)
@@ -1795,7 +1795,7 @@ static int umad_resources_create(struct umad_resources *umad_res)
umad_res->agent = umad_register(umad_res->portid, SRP_MGMT_CLASS_SA,
SRP_MGMT_CLASS_SA_VERSION,
- SRP_SA_RMPP_VERSION, 0);
+ SRP_SA_RMPP_VERSION, NULL);
if (umad_res->agent < 0) {
pr_err("umad_register failed\n");
return umad_res->agent;
@@ -2064,9 +2064,9 @@ int main(int argc, char *argv[])
memset(&sa, 0, sizeof(sa));
sigemptyset(&sa.sa_mask);
sa.sa_handler = signal_handler;
- sigaction(SIGINT, &sa, 0);
- sigaction(SIGTERM, &sa, 0);
- sigaction(SRP_CATAS_ERR, &sa, 0);
+ sigaction(SIGINT, &sa, NULL);
+ sigaction(SIGTERM, &sa, NULL);
+ sigaction(SRP_CATAS_ERR, &sa, NULL);
if (strcmp(argv[0] + max_t(int, 0, strlen(argv[0]) - strlen("ibsrpdm")),
"ibsrpdm") == 0) {
@@ -2268,9 +2268,9 @@ close_log:
closelog();
restore_sig:
sa.sa_handler = SIG_DFL;
- sigaction(SIGINT, &sa, 0);
- sigaction(SIGTERM, &sa, 0);
- sigaction(SRP_CATAS_ERR, &sa, 0);
+ sigaction(SIGINT, &sa, NULL);
+ sigaction(SIGTERM, &sa, NULL);
+ sigaction(SRP_CATAS_ERR, &sa, NULL);
close_pipe:
close(wakeup_pipe[1]);
close(wakeup_pipe[0]);
--
2.1.4
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 40+ messages in thread
* [PATCH 06/32] srp_daemon: mark symbols as static where possible
[not found] ` <1476381095-20041-1-git-send-email-hch-jcswGhMUV9g@public.gmane.org>
` (4 preceding siblings ...)
2016-10-13 17:51 ` [PATCH 05/32] srp_daemon: use NULL instead of 0 for NULL pointers Christoph Hellwig
@ 2016-10-13 17:51 ` Christoph Hellwig
[not found] ` <1476381095-20041-7-git-send-email-hch-jcswGhMUV9g@public.gmane.org>
2016-10-13 17:51 ` [PATCH 07/32] srp_daemon: give initialize_sysfs a proper ANSI-C prototype Christoph Hellwig
` (10 subsequent siblings)
16 siblings, 1 reply; 40+ messages in thread
From: Christoph Hellwig @ 2016-10-13 17:51 UTC (permalink / raw)
To: linux-rdma-u79uwXL29TY76Z2rM5mHXA
Signed-off-by: Christoph Hellwig <hch-jcswGhMUV9g@public.gmane.org>
---
srp_daemon/srp_daemon.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/srp_daemon/srp_daemon.c b/srp_daemon/srp_daemon.c
index 2317508..f0f05cf 100644
--- a/srp_daemon/srp_daemon.c
+++ b/srp_daemon/srp_daemon.c
@@ -151,7 +151,7 @@ static int check_process_uniqueness(struct config_t *conf)
return fd;
}
-int srpd_sys_read_string(const char *dir_name, const char *file_name,
+static int srpd_sys_read_string(const char *dir_name, const char *file_name,
char *str, int max_len)
{
char path[256], *s;
@@ -177,7 +177,7 @@ int srpd_sys_read_string(const char *dir_name, const char *file_name,
return 0;
}
-int srpd_sys_read_gid(char *dir_name, char *file_name, uint8_t *gid)
+static int srpd_sys_read_gid(char *dir_name, char *file_name, uint8_t *gid)
{
char buf[64], *str, *s;
uint16_t *ugid = (uint16_t *)gid;
@@ -195,7 +195,7 @@ int srpd_sys_read_gid(char *dir_name, char *file_name, uint8_t *gid)
return 0;
}
-int srpd_sys_read_uint64(char *dir_name, char *file_name, uint64_t *u)
+static int srpd_sys_read_uint64(char *dir_name, char *file_name, uint64_t *u)
{
char buf[32];
int r;
@@ -257,7 +257,7 @@ check_equal_uint16(char *dir_name, char *attr, uint16_t val)
static int recalc(struct resources *res);
-void pr_cmd(char *target_str, int not_connected)
+static void pr_cmd(char *target_str, int not_connected)
{
int ret;
@@ -343,7 +343,7 @@ static int check_not_equal_int(char *dir_name, char *attr, int value)
return 0;
}
-int is_enabled_by_rules_file(struct target_details *target)
+static int is_enabled_by_rules_file(struct target_details *target)
{
int rule;
struct config_t *conf = config;
@@ -584,7 +584,7 @@ static int add_non_exist_target(struct target_details *target)
return 1;
}
-int send_and_get(int portid, int agent, srp_ib_user_mad_t *out_mad,
+static int send_and_get(int portid, int agent, srp_ib_user_mad_t *out_mad,
srp_ib_user_mad_t *in_mad, int in_mad_size)
{
struct srp_dm_mad *out_dm_mad = (void *) out_mad->hdr.data;
@@ -1804,7 +1804,7 @@ static int umad_resources_create(struct umad_resources *umad_res)
return 0;
}
-void *run_thread_retry_to_connect(void *res_in)
+static void *run_thread_retry_to_connect(void *res_in)
{
struct resources *res = (struct resources *)res_in;
struct target_details *target;
--
2.1.4
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 40+ messages in thread
* [PATCH 07/32] srp_daemon: give initialize_sysfs a proper ANSI-C prototype
[not found] ` <1476381095-20041-1-git-send-email-hch-jcswGhMUV9g@public.gmane.org>
` (5 preceding siblings ...)
2016-10-13 17:51 ` [PATCH 06/32] srp_daemon: mark symbols as static where possible Christoph Hellwig
@ 2016-10-13 17:51 ` Christoph Hellwig
[not found] ` <1476381095-20041-8-git-send-email-hch-jcswGhMUV9g@public.gmane.org>
2016-10-13 17:51 ` [PATCH 08/32] iwpmd: use proper ANSI-C prototypes for functions without arguments Christoph Hellwig
` (9 subsequent siblings)
16 siblings, 1 reply; 40+ messages in thread
From: Christoph Hellwig @ 2016-10-13 17:51 UTC (permalink / raw)
To: linux-rdma-u79uwXL29TY76Z2rM5mHXA
Signed-off-by: Christoph Hellwig <hch-jcswGhMUV9g@public.gmane.org>
---
srp_daemon/srp_daemon.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/srp_daemon/srp_daemon.c b/srp_daemon/srp_daemon.c
index f0f05cf..6cb22e4 100644
--- a/srp_daemon/srp_daemon.c
+++ b/srp_daemon/srp_daemon.c
@@ -647,7 +647,7 @@ recv:
return -1;
}
-static void initialize_sysfs()
+static void initialize_sysfs(void)
{
char *env;
--
2.1.4
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 40+ messages in thread
* [PATCH 08/32] iwpmd: use proper ANSI-C prototypes for functions without arguments
[not found] ` <1476381095-20041-1-git-send-email-hch-jcswGhMUV9g@public.gmane.org>
` (6 preceding siblings ...)
2016-10-13 17:51 ` [PATCH 07/32] srp_daemon: give initialize_sysfs a proper ANSI-C prototype Christoph Hellwig
@ 2016-10-13 17:51 ` Christoph Hellwig
[not found] ` <1476381095-20041-9-git-send-email-hch-jcswGhMUV9g@public.gmane.org>
2016-10-13 17:51 ` [PATCH 09/32] iwpmd: remove the unused check_iwpm_nlattr_tb prototype Christoph Hellwig
` (8 subsequent siblings)
16 siblings, 1 reply; 40+ messages in thread
From: Christoph Hellwig @ 2016-10-13 17:51 UTC (permalink / raw)
To: linux-rdma-u79uwXL29TY76Z2rM5mHXA
Signed-off-by: Christoph Hellwig <hch-jcswGhMUV9g@public.gmane.org>
---
iwpmd/iwarp_pm_common.c | 2 +-
iwpmd/iwarp_pm_server.c | 10 +++++-----
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/iwpmd/iwarp_pm_common.c b/iwpmd/iwarp_pm_common.c
index 3a885d8..aa6b4a0 100644
--- a/iwpmd/iwarp_pm_common.c
+++ b/iwpmd/iwarp_pm_common.c
@@ -212,7 +212,7 @@ create_socket_v6_exit:
/**
* create_netlink_socket - Create netlink socket for the iwarp port mapper
*/
-int create_netlink_socket()
+int create_netlink_socket(void)
{
sockaddr_union bind_addr;
struct sockaddr_nl *bind_nl;
diff --git a/iwpmd/iwarp_pm_server.c b/iwpmd/iwarp_pm_server.c
index deed3e7..89d3ee5 100644
--- a/iwpmd/iwarp_pm_server.c
+++ b/iwpmd/iwarp_pm_server.c
@@ -87,7 +87,7 @@ void iwpm_signal_handler(int signum)
/**
* iwpm_mapping_reqs_handler - Handle mapping requests timeouts and retries
*/
-void *iwpm_mapping_reqs_handler()
+void *iwpm_mapping_reqs_handler(void)
{
iwpm_mapping_request *iwpm_map_req, *next_map_req;
int ret = 0;
@@ -139,7 +139,7 @@ mapping_reqs_handler_exit:
/**
* iwpm_pending_msgs_handler - Handle sending iwarp port mapper wire messages
*/
-void *iwpm_pending_msgs_handler()
+void *iwpm_pending_msgs_handler(void)
{
iwpm_pending_msg *pending_msg;
iwpm_send_msg *send_msg;
@@ -1279,7 +1279,7 @@ static void iwpm_cleanup(void)
/**
* iwarp_port_mapper - Distribute work orders for processing different types of iwpm messages
*/
-static int iwarp_port_mapper()
+static int iwarp_port_mapper(void)
{
fd_set select_fdset; /* read fdset */
struct timeval select_timeout;
@@ -1355,8 +1355,8 @@ iwarp_port_mapper_exit:
/**
* daemonize_iwpm_server - Make iwarp port mapper a daemon process
- */
-static void daemonize_iwpm_server()
+ */
+static void daemonize_iwpm_server(void)
{
pid_t pid, sid;
--
2.1.4
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 40+ messages in thread
* [PATCH 09/32] iwpmd: remove the unused check_iwpm_nlattr_tb prototype
[not found] ` <1476381095-20041-1-git-send-email-hch-jcswGhMUV9g@public.gmane.org>
` (7 preceding siblings ...)
2016-10-13 17:51 ` [PATCH 08/32] iwpmd: use proper ANSI-C prototypes for functions without arguments Christoph Hellwig
@ 2016-10-13 17:51 ` Christoph Hellwig
[not found] ` <1476381095-20041-10-git-send-email-hch-jcswGhMUV9g@public.gmane.org>
2016-10-13 17:51 ` [PATCH 10/32] iwpmd: move external declarations to iwarp_pm.h Christoph Hellwig
` (7 subsequent siblings)
16 siblings, 1 reply; 40+ messages in thread
From: Christoph Hellwig @ 2016-10-13 17:51 UTC (permalink / raw)
To: linux-rdma-u79uwXL29TY76Z2rM5mHXA
Signed-off-by: Christoph Hellwig <hch-jcswGhMUV9g@public.gmane.org>
---
iwpmd/iwarp_pm.h | 2 --
1 file changed, 2 deletions(-)
diff --git a/iwpmd/iwarp_pm.h b/iwpmd/iwarp_pm.h
index 8b7eeb1..1a2b69a 100644
--- a/iwpmd/iwarp_pm.h
+++ b/iwpmd/iwarp_pm.h
@@ -209,8 +209,6 @@ int create_netlink_socket(void);
void destroy_iwpm_socket(int);
-int check_iwpm_nlattr_tb(struct nlattr * [], int);
-
int parse_iwpm_nlmsg(struct nlmsghdr *, int, struct nla_policy *, struct nlattr * [], const char *);
int parse_iwpm_msg(iwpm_wire_msg *, iwpm_msg_parms *);
--
2.1.4
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 40+ messages in thread
* [PATCH 10/32] iwpmd: move external declarations to iwarp_pm.h
[not found] ` <1476381095-20041-1-git-send-email-hch-jcswGhMUV9g@public.gmane.org>
` (8 preceding siblings ...)
2016-10-13 17:51 ` [PATCH 09/32] iwpmd: remove the unused check_iwpm_nlattr_tb prototype Christoph Hellwig
@ 2016-10-13 17:51 ` Christoph Hellwig
[not found] ` <1476381095-20041-11-git-send-email-hch-jcswGhMUV9g@public.gmane.org>
2016-10-13 17:51 ` [PATCH 11/32] iwpmd: mark symbols static where possible Christoph Hellwig
` (6 subsequent siblings)
16 siblings, 1 reply; 40+ messages in thread
From: Christoph Hellwig @ 2016-10-13 17:51 UTC (permalink / raw)
To: linux-rdma-u79uwXL29TY76Z2rM5mHXA
Signed-off-by: Christoph Hellwig <hch-jcswGhMUV9g@public.gmane.org>
---
iwpmd/iwarp_pm.h | 8 ++++++++
iwpmd/iwarp_pm_common.c | 2 --
iwpmd/iwarp_pm_helper.c | 6 ------
3 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/iwpmd/iwarp_pm.h b/iwpmd/iwarp_pm.h
index 1a2b69a..766e34f 100644
--- a/iwpmd/iwarp_pm.h
+++ b/iwpmd/iwarp_pm.h
@@ -277,4 +277,12 @@ void free_iwpm_mapped_ports(void);
extern struct list_head pending_messages;
extern struct list_head mapping_reqs;
+extern iwpm_client client_list[IWARP_PM_MAX_CLIENTS];
+
+extern pthread_cond_t cond_req_complete;
+extern pthread_mutex_t map_req_mutex;
+extern int wake;
+extern pthread_cond_t cond_pending_msg;
+extern pthread_mutex_t pending_msg_mutex;
+
#endif
diff --git a/iwpmd/iwarp_pm_common.c b/iwpmd/iwarp_pm_common.c
index aa6b4a0..b20a368 100644
--- a/iwpmd/iwarp_pm_common.c
+++ b/iwpmd/iwarp_pm_common.c
@@ -44,8 +44,6 @@ char * iwpm_param_names[IWPM_PARAM_NUM] =
int iwpm_param_vals[IWPM_PARAM_NUM] =
{ 0 };
-extern iwpm_client client_list[IWARP_PM_MAX_CLIENTS];
-
/**
* get_iwpm_param()
*/
diff --git a/iwpmd/iwarp_pm_helper.c b/iwpmd/iwarp_pm_helper.c
index 0b115c8..63530f1 100644
--- a/iwpmd/iwarp_pm_helper.c
+++ b/iwpmd/iwarp_pm_helper.c
@@ -35,12 +35,6 @@
static LIST_HEAD(mapped_ports); /* list of mapped ports */
-extern pthread_cond_t cond_req_complete;
-extern pthread_mutex_t map_req_mutex;
-extern int wake; /* set if map_req_thread is wake */
-extern pthread_cond_t cond_pending_msg;
-extern pthread_mutex_t pending_msg_mutex;
-
/**
* create_iwpm_map_request - Create a new map request tracking object
* @req_nlh: netlink header of the received client message
--
2.1.4
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 40+ messages in thread
* [PATCH 11/32] iwpmd: mark symbols static where possible
[not found] ` <1476381095-20041-1-git-send-email-hch-jcswGhMUV9g@public.gmane.org>
` (9 preceding siblings ...)
2016-10-13 17:51 ` [PATCH 10/32] iwpmd: move external declarations to iwarp_pm.h Christoph Hellwig
@ 2016-10-13 17:51 ` Christoph Hellwig
[not found] ` <1476381095-20041-12-git-send-email-hch-jcswGhMUV9g@public.gmane.org>
2016-10-13 17:51 ` [PATCH 12/32] iwpmd: fix the prototype for the pthread_create start functions Christoph Hellwig
` (5 subsequent siblings)
16 siblings, 1 reply; 40+ messages in thread
From: Christoph Hellwig @ 2016-10-13 17:51 UTC (permalink / raw)
To: linux-rdma-u79uwXL29TY76Z2rM5mHXA
Signed-off-by: Christoph Hellwig <hch-jcswGhMUV9g@public.gmane.org>
---
iwpmd/iwarp_pm_common.c | 6 +++---
iwpmd/iwarp_pm_server.c | 20 ++++++++++----------
2 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/iwpmd/iwarp_pm_common.c b/iwpmd/iwarp_pm_common.c
index b20a368..ee9d119 100644
--- a/iwpmd/iwarp_pm_common.c
+++ b/iwpmd/iwarp_pm_common.c
@@ -39,9 +39,9 @@
#endif
/* iwpm config params */
-char * iwpm_param_names[IWPM_PARAM_NUM] =
+static char * iwpm_param_names[IWPM_PARAM_NUM] =
{ "nl_sock_rbuf_size" };
-int iwpm_param_vals[IWPM_PARAM_NUM] =
+static int iwpm_param_vals[IWPM_PARAM_NUM] =
{ 0 };
/**
@@ -276,7 +276,7 @@ void destroy_iwpm_socket(int pm_sock)
/**
* check_iwpm_nlattr - Check for NULL netlink attribute
*/
-int check_iwpm_nlattr(struct nlattr *nltb[], int nla_count)
+static int check_iwpm_nlattr(struct nlattr *nltb[], int nla_count)
{
int i, ret = 0;
for (i = 1; i < nla_count; i++) {
diff --git a/iwpmd/iwarp_pm_server.c b/iwpmd/iwarp_pm_server.c
index 89d3ee5..b8ae3e3 100644
--- a/iwpmd/iwarp_pm_server.c
+++ b/iwpmd/iwarp_pm_server.c
@@ -34,34 +34,34 @@
#include "config.h"
#include "iwarp_pm.h"
-const char iwpm_ulib_name [] = "iWarpPortMapperUser";
-int iwpm_version = 3;
+static const char iwpm_ulib_name [] = "iWarpPortMapperUser";
+static int iwpm_version = 3;
LIST_HEAD(mapping_reqs); /* list of map tracking objects */
LIST_HEAD(pending_messages); /* list of pending wire messages */
iwpm_client client_list[IWARP_PM_MAX_CLIENTS];/* list of iwarp port mapper clients */
-int mapinfo_num_list[IWARP_PM_MAX_CLIENTS]; /* list of iwarp port mapper clients */
+static int mapinfo_num_list[IWARP_PM_MAX_CLIENTS]; /* list of iwarp port mapper clients */
/* socket handles */
static int pmv4_sock, pmv6_sock, netlink_sock, pmv4_client_sock, pmv6_client_sock;
-pthread_t map_req_thread; /* handling mapping requests timeout */
-pthread_cond_t cond_req_complete;
+static pthread_t map_req_thread; /* handling mapping requests timeout */
+pthread_cond_t cond_req_complete;
pthread_mutex_t map_req_mutex = PTHREAD_MUTEX_INITIALIZER;
int wake = 0; /* set if map_req_thread is wake */
-pthread_t pending_msg_thread; /* sending iwpm wire messages */
+static pthread_t pending_msg_thread; /* sending iwpm wire messages */
pthread_cond_t cond_pending_msg;
pthread_mutex_t pending_msg_mutex = PTHREAD_MUTEX_INITIALIZER;
static void iwpm_cleanup(void);
-int print_mappings = 0;
+static int print_mappings = 0;
/**
* iwpm_signal_handler - Handle signals which iwarp port mapper receives
* @signum: the number of the caught signal
*/
-void iwpm_signal_handler(int signum)
+static void iwpm_signal_handler(int signum)
{
switch(signum) {
case SIGHUP:
@@ -87,7 +87,7 @@ void iwpm_signal_handler(int signum)
/**
* iwpm_mapping_reqs_handler - Handle mapping requests timeouts and retries
*/
-void *iwpm_mapping_reqs_handler(void)
+static void *iwpm_mapping_reqs_handler(void)
{
iwpm_mapping_request *iwpm_map_req, *next_map_req;
int ret = 0;
@@ -139,7 +139,7 @@ mapping_reqs_handler_exit:
/**
* iwpm_pending_msgs_handler - Handle sending iwarp port mapper wire messages
*/
-void *iwpm_pending_msgs_handler(void)
+static void *iwpm_pending_msgs_handler(void)
{
iwpm_pending_msg *pending_msg;
iwpm_send_msg *send_msg;
--
2.1.4
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 40+ messages in thread
* [PATCH 12/32] iwpmd: fix the prototype for the pthread_create start functions
[not found] ` <1476381095-20041-1-git-send-email-hch-jcswGhMUV9g@public.gmane.org>
` (10 preceding siblings ...)
2016-10-13 17:51 ` [PATCH 11/32] iwpmd: mark symbols static where possible Christoph Hellwig
@ 2016-10-13 17:51 ` Christoph Hellwig
[not found] ` <1476381095-20041-13-git-send-email-hch-jcswGhMUV9g@public.gmane.org>
2016-10-13 17:51 ` [PATCH 13/32] librdmacm: mark symbols static where possible Christoph Hellwig
` (4 subsequent siblings)
16 siblings, 1 reply; 40+ messages in thread
From: Christoph Hellwig @ 2016-10-13 17:51 UTC (permalink / raw)
To: linux-rdma-u79uwXL29TY76Z2rM5mHXA
And also remove the unessecary taking of the address for function
arguments while we're at it.
Signed-off-by: Christoph Hellwig <hch-jcswGhMUV9g@public.gmane.org>
---
iwpmd/iwarp_pm_server.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/iwpmd/iwarp_pm_server.c b/iwpmd/iwarp_pm_server.c
index b8ae3e3..ab90c6c 100644
--- a/iwpmd/iwarp_pm_server.c
+++ b/iwpmd/iwarp_pm_server.c
@@ -87,7 +87,7 @@ static void iwpm_signal_handler(int signum)
/**
* iwpm_mapping_reqs_handler - Handle mapping requests timeouts and retries
*/
-static void *iwpm_mapping_reqs_handler(void)
+static void *iwpm_mapping_reqs_handler(void *unused)
{
iwpm_mapping_request *iwpm_map_req, *next_map_req;
int ret = 0;
@@ -139,7 +139,7 @@ mapping_reqs_handler_exit:
/**
* iwpm_pending_msgs_handler - Handle sending iwarp port mapper wire messages
*/
-static void *iwpm_pending_msgs_handler(void)
+static void *iwpm_pending_msgs_handler(void *unused)
{
iwpm_pending_msg *pending_msg;
iwpm_send_msg *send_msg;
@@ -1438,11 +1438,11 @@ int main(int argc, char *argv[])
pthread_cond_init(&cond_req_complete, NULL);
pthread_cond_init(&cond_pending_msg, NULL);
- ret = pthread_create(&map_req_thread, NULL, &iwpm_mapping_reqs_handler, NULL);
+ ret = pthread_create(&map_req_thread, NULL, iwpm_mapping_reqs_handler, NULL);
if (ret)
goto error_exit;
- ret = pthread_create(&pending_msg_thread, NULL, &iwpm_pending_msgs_handler, NULL);
+ ret = pthread_create(&pending_msg_thread, NULL, iwpm_pending_msgs_handler, NULL);
if (ret)
goto error_exit;
--
2.1.4
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 40+ messages in thread
* [PATCH 13/32] librdmacm: mark symbols static where possible
[not found] ` <1476381095-20041-1-git-send-email-hch-jcswGhMUV9g@public.gmane.org>
` (11 preceding siblings ...)
2016-10-13 17:51 ` [PATCH 12/32] iwpmd: fix the prototype for the pthread_create start functions Christoph Hellwig
@ 2016-10-13 17:51 ` Christoph Hellwig
2016-10-13 17:51 ` [PATCH 14/32] cxgb4: " Christoph Hellwig
` (3 subsequent siblings)
16 siblings, 0 replies; 40+ messages in thread
From: Christoph Hellwig @ 2016-10-13 17:51 UTC (permalink / raw)
To: linux-rdma-u79uwXL29TY76Z2rM5mHXA
Signed-off-by: Christoph Hellwig <hch-jcswGhMUV9g@public.gmane.org>
---
librdmacm/addrinfo.c | 2 +-
librdmacm/examples/rcopy.c | 4 ++--
librdmacm/examples/rdma_client.c | 10 +++++-----
librdmacm/examples/rdma_server.c | 10 +++++-----
librdmacm/examples/rdma_xclient.c | 10 +++++-----
librdmacm/examples/rdma_xserver.c | 10 +++++-----
librdmacm/rsocket.c | 2 +-
7 files changed, 24 insertions(+), 24 deletions(-)
diff --git a/librdmacm/addrinfo.c b/librdmacm/addrinfo.c
index 2f4e674..2c515a2 100644
--- a/librdmacm/addrinfo.c
+++ b/librdmacm/addrinfo.c
@@ -43,7 +43,7 @@
#include <rdma/rdma_cma.h>
#include <infiniband/ib.h>
-struct rdma_addrinfo nohints;
+static struct rdma_addrinfo nohints;
static void ucma_convert_to_ai(struct addrinfo *ai, struct rdma_addrinfo *rai)
{
diff --git a/librdmacm/examples/rcopy.c b/librdmacm/examples/rcopy.c
index 085b017..38f6929 100644
--- a/librdmacm/examples/rcopy.c
+++ b/librdmacm/examples/rcopy.c
@@ -59,8 +59,8 @@ static char *src_file;
static struct timeval start, end;
//static void buf[1024 * 1024];
static uint64_t bytes;
-int fd;
-void *file_addr;
+static int fd;
+static void *file_addr;
enum {
CMD_NOOP,
diff --git a/librdmacm/examples/rdma_client.c b/librdmacm/examples/rdma_client.c
index d7f65f5..fd7bbc2 100644
--- a/librdmacm/examples/rdma_client.c
+++ b/librdmacm/examples/rdma_client.c
@@ -39,11 +39,11 @@
static char *server = "127.0.0.1";
static char *port = "7471";
-struct rdma_cm_id *id;
-struct ibv_mr *mr, *send_mr;
-int send_flags;
-uint8_t send_msg[16];
-uint8_t recv_msg[16];
+static struct rdma_cm_id *id;
+static struct ibv_mr *mr, *send_mr;
+static int send_flags;
+static uint8_t send_msg[16];
+static uint8_t recv_msg[16];
static int run(void)
{
diff --git a/librdmacm/examples/rdma_server.c b/librdmacm/examples/rdma_server.c
index d98d11a..3c7c15e 100644
--- a/librdmacm/examples/rdma_server.c
+++ b/librdmacm/examples/rdma_server.c
@@ -38,11 +38,11 @@
static char *port = "7471";
-struct rdma_cm_id *listen_id, *id;
-struct ibv_mr *mr, *send_mr;
-int send_flags;
-uint8_t send_msg[16];
-uint8_t recv_msg[16];
+static struct rdma_cm_id *listen_id, *id;
+static struct ibv_mr *mr, *send_mr;
+static int send_flags;
+static uint8_t send_msg[16];
+static uint8_t recv_msg[16];
static int run(void)
{
diff --git a/librdmacm/examples/rdma_xclient.c b/librdmacm/examples/rdma_xclient.c
index 8dba266..d86fee1 100644
--- a/librdmacm/examples/rdma_xclient.c
+++ b/librdmacm/examples/rdma_xclient.c
@@ -40,12 +40,12 @@
static char *server = "127.0.0.1";
static char port[6] = "7471";
-struct rdma_cm_id *id;
-struct ibv_mr *mr;
-struct rdma_addrinfo hints;
+static struct rdma_cm_id *id;
+static struct ibv_mr *mr;
+static struct rdma_addrinfo hints;
-uint8_t send_msg[16];
-uint32_t srqn;
+static uint8_t send_msg[16];
+static uint32_t srqn;
static int post_send(void)
{
diff --git a/librdmacm/examples/rdma_xserver.c b/librdmacm/examples/rdma_xserver.c
index 69f170b..f838e7d 100644
--- a/librdmacm/examples/rdma_xserver.c
+++ b/librdmacm/examples/rdma_xserver.c
@@ -40,12 +40,12 @@
static char *port = "7471";
-struct rdma_cm_id *listen_id, *id;
-struct ibv_mr *mr;
-struct rdma_addrinfo hints;
+static struct rdma_cm_id *listen_id, *id;
+static struct ibv_mr *mr;
+static struct rdma_addrinfo hints;
-uint8_t recv_msg[16];
-uint32_t srqn;
+static uint8_t recv_msg[16];
+static uint32_t srqn;
static int create_srq(void)
{
diff --git a/librdmacm/rsocket.c b/librdmacm/rsocket.c
index 7e7a38e..e0755dd 100644
--- a/librdmacm/rsocket.c
+++ b/librdmacm/rsocket.c
@@ -505,7 +505,7 @@ static int rs_scale_to_value(int value, int bits)
(void) rc; \
}
-void rs_configure(void)
+static void rs_configure(void)
{
FILE *f;
static int init;
--
2.1.4
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 40+ messages in thread
* [PATCH 14/32] cxgb4: mark symbols static where possible
[not found] ` <1476381095-20041-1-git-send-email-hch-jcswGhMUV9g@public.gmane.org>
` (12 preceding siblings ...)
2016-10-13 17:51 ` [PATCH 13/32] librdmacm: mark symbols static where possible Christoph Hellwig
@ 2016-10-13 17:51 ` Christoph Hellwig
[not found] ` <1476381095-20041-15-git-send-email-hch-jcswGhMUV9g@public.gmane.org>
2016-10-13 17:51 ` [PATCH 15/32] cxgb4: remove unused function dump_wqe Christoph Hellwig
` (2 subsequent siblings)
16 siblings, 1 reply; 40+ messages in thread
From: Christoph Hellwig @ 2016-10-13 17:51 UTC (permalink / raw)
To: linux-rdma-u79uwXL29TY76Z2rM5mHXA
Signed-off-by: Christoph Hellwig <hch-jcswGhMUV9g@public.gmane.org>
---
providers/cxgb4/dev.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/providers/cxgb4/dev.c b/providers/cxgb4/dev.c
index e1486ec..69b04ac 100644
--- a/providers/cxgb4/dev.c
+++ b/providers/cxgb4/dev.c
@@ -49,7 +49,7 @@
* Macros needed to support the PCI Device ID Table ...
*/
#define CH_PCI_DEVICE_ID_TABLE_DEFINE_BEGIN \
- struct { \
+ static struct { \
unsigned vendor; \
unsigned device; \
} hca_table[] = {
--
2.1.4
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 40+ messages in thread
* [PATCH 15/32] cxgb4: remove unused function dump_wqe
[not found] ` <1476381095-20041-1-git-send-email-hch-jcswGhMUV9g@public.gmane.org>
` (13 preceding siblings ...)
2016-10-13 17:51 ` [PATCH 14/32] cxgb4: " Christoph Hellwig
@ 2016-10-13 17:51 ` Christoph Hellwig
[not found] ` <1476381095-20041-16-git-send-email-hch-jcswGhMUV9g@public.gmane.org>
2016-10-13 19:03 ` trivial sparse fixes for rdma-core Jason Gunthorpe
2016-10-15 9:50 ` Leon Romanovsky
16 siblings, 1 reply; 40+ messages in thread
From: Christoph Hellwig @ 2016-10-13 17:51 UTC (permalink / raw)
To: linux-rdma-u79uwXL29TY76Z2rM5mHXA
Signed-off-by: Christoph Hellwig <hch-jcswGhMUV9g@public.gmane.org>
---
providers/cxgb4/qp.c | 14 --------------
1 file changed, 14 deletions(-)
diff --git a/providers/cxgb4/qp.c b/providers/cxgb4/qp.c
index 95b459a..376a00a 100644
--- a/providers/cxgb4/qp.c
+++ b/providers/cxgb4/qp.c
@@ -267,20 +267,6 @@ static int build_rdma_recv(struct c4iw_qp *qhp, union t4_recv_wr *wqe,
return 0;
}
-void dump_wqe(void *arg)
-{
- u64 *p = arg;
- int len16;
-
- len16 = be64_to_cpu(*p) & 0xff;
- while (len16--) {
- printf("%02x: %016llx ", (u8)(unsigned long)p, (long long)be64_to_cpu(*p));
- p++;
- printf("%016llx\n", (long long)be64_to_cpu(*p));
- p++;
- }
-}
-
static void ring_kernel_db(struct c4iw_qp *qhp, u32 qid, u16 idx)
{
struct ibv_modify_qp cmd;
--
2.1.4
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 40+ messages in thread
* Re: trivial sparse fixes for rdma-core
[not found] ` <1476381095-20041-1-git-send-email-hch-jcswGhMUV9g@public.gmane.org>
` (14 preceding siblings ...)
2016-10-13 17:51 ` [PATCH 15/32] cxgb4: remove unused function dump_wqe Christoph Hellwig
@ 2016-10-13 19:03 ` Jason Gunthorpe
[not found] ` <20161013190326.GA19904-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-10-15 9:50 ` Leon Romanovsky
16 siblings, 1 reply; 40+ messages in thread
From: Jason Gunthorpe @ 2016-10-13 19:03 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA
On Thu, Oct 13, 2016 at 07:51:03PM +0200, Christoph Hellwig wrote:
> This is the low hanging fruit in terms of reducing sparse noise before
> looking into endianess and iomem annotations.
Looks fine to me. Since I gave them a good compile test I also
prepared the pull request for the first 15 that made it to the list:
https://github.com/linux-rdma/rdma-core/pull/19
Here is the patch to turn on gcc -Wstrict-prototypes
https://github.com/jgunthorpe/rdma-plumbing/commit/dd80c3b362ae90d0de36a6249409c20581bae864
I'll grab the rest of the patches into this PR when they make it to
the list.
Made one tiny change, re-orderd 'iwpmd: fix the prototype for the
pthread_create start functionss' to be before 'iwpmd: use proper
ANSI-C prototypes for functions without arguments' as this ordering
keeps every patch buildable.
Regards,
Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 40+ messages in thread
* Re: trivial sparse fixes for rdma-core
[not found] ` <1476381095-20041-1-git-send-email-hch-jcswGhMUV9g@public.gmane.org>
` (15 preceding siblings ...)
2016-10-13 19:03 ` trivial sparse fixes for rdma-core Jason Gunthorpe
@ 2016-10-15 9:50 ` Leon Romanovsky
16 siblings, 0 replies; 40+ messages in thread
From: Leon Romanovsky @ 2016-10-15 9:50 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA
[-- Attachment #1: Type: text/plain, Size: 435 bytes --]
On Thu, Oct 13, 2016 at 07:51:03PM +0200, Christoph Hellwig wrote:
> This is the low hanging fruit in terms of reducing sparse noise before
> looking into endianess and iomem annotations.
Thanks, applied.
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 40+ messages in thread