From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754852AbbBGKLK (ORCPT ); Sat, 7 Feb 2015 05:11:10 -0500 Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]:28076 "EHLO mail3-relais-sop.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751928AbbBGKLI (ORCPT ); Sat, 7 Feb 2015 05:11:08 -0500 X-IronPort-AV: E=Sophos;i="5.09,534,1418079600"; d="scan'208";a="99210900" Date: Sat, 7 Feb 2015 11:11:03 +0100 (CET) From: Julia Lawall X-X-Sender: jll@localhost6.localdomain6 To: Dan Carpenter cc: SF Markus Elfring , "James E. J. Bottomley" , QLogic-Storage-Upstream@qlogic.com, linux-scsi@vger.kernel.org, LKML , kernel-janitors@vger.kernel.org, Julia Lawall Subject: Re: [PATCH 2/4] SCSI-QLA4...: Less function calls in qla4xxx_is_session_exists() after error detection In-Reply-To: <20150207093322.GA5206@mwanda> Message-ID: References: <530CD2C4.4050903@users.sourceforge.net> <530CF8FF.8080600@users.sourceforge.net> <530DD06F.4090703@users.sourceforge.net> <5317A59D.4@users.sourceforge.net> <54D53BE4.7010807@users.sourceforge.net> <54D53CF1.8050009@users.sourceforge.net> <20150207093322.GA5206@mwanda> User-Agent: Alpine 2.02 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 7 Feb 2015, Dan Carpenter wrote: > On Fri, Feb 06, 2015 at 11:15:13PM +0100, SF Markus Elfring wrote: > > diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c > > index 2a00fd3..a7ca479 100644 > > --- a/drivers/scsi/qla4xxx/ql4_os.c > > +++ b/drivers/scsi/qla4xxx/ql4_os.c > > @@ -6327,17 +6327,15 @@ static int qla4xxx_is_session_exists(struct scsi_qla_host *ha, > > uint32_t *index) > > { > > struct ddb_entry *ddb_entry; > > - struct ql4_tuple_ddb *fw_tddb = NULL; > > - struct ql4_tuple_ddb *tmp_tddb = NULL; > > int idx; > > int ret = QLA_ERROR; > > + struct ql4_tuple_ddb *tmp_tddb; > > + struct ql4_tuple_ddb *fw_tddb = vzalloc(sizeof(*fw_tddb)); > > > > Don't do allocations in the initializers. Same for patches 3 and 4 as > well. Why not? I can think of some reasons, but I am wondering what is the precise one. thanks, julia