coreboot/src
Angel Pons 6f75dd0fd0 sandybridge,haswell,broadwell: Use DIV_ROUND_CLOSEST macro
Integer division in C truncates toward zero. When the dividend and the
divisor are positive, one can add half of the divisor to the dividend to
round the division result towards the closest integer. We already have a
macro in commonlib to do just that, so put it to good use.

Tested with BUILD_TIMELESS=1, coreboot images for the Asus P8Z77-V LX2
and the Asrock B85M Pro4 do not change.

Change-Id: I251af82da15049a3a2aa6ea712ae8c9fe859caf6
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/52651
Reviewed-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Benjamin Doron <benjamin.doron00@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2024-04-13 10:53:42 +00:00
..
acpi tree: Drop duplicated <device/{path,resource}.h> 2024-04-12 04:24:20 +00:00
arch tree: Drop duplicated <device/{path,resource}.h> 2024-04-12 04:24:20 +00:00
commonlib tree: Drop unused <string.h> 2024-04-11 11:13:18 +00:00
console tree: Drop duplicated <stdarg.h> and <stdio.h> 2024-04-12 04:25:07 +00:00
cpu tree: Drop duplicated <stdarg.h> and <stdio.h> 2024-04-12 04:25:07 +00:00
device tree: Drop duplicated <stdarg.h> and <stdio.h> 2024-04-12 04:25:07 +00:00
drivers tree: Drop duplicated <stdarg.h> and <stdio.h> 2024-04-12 04:25:07 +00:00
ec tree: Drop unused <halt.h> 2024-04-11 19:25:06 +00:00
include tree: Drop duplicated <device/{path,resource}.h> 2024-04-12 04:24:20 +00:00
lib tree: Drop duplicated <device/pci_{def,type}.h> 2024-04-12 04:24:43 +00:00
mainboard mb/google/brox: Initialize NOTE_BOOK_MODE GPIO 2024-04-12 18:04:04 +00:00
northbridge sandybridge,haswell,broadwell: Use DIV_ROUND_CLOSEST macro 2024-04-13 10:53:42 +00:00
sbom src, util: Clean up makefile.inc in text, help & comments 2024-01-26 20:15:18 +00:00
security security/vboot: extract secdata_tpm{1,2}.c 2024-03-28 15:20:11 +00:00
soc sandybridge,haswell,broadwell: Use DIV_ROUND_CLOSEST macro 2024-04-13 10:53:42 +00:00
southbridge tree: Drop duplicated <device/pci_{def,type}.h> 2024-04-12 04:24:43 +00:00
superio tree: Drop unused <stdlib.h> 2024-04-11 19:24:44 +00:00
vendorcode Makefile.mk: Also add -libs to bootblock when !SEPARATE_ROMSTAGE 2024-04-04 10:41:39 +00:00
Kconfig Kconfig: Make GBD_STUB and long mode mutually exclusive 2024-04-01 13:40:37 +00:00