Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761451AbZJIVX4 (ORCPT ); Fri, 9 Oct 2009 17:23:56 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1760973AbZJIVXz (ORCPT ); Fri, 9 Oct 2009 17:23:55 -0400 Received: from rcsinet11.oracle.com ([148.87.113.123]:40953 "EHLO rgminet11.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760915AbZJIVXy (ORCPT ); Fri, 9 Oct 2009 17:23:54 -0400 Date: Fri, 9 Oct 2009 14:23:03 -0700 From: Randy Dunlap To: Bruce Beare Cc: Greg Kroah-Hartman , Bill Pemberton , devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] Cleanups for: line length, printk KERN_ argument, stack frame size > 2048 (added a kmalloc/kfree), style/formatting errors, incorrect include files Message-Id: <20091009142303.c807a531.randy.dunlap@oracle.com> In-Reply-To: <1255122698-12390-1-git-send-email-bbeare1@gmail.com> References: <1255122698-12390-1-git-send-email-bbeare1@gmail.com> Organization: Oracle Linux Eng. X-Mailer: Sylpheed 2.7.1 (GTK+ 2.12.0; x86_64-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Source-IP: acsmt353.oracle.com [141.146.40.153] X-Auth-Type: Internal IP X-CT-RefId: str=0001.0A090202.4ACFA9BE.007B:SCFMA4539814,ss=1,fgs=0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2658 Lines: 75 On Fri, 9 Oct 2009 14:11:38 -0700 Bruce Beare wrote: > --- > drivers/staging/comedi/drivers/serial2002.c | 342 +++++++++++--------------- > 1 files changed, 145 insertions(+), 197 deletions(-) > > diff --git a/drivers/staging/comedi/drivers/serial2002.c b/drivers/staging/comedi/drivers/serial2002.c > index a219679..0232186 100644 > --- a/drivers/staging/comedi/drivers/serial2002.c > +++ b/drivers/staging/comedi/drivers/serial2002.c > @@ -413,34 +408,37 @@ static void serial_2002_open(struct comedi_device *dev) > int min; > int max; > }; > + struct config_data_t { > + struct config_t dig_in_config[32]; > + struct config_t dig_out_config[32]; > + struct config_t chan_in_config[32]; > + struct config_t chan_out_config[32]; > + } *config_data = NULL; > > - struct config_t dig_in_config[32]; > - struct config_t dig_out_config[32]; > - struct config_t chan_in_config[32]; > - struct config_t chan_out_config[32]; > int i; > + config_data = kmalloc(sizeof(struct config_data_t), GFP_KERNEL); what happens when the kmalloc() fails?? > > for (i = 0; i < 32; i++) { > - dig_in_config[i].kind = 0; > - dig_in_config[i].bits = 0; > - dig_in_config[i].min = 0; > - dig_in_config[i].max = 0; > - dig_out_config[i].kind = 0; > - dig_out_config[i].bits = 0; > - dig_out_config[i].min = 0; > - dig_out_config[i].max = 0; > - chan_in_config[i].kind = 0; > - chan_in_config[i].bits = 0; > - chan_in_config[i].min = 0; > - chan_in_config[i].max = 0; > - chan_out_config[i].kind = 0; > - chan_out_config[i].bits = 0; > - chan_out_config[i].min = 0; > - chan_out_config[i].max = 0; > + config_data->dig_in_config[i].kind = 0; > + config_data->dig_in_config[i].bits = 0; > + config_data->dig_in_config[i].min = 0; > + config_data->dig_in_config[i].max = 0; > + config_data->dig_out_config[i].kind = 0; > + config_data->dig_out_config[i].bits = 0; > + config_data->dig_out_config[i].min = 0; > + config_data->dig_out_config[i].max = 0; > + config_data->chan_in_config[i].kind = 0; > + config_data->chan_in_config[i].bits = 0; > + config_data->chan_in_config[i].min = 0; > + config_data->chan_in_config[i].max = 0; > + config_data->chan_out_config[i].kind = 0; > + config_data->chan_out_config[i].bits = 0; > + config_data->chan_out_config[i].min = 0; > + config_data->chan_out_config[i].max = 0; > } --- ~Randy -- 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/