<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Apr 25, 2022 at 1:32 PM Philipp Hortmann <<a href="mailto:philipp.g.hortmann@gmail.com">philipp.g.hortmann@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi,<br>
<br>
in this patch:<br>
[PATCH 4/5] staging: vt6655: Replace two VNSvInPortD with ioread64_lo_hi<br>
<br>
I tried to combine two reads in one.<br>
<br>
if (ww == W_MAX_TIMEOUT)<br>
return false;<br>
- VNSvInPortD(iobase + MAC_REG_TSFCNTR, (u32 *)pqwCurrTSF);<br>
- VNSvInPortD(iobase + MAC_REG_TSFCNTR + 4, (u32 *)pqwCurrTSF + 1);<br>
+ *pqwCurrTSF = ioread64_lo_hi(iobase + MAC_REG_TSFCNTR);<br>
<br>
return true;<br>
}<br>
<br>
works fine on 64 bit machines but fails on 32 bit machines.<br>
<br>
Which of the following ways is the preferred one:<br>
<br></blockquote><div><br></div><div>How about #ifdef for 32/64 bit CPU.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Adding<br>
#include <linux/io-64-nonatomic-lo-hi.h><br>
before #include "asm/io.h"<br>
But it seems that this has never been used in a driver before?<br>
<br>
Switch back to two reads with ioread32?<br>
<br>
Or another proposal?<br>
<br>
Thanks for your support.<br>
<br>
Bye Philipp<br>
<br>
_______________________________________________<br>
Kernelnewbies mailing list<br>
<a href="mailto:Kernelnewbies@kernelnewbies.org" target="_blank">Kernelnewbies@kernelnewbies.org</a><br>
<a href="https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies" rel="noreferrer" target="_blank">https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a><br>
</blockquote></div></div>