public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ralf Baechle <ralf@linux-mips.org>
To: Randy Dunlap <rdunlap@xenotime.net>
Cc: Wim Van Sebroeck <wim@iguana.be>,
	Thomas Koeller <thomas@koeller.dyndns.org>,
	Dave Jones <davej@redhat.com>,
	Alan Cox <alan@lxorguk.ukuu.org.uk>,
	Sam Ravnborg <sam@ravnborg.org>,
	Alexey Dobriyan <adobriyan@gmail.com>,
	linux-kernel@vger.kernel.org, linux-mips@linux-mips.org
Subject: Re: [PATCH] Added MIPS RM9K watchdog driver
Date: Thu, 2 Nov 2006 14:04:51 +0000	[thread overview]
Message-ID: <20061102140450.GE16883@linux-mips.org> (raw)
In-Reply-To: <20061101221125.73505baa.rdunlap@xenotime.net>

On Wed, Nov 01, 2006 at 10:11:25PM -0800, Randy Dunlap wrote:

> > 	wd_regs = ioremap_nocache(rr->start, rr->end + 1 - rr->start);
> > 	if (unlikely(!wd_regs))
> > 		return -ENOMEM;
> 
> There's no way to return the resources on failure?

MIPS drivers (and this one is specific to a particular MIPS SOC) are
generally a bit sloopy about checking of return values of ioremap because
ioremap is only doing some address arithmetic but no allocations that
actually could fail.  So for 64-bit kernels or addresses below 0x20000000
on a 32-bit system ioremap cannot fail.  In the same cases ioremap happens
to be a no-op because where nothing was allocated nothing needs to be
freed.

> > 			if (unlikely(__copy_from_user(&val, (const void __user *) arg,

Note to self, __copy_from_user and gang are generally assume to not
return an error so it might be a good idea to move that unlikely() into
the macro definitions.

  Ralf

  reply	other threads:[~2006-11-02 14:04 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-01 18:46 [PATCH] Added MIPS RM9K watchdog driver Wim Van Sebroeck
2006-11-01 18:50 ` Ralf Baechle
2006-11-01 19:11   ` Wim Van Sebroeck
2006-11-01 20:43 ` Sam Ravnborg
2006-11-02  6:11 ` Randy Dunlap
2006-11-02 14:04   ` Ralf Baechle [this message]
  -- strict thread matches above, loose matches on Subject: below --
2006-08-10 21:19 thomas
2006-08-11 20:07 ` Alan Cox
2006-08-12 16:06   ` Thomas Koeller
2006-08-12 22:41     ` Ralf Baechle
2006-08-12 17:45   ` Thomas Koeller
2006-08-12 20:43     ` Alan Cox
2006-08-11 20:56 ` Dave Jones
2006-08-11 23:49   ` Thomas Koeller
2006-08-11 22:06     ` Oleg Verych
2006-08-12  0:06     ` Dave Jones
2006-08-12  0:22       ` Ralf Baechle
2006-08-14 14:14     ` Joseph Fannin
2006-08-14 15:30       ` Sam Ravnborg
2006-08-14 16:21         ` Randy.Dunlap
2006-08-14 16:26           ` Dave Jones
2006-08-14 16:27           ` Roland Dreier
2006-08-14 15:50     ` Wim Van Sebroeck
2006-08-14 17:25 ` Luca

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=20061102140450.GE16883@linux-mips.org \
    --to=ralf@linux-mips.org \
    --cc=adobriyan@gmail.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=davej@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@linux-mips.org \
    --cc=rdunlap@xenotime.net \
    --cc=sam@ravnborg.org \
    --cc=thomas@koeller.dyndns.org \
    --cc=wim@iguana.be \
    /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