Subject: Re: [PATCH v2 01/27] HFI: skeleton driver

From: Jim Dykman <[email-masked]>
Date: Thu, 21 Apr 2011 17:38:13 -0400

On 4/18/2011 8:23 AM, Ben Hutchings wrote:
> On Sun, 2011-04-17 at 23:21 -0400, [email-masked] wrote:
>> From: Jim Dykman <[email-masked]>
>>
>> Device driver Makefile & Kconfig plumbing plus simple mod_init and mod_exit
> [...]
>> --- /dev/null
>> +++ b/drivers/net/hfi/core/hfidd_init.c
> [...]
>> +#include <linux/version.h>
> 
> Never include <linux/version.h> in an in-tree driver.
> 

Ok

> [...]
>> +static int __init hfidd_mod_init(void)
>> +{
>> +	int			rc = 0;
>> +
>> +	rc = hfidd_create_class();
>> +	if (rc < 0) {
>> +		printk(KERN_ERR "%s: hfidd_mod_init: hfidd_create_class failed"
>> +			" rc=%d\n", HFIDD_DEV_NAME, rc);
>> +		return -1;
> 
> Should be 'return rc'.
> 

Ok

> [...]
>> --- /dev/null
>> +++ b/include/linux/hfi/hfidd_client.h
> [...]
>> +#ifndef _HFIDD_CLIENT_H_
>> +#define _HFIDD_CLIENT_H_
>> +
>> +#define MAX_TORRENTS            1
>> +#define MAX_HFI_PER_TORRENT     2
>> +#define MAX_HFIS                (MAX_TORRENTS * MAX_HFI_PER_TORRENT)
> [...]
> 
> Are you sure you want to expose these values to userland?  You can never
> change them later.
> 

We really don't expect them to change, so we're comfortable with defines for them.

> Ben.
Thanks for the reviews Ben.

Jim