Thread (4 messages) flat view 4 messages, 3 authors, 2017-01-09

RE: [RFC PATCH] intel: Use upper_32_bits and lower_32_bits

From: David Laight <hidden>
Date: 2017-01-09 12:56:31
Also in: intel-wired-lan, lkml

From: Joe Perches
Sent: 07 January 2017 18:33
Shifting and masking various types can be made a bit
simpler to read by using the available kernel macros.
...
-		ew32(TDBAH, (tdba >> 32));
-		ew32(TDBAL, (tdba & 0x00000000ffffffffULL));
+		ew32(TDBAH, upper_32_bits(tdba));
+		ew32(TDBAL, lower_32_bits(tdba));
Personally I find the original code easier to understand
since I don't have to look up another silly macro.

I'd normally not even explicitly mask the low bits
relying on the implicit truncation of the assignment.

At least modern compilers aren't stupid enough to add two
'mask with 0xff' instructions for:
	*uchar_ptr = (unsigned char)(foo & 0xff);

	David
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help