lkml.org 
[lkml]   [2010]   [Nov]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRE: [patch v2] dca: remove unneeded NULL check
Dan Carpenter wrote:
> The return here doesn't release the locks or re-enable IRQs. But as
> Andrew Morton points out, domain is never NULL. list_first_entry()
> essentially never returns NULL and also we already verified that the
> list is not empty.
>
> Signed-off-by: Dan Carpenter <error27@gmail.com>
>
> diff --git a/drivers/dca/dca-core.c b/drivers/dca/dca-core.c index
> b98c676..c461eda 100644
> --- a/drivers/dca/dca-core.c
> +++ b/drivers/dca/dca-core.c
> @@ -110,8 +110,6 @@ static void unregister_dca_providers(void)
>
> /* at this point only one domain in the list is expected */
> domain = list_first_entry(&dca_domains, struct dca_domain, node);
> - if (!domain)
> - return;
>
> list_for_each_entry_safe(dca, _dca, &domain->dca_providers, node) {
> list_del(&dca->node);

Acked-by: Maciej Sosnowski <maciej.sosnowski@intel.com>


\
 
 \ /
  Last update: 2010-11-22 17:53    [W:0.038 / U:0.452 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site