Whamcloud - gitweb
LU-16518 lnet: fix unused-but-set-variable warnings 81/58181/2
authorTimothy Day <timday@amazon.com>
Mon, 24 Feb 2025 06:12:08 +0000 (01:12 -0500)
committerOleg Drokin <green@whamcloud.com>
Thu, 6 Mar 2025 08:08:41 +0000 (08:08 +0000)
Remove unused primary_nid variable in lnet_peer_merge_data()
to silence a Clang compiler warning.

Test-Parameters: trivial
Signed-off-by: Timothy Day <timday@amazon.com>
Change-Id: Ib66fd31c7acc08fa66578cd7ab571f278f98afe1
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/58181
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Max Wang <wamax@amazon.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Serguei Smirnov <ssmirnov@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
lnet/lnet/peer.c

index da51655..e44ead4 100644 (file)
@@ -3251,7 +3251,6 @@ static int lnet_peer_merge_data(struct lnet_peer *lp,
        struct lnet_ping_iter pi;
        struct lnet_nid nid;
        u32 *stp;
-       struct lnet_nid primary = {};
        bool want_large_primary;
        unsigned int flags;
        int ncurnis;
@@ -3301,8 +3300,6 @@ static int lnet_peer_merge_data(struct lnet_peer *lp,
         */
        ping_iter_first(&pi, pbuf, NULL);
        stp = ping_iter_next(&pi, &nid);
-       if (stp)
-               primary = nid;
        want_large_primary = (pbuf->pb_info.pi_features &
                              LNET_PING_FEAT_PRIMARY_LARGE);
        for (; stp; stp = ping_iter_next(&pi, &nid)) {
@@ -3314,10 +3311,8 @@ static int lnet_peer_merge_data(struct lnet_peer *lp,
                        addnis[naddnis].ns_status = *stp;
                        naddnis += 1;
                }
-               if (want_large_primary && nid.nid_size) {
-                       primary = nid;
+               if (want_large_primary && nid.nid_size)
                        want_large_primary = false;
-               }
        }
        /*
         * Check for NIDs in curnis[] not present in pbuf.