Re: [PATCH] Topcliff PHUB: Generate PacketHub driver

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Arnd Bergmann
Date: Thursday, June 17, 2010 - 4:59 am

Looks almost good to me now. Some more details (only the -EFAULT return code
is a real issue, the other ones are cosmetic changes):

On Thursday 17 June 2010, Masayuki Ohtak wrote:

I'd recommend just getting rid of these abstractions. You only use
them in one or two functions each, so you can just as well add a local
variable there and do

	void __iomem *p = pch_phub_reg.pch_phub_base_address;
	foo = ioread32(p + foo_offset);
	bar = ioread32(p + bar_offset);
	...

Not really important, but this way it would be more conventional
without having to write extra code.


It would be better to drop the _t postfix on the type name.
By convention, we use this only for typedefs on simple data
types like off_t but not for structures.


When I told you to change the ioctl arguments to use __u32 instead
of u32, I was only referring to those parts that are in the user-visible
section of the header file. While it does not hurt to use __u32 in
the kernel, you should understand the distinction.


No need to make data static.


You should return -EFAULT if the get_user() call fails, otherwise you have
a possible security hole. If pch_phub_write_serial_rom fails, the correct
return code would be -EIO.


If would be good to add a line of
	.llseek = default_llseek,
here. I have a patch to change the default llseek method to one
that disallows seeking, so if you add this line, there is one
less driver for me to patch.

	Arnd
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] Topcliff PHUB: Generate PacketHub driver, Masayuki Ohtak, (Mon Jun 7, 5:39 am)
Re: [PATCH] Topcliff PHUB: Generate PacketHub driver, Masayuki Ohtake, (Mon Jun 7, 5:19 pm)
Re: [PATCH] Topcliff PHUB: Generate PacketHub driver, Masayuki Ohtak, (Mon Jun 14, 5:09 am)
Re: [PATCH] Topcliff PHUB: Generate PacketHub driver, Arnd Bergmann, (Mon Jun 14, 5:50 am)
Re: [PATCH] Topcliff PHUB: Generate PacketHub driver, Masayuki Ohtake, (Mon Jun 14, 4:56 pm)
Re: [PATCH] Topcliff PHUB: Generate PacketHub driver, Masayuki Ohtake, (Mon Jun 14, 11:25 pm)
Re: [PATCH] Topcliff PHUB: Generate PacketHub driver, Arnd Bergmann, (Tue Jun 15, 3:42 am)
Re: [PATCH] Topcliff PHUB: Generate PacketHub driver, Masayuki Ohtake, (Tue Jun 15, 5:12 am)
Re: [PATCH] Topcliff PHUB: Generate PacketHub driver, Masayuki Ohtak, (Wed Jun 16, 7:43 pm)
Re: [PATCH] Topcliff PHUB: Generate PacketHub driver, Arnd Bergmann, (Thu Jun 17, 4:59 am)
Re: [PATCH] Topcliff PHUB: Generate PacketHub driver, Masayuki Ohtake, (Thu Jun 17, 4:49 pm)
RE: [PATCH] Topcliff PHUB: Generate PacketHub driver, Wang, Yong Y, (Fri Jun 18, 1:08 am)
Re: [PATCH] Topcliff PHUB: Generate PacketHub driver, Masayuki Ohtake, (Fri Jun 18, 4:39 am)