[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAPDyKFrAvodcmUL8V+84gFGMdLJjGonpEXU2FnaO6FAw=5x-dQ@mail.gmail.com>
Date: Fri, 6 Nov 2015 17:03:25 +0100
From: Ulf Hansson <ulf.hansson@...aro.org>
To: Vishnu Pratap Singh <vishnu.ps@...sung.com>
Cc: Jens Axboe <axboe@...nel.dk>,
Andrew Morton <akpm@...ux-foundation.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Jeff Moyer <jmoyer@...hat.com>, minchan@...nel.org,
ngupta@...are.org, sergey.senozhatsky.work@...il.com,
"David S. Miller" <davem@...emloft.net>, neilb@...e.com,
Takashi Iwai <tiwai@...e.de>, hare@...e.de,
ming.lei@...onical.com, jarod@...hat.com, viro@...iv.linux.org.uk,
Tejun Heo <tj@...nel.org>,
Adrian Hunter <adrian.hunter@...el.com>,
Jon Hunter <jonathanh@...dia.com>,
Grant Grundler <grundler@...omium.org>,
linux-ide@...r.kernel.org, linux-raid@...r.kernel.org,
linux-mmc <linux-mmc@...r.kernel.org>,
"cpgs ." <cpgs@...sung.com>, vishu13285@...il.com,
pintu.k@...sung.com, rohit.kr@...sung.com
Subject: Re: [PATCH 2/8] mmc: handle add_disk() return value
On 6 November 2015 at 13:22, Vishnu Pratap Singh <vishnu.ps@...sung.com> wrote:
> This patch handles add_disk() return value.
> Earlier add_disk() function doesn't handle error
> cases, now it is added, so the callers of this function
> should also handle it.
>
> Verfied on X86 based ubuntu machine.
> This patch depends on [PATCH 1/8] block/genhd.c: Add error handling
Please remove these two lines from the change log.
Still it's great that you provide this information while posting the
patches, but you can do that by adding text between the sign-off-by
and "---". Just add a new line consisting of "---" and then add you
text below it.
>
> Signed-off-by: Vishnu Pratap Singh <vishnu.ps@...sung.com>
> ---
> drivers/mmc/card/block.c | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
> index 23b6c8e..543c670 100644
> --- a/drivers/mmc/card/block.c
> +++ b/drivers/mmc/card/block.c
> @@ -2432,7 +2432,10 @@ static int mmc_add_disk(struct mmc_blk_data *md)
> int ret;
> struct mmc_card *card = md->queue.card;
>
> - add_disk(md->disk);
> + ret = add_disk(md->disk);
> + if (ret)
> + goto add_disk_fail;
You don't need a goto here. Please just do "return ret;" as I think it
makes code easier.
> +
> md->force_ro.show = force_ro_show;
> md->force_ro.store = force_ro_store;
> sysfs_attr_init(&md->force_ro.attr);
> @@ -2468,7 +2471,7 @@ power_ro_lock_fail:
> device_remove_file(disk_to_dev(md->disk), &md->force_ro);
> force_ro_fail:
> del_gendisk(md->disk);
> -
> +add_disk_fail:
> return ret;
> }
>
> --
> 1.9.1
>
Kind regards
Uffe
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists