public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Marcel Holtmann <marcel@holtmann.org>
To: Abhay Salunke <Abhay_Salunke@dell.com>
Cc: linux-kernel@vger.kernel.org, Andrew Morton <akpm@osdl.org>,
	matt_domsch@dell.com, Greg KH <greg@kroah.com>
Subject: Re: [patch 2.6.12-rc3] dell_rbu: Resubmitting patch for new Dell BIOS update driver
Date: Fri, 03 Jun 2005 01:58:48 +0200	[thread overview]
Message-ID: <1117756728.3656.45.camel@pegasus> (raw)
In-Reply-To: <20050602232634.GA32462@littleblue.us.dell.com>

Hi Abhay,

> Resubmitting after cleaning up spaces/tabs etc...

and now starting with the coding style nitpicking ;)

> +	/* check if we have any packets */
> +	if (0 == rbu_data.num_packets) {

Make it "if (!rbu_data.num_packets) {".

> +	while(--packet_count) {
> +		ptemp_list = ptemp_list->next;
> +	}

Don't forget the space between "while" and "(" and the "{"/"}" are not
needed.

> +	ppacket = list_entry(ptemp_list,struct packet_data, list);

We always put a space after ",".

> +	if ((rbu_data.packet_write_count + length) > rbu_data.packetsize) {

Make it "(rbu_data.packet_write_count + length > rbu_data.packetsize)".

> +	/* copy the incoming data in to the new buffer */
> +	memcpy((ppacket->data + rbu_data.packet_write_count),
> +			data, length);

Make it "memcpy(ppacket->data + rbu_data.packet_write_count, ".

> +	if ((rbu_data.packet_write_count + length) == rbu_data.packetsize) {
> +		/*
> +		 this was the last data chunk in the packet
> +		 so reinitialize the packet data counter to zero
> +		*/
> +		rbu_data.packet_write_count = 0;
> +	} else
> +		rbu_data.packet_write_count += length;

Why not:

	rbu_data.packet_write_count += length;
	if (rbu_data.packet_write_count == rbu_data.packetsize)
		rbu_data.packet_write_count = 0;

> +	/* try allocating a new buffer to fit the request */
> +	pbuf =(unsigned char *)__get_free_pages(GFP_KERNEL, *ordernum);

Forgot a space after "=" and after "...char*)".

> +	if (pbuf != NULL) {

Make it "if (!pbuf)",

> +		/* check if the image is with in limits */
> +		img_buf_phys_addr = (unsigned long)virt_to_phys(pbuf);

Put a space after "...long)".

> +		if ((limit != 0) && ((img_buf_phys_addr + size) > limit)) {

Make it "if (!limit && img_bug_phys_addr + size > limit)"

> +			free_pages ((unsigned long)pbuf, *ordernum);

Space.

> +			 Try allocating a new buffer from the 
> +			 GFP_DMA range as it is with in 16MB range.
> +			*/
> +			pbuf =(unsigned char *)__get_free_pages(GFP_DMA,

Space.

> +			if (pbuf == NULL)

Use "(!pbuf)".

> +	if (rbu_data.packetsize == 0 ) {

Use "if (!rbu_data.packetsize)".

> +	if(newpacket == NULL) {

Use "if (!newpacket)".

> +	if(newpacket->data == NULL) {

Use "if (!newpacket->data)"

> +	if (rbu_data.packet_write_count == 0) {
> +		if ((rc = create_packet(length)) != 0 )
> +			return rc;
> +	}

Use this:

	if (!rbu_data.packet_write_count)
		if (!(rc = create_packet(length)))
			return rc;

> +	if ((rc = fill_last_packet(data, length)) != 0)

Use "if (!(rc = fill_last_packet(data, length)))".

> +		free_pages((unsigned long)newpacket->data, newpacket->ordernum);

Space.

> +	if (rbu_data.image_update_buffer == NULL)

Use "(!rbu_data.image_update_buffer)".

> +	free_pages((unsigned long)rbu_data.image_update_buffer,

Space.

> +		if ((size != 0) && (rbu_data.image_update_buffer == NULL)) {

Use "if (!size && !rbu_data.image_update_buffer)"

> +	image_update_buffer = (unsigned char *)get_free_pages_limited(size,

Space.

> +	if (image_update_buffer != NULL) {

Use "if (!image_update_buffer)".

> +		memset(rbu_data.image_update_buffer,0,

Space.

> +	sscanf(buf, "%d",&size);	

Spaces.

> +	if (size != 0)

Use "if (!size)".

> +	if (type == MONOLITHIC )

Space.

> +	if ( type == MONOLITHIC )

Spaces.

> +		size = sprintf(buf, "%lu\n",  rbu_data.bios_image_size);

Extra space not needed.

> +	if (type == MONOLITHIC ) 

Space.

> +	if (strlen(buf) >= 256 ) {

Space.

> +	if (type == MONOLITHIC ) {

Space.

> +	if (type == MONOLITHIC ) {

Space.

> +		if (fw_entry->size == 0 )

use "if (!fw_entry->size)".

> +				if (rc == 0) {

Use "if (!rc)".

> +		if ( rbu_data.packetsize != fw_entry->size )

Spaces.

> +		if ( rc == 0 )

Spaces.

> +static decl_subsys(dell_rbu,&ktype_dell_rbu,NULL);

Spaces.

> +        memset(rbu_dev, 0, sizeof (*rbu_dev));

No tab.

> +	if (type == MONOLITHIC)

Space.

> +		if (type == MONOLITHIC ) {

Space.

> +	if (rbu_dev != NULL) {

Use "if (!rbu_dev)".

> +static int __init dcdrbu_init(void)

What stand "dcd" for? Why not only "rbu_init"?

> +	if (rbu_download_mono == NULL) {	

Use "if (!rbu_download)".

> +	rbu_download_packet=  create_rbu_download_entry (PACKETIZED);

Wrong spaces.

> +	if (rbu_download_packet == NULL) {	

Use "if (!rbu_download_packet)".

> +	strncpy(rbu_device.bus_id,"firmware", BUS_ID_SIZE);

Space.

> +static __exit void dcdrbu_exit( void)

Why "dcd"?

> +config DELL_RBU
> +        tristate "BIOS update support for DELL systems via sysfs"
> +        default n
> +	select FW_LOADER

Space vs tab clash.

Regards

Marcel



  reply	other threads:[~2005-06-02 23:59 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-02 23:26 [patch 2.6.12-rc3] dell_rbu: Resubmitting patch for new Dell BIOS update driver Abhay Salunke
2005-06-02 23:58 ` Marcel Holtmann [this message]
2005-06-03 12:32   ` Andreas Henriksson
2005-06-05 21:51   ` Jesper Juhl
  -- strict thread matches above, loose matches on Subject: below --
2005-07-20 23:50 [patch 2.6.12-rc3]dell_rbu: " Abhay Salunke
2005-07-09  1:07 Abhay Salunke
2005-06-17 14:55 [patch 2.6.12-rc3] dell_rbu: " Abhay_Salunke
2005-06-17 15:29 ` Greg KH
2005-06-15 17:59 Abhay Salunke
2005-06-16 18:52 ` Greg KH
2005-06-20  0:36 ` Andrew Morton
2005-06-02 18:36 Abhay Salunke
2005-06-02 21:44 ` Marcel Holtmann
2005-05-26 18:43 Abhay_Salunke
2005-05-26 16:37 Abhay_Salunke
2005-05-26 16:56 ` Matt Domsch
2005-05-26 20:37 ` Greg KH
2005-05-26 21:36   ` Marcel Holtmann
2005-05-23 14:52 Abhay_Salunke
2005-05-23 14:58 ` Arjan van de Ven
2005-05-23 14:59 ` Marcel Holtmann
2005-05-23 15:48 ` Greg KH
2005-05-19 12:03 Abhay_Salunke
2005-05-19 14:42 ` Greg KH
2005-05-18 18:13 Abhay Salunke
2005-05-19  3:32 ` Greg KH
2005-05-13 19:00 Abhay Salunke
2005-05-13 21:11 ` Alexey Dobriyan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1117756728.3656.45.camel@pegasus \
    --to=marcel@holtmann.org \
    --cc=Abhay_Salunke@dell.com \
    --cc=akpm@osdl.org \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matt_domsch@dell.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox