linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ming Lin <mlin@kernel.org>
To: kbuild test robot <lkp@intel.com>
Cc: Ming Lin <mlin@kernel.org>,
	kbuild-all@01.org, lkml <linux-kernel@vger.kernel.org>,
	"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
	Christoph Hellwig <hch@lst.de>
Subject: Re: [PATCH v2 5/5] lib: scatterlist: move SG pool code from SCSI driver to lib/sg_pool.c
Date: Mon, 4 Apr 2016 13:15:45 -0700	[thread overview]
Message-ID: <CAF1ivSarDagJvHbOTG9yaOpjS9DufE9HLEr==UgE4en47LRuRA@mail.gmail.com> (raw)
In-Reply-To: <201603231036.A8dUuAli%fengguang.wu@intel.com>

On Tue, Mar 22, 2016 at 7:38 PM, kbuild test robot <lkp@intel.com> wrote:
> Hi Ming,
>
> [auto build test WARNING on scsi/for-next]
> [also build test WARNING on v4.5 next-20160322]
> [if your patch is applied to the wrong git tree, please drop us a note to help improving the system]
>
> url:    https://github.com/0day-ci/linux/commits/Ming-Lin/mempool-based-chained-scatterlist-alloc-free-api/20160323-060710
> base:   https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git for-next
>
>
> coccinelle warnings: (new ones prefixed by >>)
>
>>> lib/sg_pool.c:152:3-18: WARNING: NULL check before freeing functions like kfree, debugfs_remove, debugfs_remove_recursive or usb_free_urb is not needed. Maybe consider reorganizing relevant code to avoid passing NULL values.
>    lib/sg_pool.c:154:3-21: WARNING: NULL check before freeing functions like kfree, debugfs_remove, debugfs_remove_recursive or usb_free_urb is not needed. Maybe consider reorganizing relevant code to avoid passing NULL values.

mempool_destroy()/kmem_cache_destroy() is OK to accept NULL pointer.
But the logic is more readable that we do NULL check when cleanup due to error.

cleanup_sdb:
        for (i = 0; i < SG_MEMPOOL_NR; i++) {
                struct sg_pool *sgp = sg_pools + i;
                if (sgp->pool)
                        mempool_destroy(sgp->pool);
                if (sgp->slab)
                        kmem_cache_destroy(sgp->slab);
        }

I'll keep the NULL check if no objection.

Thanks.

  reply	other threads:[~2016-04-04 20:15 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-22 22:03 [PATCH v2 0/5] mempool based chained scatterlist alloc/free api Ming Lin
2016-03-22 22:03 ` [PATCH v2 1/5] scsi: replace "scsi_data_buffer" with "sg_table" in SG functions Ming Lin
2016-03-22 22:03 ` [PATCH v2 2/5] scsi: replace "mq" with "first_chunk" " Ming Lin
2016-03-22 22:03 ` [PATCH v2 3/5] scsi: rename SG related struct and functions Ming Lin
2016-03-22 22:03 ` [PATCH v2 4/5] scsi: rename SCSI_MAX_{SG, SG_CHAIN}_SEGMENTS Ming Lin
2016-04-04 14:22   ` Bart Van Assche
2016-04-04 20:24   ` Ming Lin
2016-04-04 21:22     ` Tejun Heo
2016-03-22 22:03 ` [PATCH v2 5/5] lib: scatterlist: move SG pool code from SCSI driver to lib/sg_pool.c Ming Lin
2016-03-23  2:38   ` [PATCH] lib: scatterlist: fix ifnullfree.cocci warnings kbuild test robot
2016-03-23  2:38   ` [PATCH v2 5/5] lib: scatterlist: move SG pool code from SCSI driver to lib/sg_pool.c kbuild test robot
2016-04-04 20:15     ` Ming Lin [this message]
2016-04-04 20:17       ` Christoph Hellwig
2016-04-04 20:29         ` Ming Lin
2016-03-23  7:40 ` [PATCH v2 0/5] mempool based chained scatterlist alloc/free api Christoph Hellwig
2016-03-24 15:09   ` Ming Lin
2016-03-24 15:46     ` James Bottomley
2016-03-28 14:48       ` Ming Lin
2016-04-04  6:07         ` Ming Lin
2016-04-04 14:01           ` James Bottomley

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='CAF1ivSarDagJvHbOTG9yaOpjS9DufE9HLEr==UgE4en47LRuRA@mail.gmail.com' \
    --to=mlin@kernel.org \
    --cc=hch@lst.de \
    --cc=kbuild-all@01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=lkp@intel.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).