All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jiri Slaby <jirislaby@gmail.com>
To: Stephen Neuendorffer <stephen.neuendorffer@xilinx.com>,
	Grant Likely <grant.likely@secretlab.ca>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Xilinx: hwicap driver comments
Date: Thu, 07 Feb 2008 21:08:50 +0100	[thread overview]
Message-ID: <47AB6552.7040503@gmail.com> (raw)

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

             reply	other threads:[~2008-02-07 20:12 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-07 20:08 Jiri Slaby [this message]
2008-02-07 20:34 ` Xilinx: hwicap driver comments Grant Likely
2008-02-07 21:10   ` Stephen Neuendorffer
2008-02-07 20:42 ` Andrew Morton
2008-02-07 20:54   ` Grant Likely
2008-02-07 21:21     ` Andrew Morton
2008-02-07 21:31       ` Grant Likely
2008-02-07 21:35         ` Stephen Neuendorffer
2008-02-07 21:53           ` Andrew Morton
2008-02-07 22:00             ` Stephen Neuendorffer
2008-02-07 21:40       ` Linus Torvalds
2008-02-07 21:25     ` Benjamin Herrenschmidt
2008-02-07 21:35   ` Josh Boyer
2008-02-07 22:11     ` Andrew Morton
2008-02-07 22:58       ` Josh Boyer
2008-02-07 21:17 ` Benjamin Herrenschmidt
2008-02-07 21:28   ` Jiri Slaby
2008-02-07 21:33     ` Benjamin Herrenschmidt
2008-02-07 21:35       ` Grant Likely
2008-02-07 22:31 ` Stephen Neuendorffer
2008-02-07 22:39   ` Jiri Slaby
2008-02-08  2:17 ` [PATCH] [POWERPC] Xilinx: hwicap driver Stephen Neuendorffer
2008-02-08  2:17   ` Stephen Neuendorffer
2008-02-08  9:10   ` Jiri Slaby
2008-02-08  9:10     ` Jiri Slaby
2008-02-08 16:49   ` Randy Dunlap
2008-02-08 16:49     ` Randy Dunlap
2008-02-08 17:08 ` Xilinx: hwicap driver comments Stephen Neuendorffer

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=47AB6552.7040503@gmail.com \
    --to=jirislaby@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=grant.likely@secretlab.ca \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stephen.neuendorffer@xilinx.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.