diff mbox series

[3/8] libmultipath: cciss_ioctl_pathinfo doesn't fail

Message ID 20181010200506.15796-4-mwilck@suse.com (mailing list archive)
State Not Applicable, archived
Delegated to: christophe varoqui
Headers show
Series various multipath-tools patches | expand

Commit Message

Martin Wilck Oct. 10, 2018, 8:05 p.m. UTC
Make it a void function and move the DI_SERIAL test to pathinfo().

Signed-off-by: Martin Wilck <mwilck@suse.com>
---
 libmultipath/discovery.c | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)

Comments

Benjamin Marzinski Oct. 12, 2018, 9:47 p.m. UTC | #1
On Wed, Oct 10, 2018 at 10:05:01PM +0200, Martin Wilck wrote:
> Make it a void function and move the DI_SERIAL test to pathinfo().
> 

Reviewed-by: Benjamin Marzinski <bmarzins@redhat.com>

> Signed-off-by: Martin Wilck <mwilck@suse.com>
> ---
>  libmultipath/discovery.c | 16 ++++++----------
>  1 file changed, 6 insertions(+), 10 deletions(-)
> 
> diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c
> index 8381d982..873035e5 100644
> --- a/libmultipath/discovery.c
> +++ b/libmultipath/discovery.c
> @@ -1538,14 +1538,11 @@ scsi_ioctl_pathinfo (struct path * pp, struct config *conf, int mask)
>  	return;
>  }
>  
> -static int
> -cciss_ioctl_pathinfo (struct path * pp, int mask)
> +static void
> +cciss_ioctl_pathinfo(struct path *pp)
>  {
> -	if (mask & DI_SERIAL) {
> -		get_serial(pp->serial, SERIAL_SIZE, pp->fd);
> -		condlog(3, "%s: serial = %s", pp->dev, pp->serial);
> -	}
> -	return 0;
> +	get_serial(pp->serial, SERIAL_SIZE, pp->fd);
> +	condlog(3, "%s: serial = %s", pp->dev, pp->serial);
>  }
>  
>  int
> @@ -1940,9 +1937,8 @@ int pathinfo(struct path *pp, struct config *conf, int mask)
>  	if (path_state == PATH_UP && pp->bus == SYSFS_BUS_SCSI)
>  		scsi_ioctl_pathinfo(pp, conf, mask);
>  
> -	if (pp->bus == SYSFS_BUS_CCISS &&
> -	    cciss_ioctl_pathinfo(pp, mask))
> -		goto blank;
> +	if (pp->bus == SYSFS_BUS_CCISS && mask & DI_SERIAL)
> +		cciss_ioctl_pathinfo(pp);
>  
>  	if (mask & DI_CHECKER) {
>  		if (path_state == PATH_UP) {
> -- 
> 2.19.0

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
diff mbox series

Patch

diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c
index 8381d982..873035e5 100644
--- a/libmultipath/discovery.c
+++ b/libmultipath/discovery.c
@@ -1538,14 +1538,11 @@  scsi_ioctl_pathinfo (struct path * pp, struct config *conf, int mask)
 	return;
 }
 
-static int
-cciss_ioctl_pathinfo (struct path * pp, int mask)
+static void
+cciss_ioctl_pathinfo(struct path *pp)
 {
-	if (mask & DI_SERIAL) {
-		get_serial(pp->serial, SERIAL_SIZE, pp->fd);
-		condlog(3, "%s: serial = %s", pp->dev, pp->serial);
-	}
-	return 0;
+	get_serial(pp->serial, SERIAL_SIZE, pp->fd);
+	condlog(3, "%s: serial = %s", pp->dev, pp->serial);
 }
 
 int
@@ -1940,9 +1937,8 @@  int pathinfo(struct path *pp, struct config *conf, int mask)
 	if (path_state == PATH_UP && pp->bus == SYSFS_BUS_SCSI)
 		scsi_ioctl_pathinfo(pp, conf, mask);
 
-	if (pp->bus == SYSFS_BUS_CCISS &&
-	    cciss_ioctl_pathinfo(pp, mask))
-		goto blank;
+	if (pp->bus == SYSFS_BUS_CCISS && mask & DI_SERIAL)
+		cciss_ioctl_pathinfo(pp);
 
 	if (mask & DI_CHECKER) {
 		if (path_state == PATH_UP) {