multipathd: remove useless check and fix format
authorBenjamin Marzinski <bmarzins@redhat.com>
Tue, 9 Oct 2018 23:03:13 +0000 (18:03 -0500)
committerChristophe Varoqui <christophe.varoqui@opensvc.com>
Wed, 10 Oct 2018 06:09:45 +0000 (08:09 +0200)
The only thing this patch changes is to remove the check for pp->mpp
before the check for pp->mpp->prflags, since check_path() already
verified that pp->mpp != NULL. This fixes a number of coverity warnings.
Also, I normalized the spacing and indenting of the nearby code.

Reviewed-by: Martin Wilck <mwilck@suse.com>
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
multipathd/main.c

index cd96304..463b1b8 100644 (file)
@@ -1979,14 +1979,14 @@ check_path (struct vectors * vecs, struct path * pp, int ticks)
                        return 1;
                }
 
-               if(newstate == PATH_UP || newstate == PATH_GHOST){
-                       if ( pp->mpp && pp->mpp->prflag ){
+               if (newstate == PATH_UP || newstate == PATH_GHOST) {
+                       if (pp->mpp->prflag) {
                                /*
                                 * Check Persistent Reservation.
                                 */
-                       condlog(2, "%s: checking persistent reservation "
-                               "registration", pp->dev);
-                       mpath_pr_event_handle(pp);
+                               condlog(2, "%s: checking persistent "
+                                       "reservation registration", pp->dev);
+                               mpath_pr_event_handle(pp);
                        }
                }