LNET_PID_ANY and LNET_NID_ANY were defined outside
the range of an u64. They were moved from -1 to the
maximum value for u64.
LNET_NID_ANY was used in an instance where LNET_NET_ANY
should have been used.
Initialize a variable which could potentially be left
uninitialized.
Fixed a minor style issue.
Signed-off-by: Timothy Day <timday@amazon.com>
Change-Id: I61c8b33d98fdaa4b7a4846d0061a483664e4f652
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/50318
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Neil Brown <neilb@suse.de>
Reviewed-by: Chris Horn <chris.horn@hpe.com>
Reviewed-by: Frank Sehr <fsehr@whamcloud.com>
Reviewed-by: jsimmons <jsimmons@infradead.org>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
#define LNET_RESERVED_PORTAL 0
/** wildcard NID that matches any end-point address */
#define LNET_RESERVED_PORTAL 0
/** wildcard NID that matches any end-point address */
-#define LNET_NID_ANY ((lnet_nid_t) -1)
+#define LNET_NID_ANY (~(lnet_nid_t) 0)
/** wildcard PID that matches any lnet_pid_t */
/** wildcard PID that matches any lnet_pid_t */
-#define LNET_PID_ANY ((lnet_pid_t) -1)
+#define LNET_PID_ANY (~(lnet_pid_t) 0)
static inline int LNET_NID_IS_ANY(const struct lnet_nid *nid)
{
static inline int LNET_NID_IS_ANY(const struct lnet_nid *nid)
{
char *entity, char *err_str,
struct cYAML **root)
{
char *entity, char *err_str,
struct cYAML **root)
{
- struct cYAML *r = NULL, *err, *s, *itm, *cmd_obj;
+ struct cYAML *r = NULL, *err, *s, *itm = NULL, *cmd_obj;
if (root == NULL)
return;
if (root == NULL)
return;
else if (cmd_obj == NULL) {
s = cYAML_create_seq(r, cmd);
itm = cYAML_create_seq_item(s);
else if (cmd_obj == NULL) {
s = cYAML_create_seq(r, cmd);
itm = cYAML_create_seq_item(s);
- } else if (cmd_obj != NULL && cmd_obj->cy_type != CYAML_TYPE_ARRAY)
+ } else if (cmd_obj != NULL && cmd_obj->cy_type != CYAML_TYPE_ARRAY) {
err = cYAML_create_object(itm, entity);
if (err == NULL)
err = cYAML_create_object(itm, entity);
if (err == NULL)
/* assign the network id */
ip2nets.ip2nets_net.nw_id = libcfs_str2net(net->cy_valuestring);
/* assign the network id */
ip2nets.ip2nets_net.nw_id = libcfs_str2net(net->cy_valuestring);
- if (ip2nets.ip2nets_net.nw_id == LNET_NID_ANY)
+ if (ip2nets.ip2nets_net.nw_id == LNET_NET_ANY)
return LUSTRE_CFG_RC_BAD_PARAM;
seq_no = cYAML_get_object_item(tree, "seq_no");
return LUSTRE_CFG_RC_BAD_PARAM;
seq_no = cYAML_get_object_item(tree, "seq_no");