linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mike Frysinger <vapier@gentoo.org>
To: Adrian McMenamin <adrian@newgolddream.dyndns.info>
Cc: Paul Mundt <lethal@linux-sh.org>, Greg KH <greg@kroah.com>,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	dwmw2 <dwmw2@infradead.org>, linux-sh <linux-sh@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	linux-input <linux-input@vger.kernel.org>,
	linux-mtd <linux-mtd@vger.kernel.org>
Subject: Re: [PATCH RFC] sh: maple: Add support for SEGA Dreamcast VMU and clean up maple bus driver (1/3)
Date: Wed, 28 Jan 2009 19:42:20 -0500	[thread overview]
Message-ID: <200901281942.22332.vapier@gentoo.org> (raw)
In-Reply-To: <1233187069.6734.21.camel@localhost.localdomain>

[-- Attachment #1: Type: text/plain, Size: 1940 bytes --]

On Wednesday 28 January 2009 18:57:49 Adrian McMenamin wrote:
> --- a/drivers/sh/maple/maple.c
> +++ b/drivers/sh/maple/maple.c
> -int maple_add_packet_sleeps(struct maple_device *mdev, u32 function,
> -	u32 command, size_t length, void *data)
> -{
> -	int locking, ret = 0;
> -	void *sendbuf = NULL;
> -
> -	locking = mutex_lock_interruptible(&mdev->mq->mutex);
> -	if (locking) {
> -		ret = -EIO;
> -		goto out;
> -	}
> +	int ret = 0;
> +	void *sendbuf;
>
> +	sendbuf = kzalloc(length * 4, GFP_KERNEL);
>  	if (length) {
> -		sendbuf = kmalloc(length * 4, GFP_KERNEL);

that looks wonky ... you do the alloc first and then check the len ?

>  failed_nomem:
> +	printk(KERN_INFO "maple: could not allocate memory\n");

should be a KERN_NOTICE or worse ... KERN_INFO doesnt seem appropriate

> +	if (device_register(&mdev->dev)) {
>  		printk(KERN_INFO
> -		"Maple bus: Attempt to register device"
> -		" (%x, %x) failed.\n",
> +			"Maple bus: Attempt to register device"
> +			" (%x, %x) failed.\n",

same here ... KERN_INFO shouldnt be used in error handlers

> +static void maple_response_fileerr(struct maple_device *mdev, void
> *recvbuf) +{
> +	if (mdev->fileerrhandler) {
> +		mdev->fileerrhandler(mdev, recvbuf);
> +		return;
> +	} else
> +		printk(KERN_INFO "maple: device (%d, %d) reports file error %d\n",
> +			mdev->port, mdev->unit, ((int *)recvbuf)[1]);
> +}

and here ...

>  			case MAPLE_RESPONSE_AGAIN:
>  			case MAPLE_RESPONSE_BADCMD:
>  			case MAPLE_RESPONSE_BADFUNC:
> -				printk(KERN_DEBUG
> +				printk(KERN_INFO
>  				       "Maple non-fatal error 0x%X\n",
>  				       code);

and here ...

>  /* Maple Bus command and response codes */
>  enum maple_code {
> +	MAPLE_RESPONSE_FILEERR =	-5,
> +	MAPLE_RESPONSE_AGAIN =		-4,	/* retransmit */

do you really need to set every value ?  i would only bother when there's a 
discontinuity ...
-mike

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 835 bytes --]

  parent reply	other threads:[~2009-01-29  0:42 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-28 23:47 [PATCH RFC] sh: maple: Add support for SEGA Dreamcast VMU and clean up maple bus driver (0/3) Adrian McMenamin
2009-01-28 23:57 ` [PATCH RFC] sh: maple: Add support for SEGA Dreamcast VMU and clean up maple bus driver (1/3) Adrian McMenamin
2009-01-29  0:09   ` [PATCH RFC] sh: maple: Add support for SEGA Dreamcast VMU and clean up maple bus driver (2/3) Adrian McMenamin
2009-01-29  0:18     ` [PATCH RFC] sh: maple: Add support for SEGA Dreamcast VMU and clean up maple bus driver (3/3) Adrian McMenamin
2009-01-29  2:57       ` Paul Mundt
2009-01-29 10:34         ` Adrian McMenamin
2009-01-29  5:46       ` Mike Frysinger
2009-01-29  0:44     ` [PATCH RFC] sh: maple: Add support for SEGA Dreamcast VMU and clean up maple bus driver (2/3) Mike Frysinger
2009-01-29  0:49       ` Adrian McMenamin
2009-01-29  1:12         ` Mike Frysinger
2009-01-29  0:42   ` Mike Frysinger [this message]
2009-01-29  3:13   ` [PATCH RFC] sh: maple: Add support for SEGA Dreamcast VMU and clean up maple bus driver (1/3) Paul Mundt
2009-01-29 16:43     ` Adrian McMenamin
     [not found]     ` <3ca9ec7a13c1a13ea7be6c37bbdfdb0c.squirrel@newgolddream.dyndns.info>
2009-01-29 16:51       ` Adrian McMenamin
2009-01-30  9:55         ` Adrian McMenamin

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=200901281942.22332.vapier@gentoo.org \
    --to=vapier@gentoo.org \
    --cc=adrian@newgolddream.dyndns.info \
    --cc=dmitry.torokhov@gmail.com \
    --cc=dwmw2@infradead.org \
    --cc=greg@kroah.com \
    --cc=lethal@linux-sh.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@vger.kernel.org \
    --cc=linux-sh@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).