Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ethernet: ucc_geth: use UCC_GETH_{RX,TX}_BD_RING_ALIGNMENT macros directly

These macros both have the value 32, there's no point first
initializing align to a lower value.

If anything, one could throw in a
BUILD_BUG_ON(UCC_GETH_TX_BD_RING_ALIGNMENT < 4), but it's not worth it
- lots of code depends on named constants having sensible values.

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Rasmus Villemoes and committed by
Jakub Kicinski
b29fafd3 baff4311

+4 -6
+4 -6
drivers/net/ethernet/freescale/ucc_geth.c
··· 2196 2196 UCC_GETH_TX_BD_RING_SIZE_MEMORY_ALIGNMENT) 2197 2197 length += UCC_GETH_TX_BD_RING_SIZE_MEMORY_ALIGNMENT; 2198 2198 if (uf_info->bd_mem_part == MEM_PART_SYSTEM) { 2199 - u32 align = 4; 2200 - if (UCC_GETH_TX_BD_RING_ALIGNMENT > 4) 2201 - align = UCC_GETH_TX_BD_RING_ALIGNMENT; 2199 + u32 align = UCC_GETH_TX_BD_RING_ALIGNMENT; 2200 + 2202 2201 ugeth->tx_bd_ring_offset[j] = 2203 2202 (u32) kmalloc((u32) (length + align), GFP_KERNEL); 2204 2203 ··· 2273 2274 for (j = 0; j < ug_info->numQueuesRx; j++) { 2274 2275 length = ug_info->bdRingLenRx[j] * sizeof(struct qe_bd); 2275 2276 if (uf_info->bd_mem_part == MEM_PART_SYSTEM) { 2276 - u32 align = 4; 2277 - if (UCC_GETH_RX_BD_RING_ALIGNMENT > 4) 2278 - align = UCC_GETH_RX_BD_RING_ALIGNMENT; 2277 + u32 align = UCC_GETH_RX_BD_RING_ALIGNMENT; 2278 + 2279 2279 ugeth->rx_bd_ring_offset[j] = 2280 2280 (u32) kmalloc((u32) (length + align), GFP_KERNEL); 2281 2281 if (ugeth->rx_bd_ring_offset[j] != 0)