[sheepdog] [PATCH 01/10] dog/farm: clear performance tips generated by cppcheck

Hitoshi Mitake mitake.hitoshi at gmail.com
Wed Sep 3 08:46:59 CEST 2014


On Tue, Sep 2, 2014 at 6:14 PM, Ruoyu <liangry at ucweb.com> wrote:
> This patch gets rid of the below message while performing a code analysis
> with cppcheck.
>
> [dog/farm/farm.c:207] -> [dog/farm/farm.c:218]: (performance) Variable
> 'ret' is reassigned a value before the old one has been used.
>
> Signed-off-by: Ruoyu <liangry at ucweb.com>
> ---
>  dog/farm/farm.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Applied this series, thanks.
Hitoshi

>
> diff --git a/dog/farm/farm.c b/dog/farm/farm.c
> index 5d07be9..83c297f 100644
> --- a/dog/farm/farm.c
> +++ b/dog/farm/farm.c
> @@ -204,7 +204,7 @@ out:
>  static int notify_vdi_add(uint32_t vdi_id, uint8_t nr_copies,
>                           uint8_t copy_policy)
>  {
> -       int ret = -1;
> +       int ret;
>         struct sd_req hdr;
>         struct sd_rsp *rsp = (struct sd_rsp *)&hdr;
>         char *buf = NULL;
> --
> 1.8.3.2
>
>
> --
> sheepdog mailing list
> sheepdog at lists.wpkg.org
> http://lists.wpkg.org/mailman/listinfo/sheepdog



More information about the sheepdog mailing list