Re: [PATCH 1/6 v10] ARM: Add basic architecture support for VIA/WonderMedia 85xx SoC's

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Ryan Mallon
Date: Wednesday, December 22, 2010 - 3:32 pm

On 12/23/2010 11:02 AM, Alexey Charkov wrote:

If the compiler decided not to inline them for whatever reason they
would stick around. They should also probably be marked __init to make
it clear that they are not permanent functions.


I thought you might get compile time warnings. Returning things off the
stack in general is error prone. I think passing a pointer to the
resource into the function (as below) maybe a bit better.


I meant more in terms of losing the device name in the error which seems
to be the sole point of the macro. i.e it could be rewritten as:

static void wmt_add_resource(struct platform_device *pdev,
				const struct resource *res,
				unsigned num)
{
	if (platform_device_add_resources(pdev, res, num))
		pr_err("Failed to add device resource\n");
}

Because the add resource failing would indicate some serious problem you
may even want to BUG().

~Ryan

-- 
Bluewater Systems Ltd - ARM Technology Solution Centre

Ryan Mallon         		5 Amuri Park, 404 Barbadoes St
ryan@bluewatersys.com         	PO Box 13 889, Christchurch 8013
http://www.bluewatersys.com	New Zealand
Phone: +64 3 3779127		Freecall: Australia 1800 148 751
Fax:   +64 3 3779135			  USA 1800 261 2934
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH 1/6 v2] ARM: Add basic architecture support for ..., Russell King - ARM Linux, (Sun Nov 7, 9:57 am)
Re: [PATCH 1/6 v2] ARM: Add basic architecture support for ..., Russell King - ARM Linux, (Sun Nov 7, 10:00 am)
Re: [PATCH 1/6 v2] ARM: Add basic architecture support for ..., Russell King - ARM Linux, (Sun Nov 7, 10:17 am)
Re: [PATCH 6/6 v4] ARM: Add support for the display contro ..., Guennadi Liakhovetski, (Tue Nov 9, 12:36 am)
Re: [PATCH 6/6 v3] ARM: Add support for the display contro ..., Russell King - ARM Linux, (Tue Nov 9, 3:33 am)
Re: [PATCH 6/6 v3] ARM: Add support for the display contro ..., Russell King - ARM Linux, (Tue Nov 9, 4:04 am)
Re: [PATCH 6/6 v3] ARM: Add support for the display contro ..., Geert Uytterhoeven, (Tue Nov 9, 6:02 am)
Re: [PATCH 1/6 v4] ARM: Add basic architecture support for ..., Russell King - ARM Linux, (Wed Nov 10, 8:18 am)
Re: [PATCH 1/6 v5] ARM: Add basic architecture support for ..., Russell King - ARM Linux, (Thu Nov 11, 4:49 pm)
Re: [PATCH 5/6 v2] rtc: Add support for the RTC in VIA VT8 ..., Lars-Peter Clausen, (Sat Nov 13, 5:14 am)
Re: [PATCH 5/6 v3] rtc: Add support for the RTC in VIA VT8 ..., Lars-Peter Clausen, (Sun Nov 14, 8:50 am)
Re: [PATCH 5/6 v4] rtc: Add support for the RTC in VIA VT8 ..., Lars-Peter Clausen, (Wed Nov 24, 12:23 pm)
Re: [PATCH 1/6 v8] ARM: Add basic architecture support for ..., Russell King - ARM Linux, (Mon Dec 20, 12:15 pm)
Re: [PATCH 1/6 v10] ARM: Add basic architecture support fo ..., Ryan Mallon, (Wed Dec 22, 3:32 pm)