From 5f19eb6f402e3fa5c095d275f6483cf61edfb59b Mon Sep 17 00:00:00 2001 From: Edward O'Callaghan Date: Sat, 29 Nov 2014 00:03:03 +1100 Subject: ec: Use DEVICE_NOOP macro formalism over static stub func The in source comment: /* This function avoids an error on serial console. */ refers to the resource allocator needing to find a non-NULL function pointer else complaints of "... missing read_resources" will be spewed. Unfortunately/fortunately (depending on the time of day) compiler optimisers have gotten a bit better at optimising away no-op functions leading to the very message these stubs attempted to avoid. By using the DEVICE_NOOP formalism that is static inlined 'suggests' (not enforces) to the compiler to keep these symbols around. Change-Id: I182019627b6954a4020f9f70e9c829ce3135f63c Signed-off-by: Edward O'Callaghan Reviewed-on: http://review.coreboot.org/7598 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi --- src/ec/quanta/ene_kb3940q/ec.c | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) (limited to 'src/ec/quanta/ene_kb3940q') diff --git a/src/ec/quanta/ene_kb3940q/ec.c b/src/ec/quanta/ene_kb3940q/ec.c index dcd9c4af05..d7539fc78e 100644 --- a/src/ec/quanta/ene_kb3940q/ec.c +++ b/src/ec/quanta/ene_kb3940q/ec.c @@ -152,22 +152,10 @@ static void ene_kb3940q_init(struct device *dev) ene_kb3940q_log_events(); } - -static void ene_kb3940q_read_resources(struct device *dev) -{ - /* This function avoids an error on serial console. */ -} - - -static void ene_kb3940q_enable_resources(struct device *dev) -{ - /* This function avoids an error on serial console. */ -} - static struct device_operations ops = { .init = ene_kb3940q_init, - .read_resources = ene_kb3940q_read_resources, - .enable_resources = ene_kb3940q_enable_resources + .read_resources = DEVICE_NOOP, + .enable_resources = DEVICE_NOOP, }; static struct pnp_info pnp_dev_info[] = { -- cgit v1.2.3