[dpdk-dev] enic: fixed possible data loss in vnic_dev.h
Commit Message
In function writeq is written in two 32-bit long registers with writel
function. When trying to write val >> 32, static code analysis tool
reports that 64-bit value is passed to function expecting 32-bit value.
Added cast to clear this warning.
Signed-off-by: Maciej Gajdzica <maciejx.t.gajdzica@intel.com>
---
lib/librte_pmd_enic/vnic/vnic_dev.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
@@ -55,7 +55,7 @@ static inline u64 readq(void __iomem *reg)
static inline void writeq(u64 val, void __iomem *reg)
{
writel(val & 0xffffffff, reg);
- writel(val >> 32, (char *)reg + 0x4UL);
+ writel((u32)(val >> 32), (char *)reg + 0x4UL);
}
#endif