996407fc5f
Update Source to latest upstream commit Rename files * Previous patches 0001-0020 are now patches 0002-0021 * Previous patches 0021-0028 are now patches 0026-0033 Add 0001-kpartx-Use-absolute-paths-to-create-mappings.patch Add 0022-multipathd-check-for-NULL-udevice-in-cli_add_path.patch Add 0023-libmultipath-remove-max_fds-code-duplication.patch Add 0024-multipathd-set-return-code-for-multipathd-commands.patch Add 0025-mpathpersist-fix-registration-rollback-issue.patch * The above 5 patches have been submitted upstream
58 lines
1.8 KiB
Diff
58 lines
1.8 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Benjamin Marzinski <bmarzins@redhat.com>
|
|
Date: Mon, 30 Jul 2018 14:28:02 -0500
|
|
Subject: [PATCH] libmultipath: remove unused code
|
|
|
|
since vector_foreach_slot() already checks if the entry is NULL, there's
|
|
no point in checking it in the loop, since it can't be NULL there. Found
|
|
by coverity.
|
|
|
|
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
|
|
---
|
|
libmultipath/print.c | 8 --------
|
|
1 file changed, 8 deletions(-)
|
|
|
|
diff --git a/libmultipath/print.c b/libmultipath/print.c
|
|
index 9da6a77..7b610b9 100644
|
|
--- a/libmultipath/print.c
|
|
+++ b/libmultipath/print.c
|
|
@@ -275,8 +275,6 @@ snprint_multipath_vpr (char * buff, size_t len, const struct multipath * mpp)
|
|
int i, j;
|
|
|
|
vector_foreach_slot(mpp->pg, pgp, i) {
|
|
- if (!pgp)
|
|
- continue;
|
|
vector_foreach_slot(pgp->paths, pp, j) {
|
|
if (strlen(pp->vendor_id) && strlen(pp->product_id))
|
|
return snprintf(buff, len, "%s,%s",
|
|
@@ -295,8 +293,6 @@ snprint_multipath_vend (char * buff, size_t len, const struct multipath * mpp)
|
|
int i, j;
|
|
|
|
vector_foreach_slot(mpp->pg, pgp, i) {
|
|
- if (!pgp)
|
|
- continue;
|
|
vector_foreach_slot(pgp->paths, pp, j) {
|
|
if (strlen(pp->vendor_id))
|
|
return snprintf(buff, len, "%s", pp->vendor_id);
|
|
@@ -313,8 +309,6 @@ snprint_multipath_prod (char * buff, size_t len, const struct multipath * mpp)
|
|
int i, j;
|
|
|
|
vector_foreach_slot(mpp->pg, pgp, i) {
|
|
- if (!pgp)
|
|
- continue;
|
|
vector_foreach_slot(pgp->paths, pp, j) {
|
|
if (strlen(pp->product_id))
|
|
return snprintf(buff, len, "%s", pp->product_id);
|
|
@@ -331,8 +325,6 @@ snprint_multipath_rev (char * buff, size_t len, const struct multipath * mpp)
|
|
int i, j;
|
|
|
|
vector_foreach_slot(mpp->pg, pgp, i) {
|
|
- if (!pgp)
|
|
- continue;
|
|
vector_foreach_slot(pgp->paths, pp, j) {
|
|
if (strlen(pp->rev))
|
|
return snprintf(buff, len, "%s", pp->rev);
|
|
--
|
|
2.7.4
|
|
|