From 528640d141193b4aaeb6b8956d4fbc7381df9eb3 Mon Sep 17 00:00:00 2001 From: Paul Menzel Date: Sat, 23 Feb 2013 21:31:23 +0100 Subject: mainboard.c: Name enable_dev function uniformly `mainboard_enable` To reduce the differences between these file name the enabling device function in the directory `src/mainboard` uniformly `mainboard_enable` [1]. Thanks to the awesome help of gnomon and BlastHardcheese in the IRC channel #sed on . gnomon came up with the following command to do the actual work. $ cd src/mainboard $ for f in */*/mainboard.c ; \ > do src="$(awk '/\.enable_dev = /{v=$NF; sub(/,$/,"",v); print v}' "$f")" ; \ > [[ -z $src ]] && continue ; \ > printf '%s\n' "g/${src}/s/${src}\([,(]\)/mainboard_enable\1/p" w | ed -s "$f" ; \ > done `src/mainboard/digitallogic/msm586seg/mainboard.c` and `src/mainboard/technologic/ts5300/mainboard.c` had to be adapted manually as no comma was used separating the struct members. And with the following statement, gnomon is even more likable! My pleasure entirely. Good luck with coreboot; I'm a big fan of the project. [1] http://www.coreboot.org/pipermail/coreboot/2013-February/074548.html Change-Id: Ife9cd0c2d9cc1ed14afc6d40063450553f06a6c6 Signed-off-by: Paul Menzel Reviewed-on: http://review.coreboot.org/2493 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer --- src/mainboard/asus/m4a78-em/mainboard.c | 4 ++-- src/mainboard/asus/m4a785-m/mainboard.c | 4 ++-- src/mainboard/asus/m5a88-v/mainboard.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src/mainboard/asus') diff --git a/src/mainboard/asus/m4a78-em/mainboard.c b/src/mainboard/asus/m4a78-em/mainboard.c index 9b56277a6d..096d6ba953 100644 --- a/src/mainboard/asus/m4a78-em/mainboard.c +++ b/src/mainboard/asus/m4a78-em/mainboard.c @@ -118,7 +118,7 @@ u8 is_dev3_present(void) * enable the dedicated function in this board. * This function called early than rs780_enable. *************************************************/ -static void m4a78em_enable(device_t dev) +static void mainboard_enable(device_t dev) { printk(BIOS_INFO, "Mainboard enable. dev=0x%p\n", dev); @@ -128,5 +128,5 @@ static void m4a78em_enable(device_t dev) } struct chip_operations mainboard_ops = { - .enable_dev = m4a78em_enable, + .enable_dev = mainboard_enable, }; diff --git a/src/mainboard/asus/m4a785-m/mainboard.c b/src/mainboard/asus/m4a785-m/mainboard.c index a0b79fe531..a36dce07c6 100644 --- a/src/mainboard/asus/m4a785-m/mainboard.c +++ b/src/mainboard/asus/m4a785-m/mainboard.c @@ -190,7 +190,7 @@ static void set_thermal_config(void) * enable the dedicated function in this board. * This function called early than rs780_enable. *************************************************/ -static void m4a785m_enable(device_t dev) +static void mainboard_enable(device_t dev) { printk(BIOS_INFO, "Mainboard enable. dev=0x%p\n", dev); @@ -200,5 +200,5 @@ static void m4a785m_enable(device_t dev) } struct chip_operations mainboard_ops = { - .enable_dev = m4a785m_enable, + .enable_dev = mainboard_enable, }; diff --git a/src/mainboard/asus/m5a88-v/mainboard.c b/src/mainboard/asus/m5a88-v/mainboard.c index d1e530f372..8a5e8a1963 100644 --- a/src/mainboard/asus/m5a88-v/mainboard.c +++ b/src/mainboard/asus/m5a88-v/mainboard.c @@ -73,7 +73,7 @@ u8 is_dev3_present(void) * enable the dedicated function in M5A88-V board. * This function called early than rs780_enable. *************************************************/ -static void m5a88pm_v_enable(device_t dev) +static void mainboard_enable(device_t dev) { printk(BIOS_INFO, "Mainboard ASUS M5A88-V Enable. dev=0x%p\n", dev); @@ -83,5 +83,5 @@ static void m5a88pm_v_enable(device_t dev) } struct chip_operations mainboard_ops = { - .enable_dev = m5a88pm_v_enable, + .enable_dev = mainboard_enable, }; -- cgit v1.2.3