All of lore.kernel.org
 help / color / mirror / Atom feed
From: Manohar Vanga <manohar.vanga@cern.ch>
To: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	<devel@driverdev.osuosl.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 2/3] Staging: ipack: added support for the TEWS TPCI-200 carrier board
Date: Mon, 7 May 2012 10:20:07 +0200	[thread overview]
Message-ID: <20120507082007.GA30608@becoht-mvanga> (raw)
In-Reply-To: <1336375569-21692-2-git-send-email-siglesias@igalia.com>

Hey Samuel,

Just a couple of quick comments on this patch :)

> +TPCI-200
> +--------
> +
> +* It receives the name of the mezzanine plugged in each slot by SYSFS.
> +  No autodetection supported yet, because the mezzanine driver could not be
> +  loaded at the time that the tpci200 driver loads.
> +
> +* It has a linked list with the tpci200 devices it is managing. Get rid of it
> +  and use driver_for_each_device() instead.
> +
>  Ipack
>  -----
>  
> @@ -20,4 +30,3 @@ Ipack
>    remove_device() to notify the carrier driver, or the opposite with the call to
>    the ipack_driver_ops' remove() function could be improved.
>  
> -

Is this whitespace change required?

> +#include <linux/module.h>
> +#include "tpci200.h"
> +
> +#define MODULE_NAME "tpci200"

Here you can just use the KBUILD_MODNAME variable

> +#define PFX MODULE_NAME ": "

You can also add this before all your includes:
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

> +static int tpci200_install(struct tpci200_board *tpci200)
> +{
> +	int res = 0;
> +
> +	tpci200->slots = kzalloc(TPCI200_NB_SLOT * sizeof(struct tpci200_slot), GFP_KERNEL);

Did you run checkpatch.pl on the patches? Are you ignoring the >80 char
recommendation? In that case ignore this :)

> +static struct pci_device_id tpci200_idtable[2]; /* last must be zero */
> +
> +static struct pci_driver tpci200_pci_drv = {
> +	.name = "tpci200",
> +	.id_table = tpci200_idtable,
> +	.probe = tpci200_pciprobe,
> +	.remove = __devexit_p(tpci200_pci_remove),
> +};
> +
> +static int __init tpci200_drvr_init_module(void)
> +{
> +	tpci200_idtable[0].vendor = TPCI200_VENDOR_ID;
> +	tpci200_idtable[0].device = TPCI200_DEVICE_ID;
> +	tpci200_idtable[0].subvendor = TPCI200_SUBVENDOR_ID;
> +	tpci200_idtable[0].subdevice = TPCI200_SUBDEVICE_ID;
> +	return pci_register_driver(&tpci200_pci_drv);
> +}

Can't tpci200_idtable be statically declared instead of inside the init function?

> +static void __exit tpci200_drvr_exit_module(void)
> +{
> +	struct tpci200_board *tpci200;
> +	struct list_head *element, *next;
> +
> +	list_for_each_safe(element, next, &tpci200_list) {
> +		tpci200 = list_entry(element, struct tpci200_board, list);
> +		__tpci200_pci_remove(tpci200);
> +	}

You can use list_for_each_entry_safe instead of list_for_each_safe + list_entry.
I think you've used this everywhere so this would apply to the whole patch :)

-- 
/manohar

  reply	other threads:[~2012-05-07  8:31 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1336375569-21692-1-git-send-email-siglesias@igalia.com>
2012-05-07  7:26 ` [PATCH v2 2/3] Staging: ipack: added support for the TEWS TPCI-200 carrier board Samuel Iglesias Gonsalvez
2012-05-07  8:20   ` Manohar Vanga [this message]
2012-05-07  8:36     ` Samuel Iglesias Gonsálvez
2012-05-07  7:26 ` [PATCH v2 3/3] Staging: ipack: add support for IP-OCTAL mezzanine board Samuel Iglesias Gonsalvez
2012-05-07  8:40   ` Dan Carpenter
2012-05-07  8:04 ` [PATCH v2 1/3] Staging: IndustryPack bus for the Linux Kernel Dan Carpenter
2012-05-07  8:24   ` Samuel Iglesias Gonsálvez
2012-05-07 14:24     ` Samuel Iglesias Gonsálvez

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=20120507082007.GA30608@becoht-mvanga \
    --to=manohar.vanga@cern.ch \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=siglesias@igalia.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.