All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takahiro Yasui <tyasui@redhat.com>
To: device-mapper development <dm-devel@redhat.com>
Subject: Re: [PATCH] dm-log: fix return value in create_log_context function
Date: Thu, 18 Dec 2008 12:43:47 -0500	[thread overview]
Message-ID: <494A8BD3.1020708@redhat.com> (raw)
In-Reply-To: <49372F1E.5060200@redhat.com>

Hi all,

What do you think about this patch? 

> DMWARN("couldn't allocate disk io client"); 

This message is not necessarily related to ENOMEM and returning
variable "r" is better than doing -ENOMEM in terms of function
encapsulation.

I appreciate any comments.

Regards,
Taka


> Hi,
> 
> This is very trivial fix, but let me post it to improve code
> readability. In the current implementation, caller function
> does not use the return value and no action is changed.
> 
> Regards,
> ---
> Takahiro Yasui
> Hitachi Computer Products (America) Inc.
> 
> 
> 
> When dm_io_client_create function fails in create_log_context
> function, return value is set to variable r but it is not used.
> r should be returned.
> 
> 
> Signed-off-by: Takahiro Yasui <tyasui@redhat.com>
> ---
>  drivers/md/dm-log.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> Index: linux-2.6.28-rc7/drivers/md/dm-log.c
> ===================================================================
> --- linux-2.6.28-rc7.orig/drivers/md/dm-log.c
> +++ linux-2.6.28-rc7/drivers/md/dm-log.c
> @@ -461,7 +461,7 @@ static int create_log_context(struct dm_
>  			r = PTR_ERR(lc->io_req.client);
>  			DMWARN("couldn't allocate disk io client");
>  			kfree(lc);
> -			return -ENOMEM;
> +			return r;
>  		}
>  
>  		lc->disk_header = vmalloc(buf_size);
> 
> --
> dm-devel mailing list
> dm-devel@redhat.com
> https://www.redhat.com/mailman/listinfo/dm-devel

  reply	other threads:[~2008-12-18 17:43 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-04  1:15 [PATCH] dm-log: fix return value in create_log_context function Takahiro Yasui
2008-12-18 17:43 ` Takahiro Yasui [this message]
2008-12-18 18:57   ` Jonathan Brassow
2008-12-18 21:23     ` Takahiro Yasui
2009-01-08 15:39       ` Jonathan Brassow

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=494A8BD3.1020708@redhat.com \
    --to=tyasui@redhat.com \
    --cc=dm-devel@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.