Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758550AbYJPXHd (ORCPT ); Thu, 16 Oct 2008 19:07:33 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1758664AbYJPXHD (ORCPT ); Thu, 16 Oct 2008 19:07:03 -0400 Received: from smtp1.linux-foundation.org ([140.211.169.13]:36646 "EHLO smtp1.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758651AbYJPXG7 (ORCPT ); Thu, 16 Oct 2008 19:06:59 -0400 Date: Thu, 16 Oct 2008 16:06:00 -0700 From: Andrew Morton To: Mike Miller Cc: jens.axboe@oracle.com, linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org Subject: Re: [PATCH 2/2] cciss: fix regression firmware version not displayed in procfs (again) Message-Id: <20081016160600.685e53cd.akpm@linux-foundation.org> In-Reply-To: <20081016224858.GB26564@roadking.ldev.net> References: <20081016224858.GB26564@roadking.ldev.net> X-Mailer: Sylpheed version 2.2.4 (GTK+ 2.8.20; i486-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2178 Lines: 64 On Thu, 16 Oct 2008 17:48:58 -0500 Mike Miller wrote: > Patch 2 of 2 > > The regression was introduced by commit > 6ae5ce8e8d4de666f31286808d2285aa6a50fa40. > This patch fixes a regression where the controller firmware version is not > displayed in procfs. The previous patch would be called anytime something > changed. This will get called only once for each controller. > Please consider this for inclusion. > > Signed-off-by: Mike Miller > > diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c > index 0f367b1..1c830bd 100644 > --- a/drivers/block/cciss.c > +++ b/drivers/block/cciss.c > @@ -3404,7 +3404,8 @@ static int __devinit cciss_init_one(struct pci_dev *pdev, > int i; > int j = 0; > int rc; > - int dac; > + int dac, return_code; > + InquiryData_struct *inq_buff = NULL; unneeded initialisation is still there. > i = alloc_cciss_hba(); > if (i < 0) > @@ -3510,6 +3511,25 @@ static int __devinit cciss_init_one(struct pci_dev *pdev, > /* Turn the interrupts on so we can service requests */ > hba[i]->access.set_intr_mask(hba[i], CCISS_INTR_ON); > > + /* Get the firmware version */ > + inq_buff = kzalloc(sizeof(InquiryData_struct), GFP_KERNEL); Does this ever get freed? > + if (inq_buff == NULL) { > + printk(KERN_ERR "cciss: out of memory\n"); > + return -ENOMEM; > + } > + > + return_code = sendcmd_withirq(CISS_INQUIRY, i, inq_buff, > + sizeof(InquiryData_struct), 0, 0 , 0, TYPE_CMD); > + if (return_code == IO_OK) { > + hba[i]->firm_ver[0] = inq_buff->data_byte[32]; > + hba[i]->firm_ver[1] = inq_buff->data_byte[33]; > + hba[i]->firm_ver[2] = inq_buff->data_byte[34]; > + hba[i]->firm_ver[3] = inq_buff->data_byte[35]; > + } else { /* send command failed */ > + printk(KERN_WARNING "cciss: unable to determine firmware" > + " version of controller\n"); > + } > + > cciss_procinit(i); > > hba[i]->cciss_max_sectors = 2048; -- 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/