From: Maciej Gajdzica <maciejx.t.gajdzica@intel.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH] enic: fixed possible data loss in vnic_dev.h
Date: Fri, 20 Feb 2015 16:13:44 +0000 [thread overview]
Message-ID: <1424448824-6224-1-git-send-email-maciejx.t.gajdzica@intel.com> (raw)
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(-)
diff --git a/lib/librte_pmd_enic/vnic/vnic_dev.h b/lib/librte_pmd_enic/vnic/vnic_dev.h
index d1373a5..ca1174f 100644
--- a/lib/librte_pmd_enic/vnic/vnic_dev.h
+++ b/lib/librte_pmd_enic/vnic/vnic_dev.h
@@ -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
--
1.7.9.5
reply other threads:[~2015-02-20 16:14 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1424448824-6224-1-git-send-email-maciejx.t.gajdzica@intel.com \
--to=maciejx.t.gajdzica@intel.com \
--cc=dev@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).