Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753538AbbL2NgT (ORCPT ); Tue, 29 Dec 2015 08:36:19 -0500 Received: from mail-lb0-f175.google.com ([209.85.217.175]:34104 "EHLO mail-lb0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752717AbbL2NgQ convert rfc822-to-8bit (ORCPT ); Tue, 29 Dec 2015 08:36:16 -0500 MIME-Version: 1.0 In-Reply-To: <1451395493-22380-1-git-send-email-prtvar.b@gmail.com> References: <1451395493-22380-1-git-send-email-prtvar.b@gmail.com> Date: Tue, 29 Dec 2015 14:36:14 +0100 Message-ID: Subject: Re: [PATCH] resources: Remove unneeded initialization of local variable From: Laurent Navet To: Bojan Prtvar Cc: toshi.kani@hp.com, dan.j.williams@intel.com, akpm@linux-foundation.org, jsitnicki@gmail.com, jiang.liu@linux.intel.com, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1630 Lines: 51 why not directly ? struct region_devres *dr = devres_alloc(devm_region_release, sizeof(struct region_devres),.. 2015-12-29 14:24 UTC+01:00, Bojan Prtvar : > Few lines below dr is reinitialized by devres_alloc() > so we don't need to init it by NULL in the beginning of > __devm_request_region() > > Signed-off-by: Bojan Prtvar > --- > kernel/resource.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/kernel/resource.c b/kernel/resource.c > index f150dbb..1e48ede 100644 > --- a/kernel/resource.c > +++ b/kernel/resource.c > @@ -1356,7 +1356,7 @@ struct resource * __devm_request_region(struct device > *dev, > struct resource *parent, resource_size_t start, > resource_size_t n, const char *name) > { > - struct region_devres *dr = NULL; > + struct region_devres *dr; > struct resource *res; > > dr = devres_alloc(devm_region_release, sizeof(struct region_devres), > -- > 2.4.1 > > -- > To unsubscribe from this list: send the line "unsubscribe kernel-janitors" > in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > -- « On ne résout pas un problème avec les modes de pensée qui l’ont engendré. » « You cannot solve current problems with current thinking. Current problems are the result of current thinking » -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/