From: Ulf Hansson <ulf.hansson@linaro.org>
To: Vishnu Pratap Singh <vishnu.ps@samsung.com>
Cc: Jens Axboe <axboe@kernel.dk>,
Andrew Morton <akpm@linux-foundation.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Jeff Moyer <jmoyer@redhat.com>,
minchan@kernel.org, ngupta@vflare.org,
sergey.senozhatsky.work@gmail.com,
"David S. Miller" <davem@davemloft.net>,
neilb@suse.com, Takashi Iwai <tiwai@suse.de>,
hare@suse.de, ming.lei@canonical.com, jarod@redhat.com,
viro@zeniv.linux.org.uk, Tejun Heo <tj@kernel.org>,
Adrian Hunter <adrian.hunter@intel.com>,
Jon Hunter <jonathanh@nvidia.com>,
Grant Grundler <grundler@chromium.org>,
linux-ide@vger.kernel.org, linux-raid@vger.kernel.org,
linux-mmc <linux-mmc@vger.kernel.org>,
"cpgs ." <cpgs@samsung.com>,
vishu13285@gmail.com, pintu.k@samsung.com, rohit.kr@samsung.com
Subject: Re: [PATCH 2/8] mmc: handle add_disk() return value
Date: Fri, 6 Nov 2015 17:03:25 +0100 [thread overview]
Message-ID: <CAPDyKFrAvodcmUL8V+84gFGMdLJjGonpEXU2FnaO6FAw=5x-dQ@mail.gmail.com> (raw)
In-Reply-To: <1446812535-10567-2-git-send-email-vishnu.ps@samsung.com>
On 6 November 2015 at 13:22, Vishnu Pratap Singh <vishnu.ps@samsung.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@samsung.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
next prev parent reply other threads:[~2015-11-06 16:03 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <437969438-9181-1-git-send-email-vishnu.ps@samsung.com>
2015-11-06 12:22 ` [PATCH 1/8] block/genhd.c: Add error handling Vishnu Pratap Singh
2015-11-06 12:22 ` [PATCH 2/8] mmc: handle add_disk() return value Vishnu Pratap Singh
2015-11-06 16:03 ` Ulf Hansson [this message]
2015-11-09 5:11 ` Vishnu Pratap Singh
2015-11-06 12:22 ` [PATCH 3/8] block/floppy.c: handle blk_register_region() " Vishnu Pratap Singh
2015-11-06 12:50 ` kbuild test robot
2015-11-09 23:44 ` Grant Grundler
2015-11-06 12:22 ` [PATCH 4/8] block/loop.c: handle add_disk() & " Vishnu Pratap Singh
2015-11-06 12:22 ` [PATCH 5/8] zram: " Vishnu Pratap Singh
2015-11-09 1:07 ` Sergey Senozhatsky
2015-11-06 12:22 ` [PATCH 6/8] md/md.c: handle " Vishnu Pratap Singh
2015-11-06 12:22 ` [PATCH 7/8] cdrom/gdrom.c: handle add_disk() " Vishnu Pratap Singh
2015-11-06 12:22 ` [PATCH 8/8] ide/ide-probe.c: handle blk_register_region() " Vishnu Pratap Singh
2015-11-10 3:33 ` [PATCH 1/8] block/genhd.c: Add error handling Al Viro
2015-11-10 3:40 ` Jens Axboe
2015-11-10 14:11 ` Jeff Moyer
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='CAPDyKFrAvodcmUL8V+84gFGMdLJjGonpEXU2FnaO6FAw=5x-dQ@mail.gmail.com' \
--to=ulf.hansson@linaro.org \
--cc=adrian.hunter@intel.com \
--cc=akpm@linux-foundation.org \
--cc=axboe@kernel.dk \
--cc=cpgs@samsung.com \
--cc=davem@davemloft.net \
--cc=grundler@chromium.org \
--cc=hare@suse.de \
--cc=jarod@redhat.com \
--cc=jmoyer@redhat.com \
--cc=jonathanh@nvidia.com \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=linux-raid@vger.kernel.org \
--cc=minchan@kernel.org \
--cc=ming.lei@canonical.com \
--cc=neilb@suse.com \
--cc=ngupta@vflare.org \
--cc=pintu.k@samsung.com \
--cc=rohit.kr@samsung.com \
--cc=sergey.senozhatsky.work@gmail.com \
--cc=tiwai@suse.de \
--cc=tj@kernel.org \
--cc=viro@zeniv.linux.org.uk \
--cc=vishnu.ps@samsung.com \
--cc=vishu13285@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).