Xilinx: hwicap driver comments

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Stephen Neuendorffer <stephen.neuendorffer@...>, Grant Likely <grant.likely@...>
Cc: Linux Kernel Mailing List <linux-kernel@...>, Andrew Morton <akpm@...>
Date: Thursday, February 7, 2008 - 4:08 pm

Hi,

first of all, I think that the driver should go through lkml before upstream 
merge or at least be in -mm for a while (I think this used to be a rule some 
time ago), correct me if I'm wrong, but none of it happened.

Few comments I have:
- release f_op retval is silently ignored, I guess you will get your device into 
undefined state when the first function fails (esp. when you interrupt the sem)
- semaphores are deprecated
- class_device_create is deprecated
- module_init/exit functions should be __init, not __devinit/exit (not a bug, 
it's subset)
- this piece:
         drvdata = kmalloc(sizeof(struct hwicap_drvdata), GFP_KERNEL);
         if (!drvdata) {
                 dev_err(dev, "Couldn't allocate device private record\n");
                 return -ENOMEM;
         }
  memset((void *)drvdata, 0, sizeof(struct hwicap_drvdata));

  kmalloc + memset = kzalloc
  null probed_devices[id] on that fail path and on failed1 label

- from/to (void *) casts are useless
- io resources are at least ulong
- don't understand this:
                 memcpy(kbuf, drvdata->read_buffer, bytes_remaining);
                 drvdata->read_buffer_in_use = bytes_remaining;
                 free_page((unsigned long)kbuf);
- can this overlap (=>memmove)?
                 memcpy(drvdata->read_buffer + bytes_to_read,
                                 drvdata->read_buffer, 4 - bytes_to_read);
- is platform probing function race-proof (like pci)?
- run sparse on it, you mix __user with non-__user at least
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Xilinx: hwicap driver comments, Jiri Slaby, (Thu Feb 7, 4:08 pm)
RE: Xilinx: hwicap driver comments, Stephen Neuendorffer, (Fri Feb 8, 1:08 pm)
[PATCH] [POWERPC] Xilinx: hwicap driver, Stephen Neuendorffer, (Thu Feb 7, 10:17 pm)
Re: [PATCH] [POWERPC] Xilinx: hwicap driver, Randy Dunlap, (Fri Feb 8, 12:49 pm)
Re: [PATCH] [POWERPC] Xilinx: hwicap driver, Jiri Slaby, (Fri Feb 8, 5:10 am)
RE: Xilinx: hwicap driver comments, Stephen Neuendorffer, (Thu Feb 7, 6:31 pm)
Re: Xilinx: hwicap driver comments, Jiri Slaby, (Thu Feb 7, 6:39 pm)
Re: Xilinx: hwicap driver comments, Benjamin Herrenschmidt, (Thu Feb 7, 5:17 pm)
Re: Xilinx: hwicap driver comments, Jiri Slaby, (Thu Feb 7, 5:28 pm)
Re: Xilinx: hwicap driver comments, Benjamin Herrenschmidt, (Thu Feb 7, 5:33 pm)
Re: Xilinx: hwicap driver comments, Grant Likely, (Thu Feb 7, 5:35 pm)
Re: Xilinx: hwicap driver comments, Andrew Morton, (Thu Feb 7, 4:42 pm)
Re: Xilinx: hwicap driver comments, Josh Boyer, (Thu Feb 7, 5:35 pm)
Re: Xilinx: hwicap driver comments, Andrew Morton, (Thu Feb 7, 6:11 pm)
Re: Xilinx: hwicap driver comments, Josh Boyer, (Thu Feb 7, 6:58 pm)
Re: Xilinx: hwicap driver comments, Grant Likely, (Thu Feb 7, 4:54 pm)
Re: Xilinx: hwicap driver comments, Benjamin Herrenschmidt, (Thu Feb 7, 5:25 pm)
Re: Xilinx: hwicap driver comments, Andrew Morton, (Thu Feb 7, 5:21 pm)
Re: Xilinx: hwicap driver comments, Linus Torvalds, (Thu Feb 7, 5:40 pm)
Re: Xilinx: hwicap driver comments, Grant Likely, (Thu Feb 7, 5:31 pm)
RE: Xilinx: hwicap driver comments, Stephen Neuendorffer, (Thu Feb 7, 5:35 pm)
Re: Xilinx: hwicap driver comments, Andrew Morton, (Thu Feb 7, 5:53 pm)
RE: Xilinx: hwicap driver comments, Stephen Neuendorffer, (Thu Feb 7, 6:00 pm)
Re: Xilinx: hwicap driver comments, Grant Likely, (Thu Feb 7, 4:34 pm)
RE: Xilinx: hwicap driver comments, Stephen Neuendorffer, (Thu Feb 7, 5:10 pm)