public inbox for linux-next@vger.kernel.org 
 help / color / mirror / Atom feed
From: Bixuan Cui <cuibixuan@huawei•com>
To: "Brown, Aaron F" <aaron.f.brown@intel•com>,
	"davem@davemloft•net" <davem@davemloft•net>,
	"kuba@kernel•org" <kuba@kernel•org>
Cc: "Kirsher, Jeffrey T" <jeffrey.t.kirsher@intel•com>,
	"intel-wired-lan@lists•osuosl.org"
	<intel-wired-lan@lists•osuosl.org>,
	"netdev@vger•kernel.org" <netdev@vger•kernel.org>,
	"linux-next@vger•kernel.org" <linux-next@vger•kernel.org>
Subject: [PATCH v3] net: ice: Fix pointer cast warnings
Date: Wed, 23 Sep 2020 09:58:15 +0800	[thread overview]
Message-ID: <85dcea48-8b82-d806-0026-e6b371e6a092@huawei.com> (raw)
In-Reply-To: <DM6PR11MB289004F11B8936F7C421A863BC540@DM6PR11MB2890.namprd11.prod.outlook.com>

pointers should be casted to unsigned long to avoid
-Wpointer-to-int-cast warnings:

drivers/net/ethernet/intel/ice/ice_flow.h:197:33: warning:
    cast from pointer to integer of different size
drivers/net/ethernet/intel/ice/ice_flow.h:198:32: warning:
    cast to pointer from integer of different size

Signed-off-by: Bixuan Cui <cuibixuan@huawei•com>
Tested-by: Aaron Brown <aaron.f.brown@intel•com>
---
v3->v2: add 'Tested-by: Aaron Brown <aaron.f.brown@intel•com>'
v2->v1: add fix:
 ice_flow.h:198:32: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
 #define ICE_FLOW_ENTRY_PTR(h) ((struct ice_flow_entry *)(h))

 drivers/net/ethernet/intel/ice/ice_flow.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/intel/ice/ice_flow.h b/drivers/net/ethernet/intel/ice/ice_flow.h
index 3913da2116d2..829f90b1e998 100644
--- a/drivers/net/ethernet/intel/ice/ice_flow.h
+++ b/drivers/net/ethernet/intel/ice/ice_flow.h
@@ -194,8 +194,8 @@ struct ice_flow_entry {
 	u16 entry_sz;
 };

-#define ICE_FLOW_ENTRY_HNDL(e)	((u64)e)
-#define ICE_FLOW_ENTRY_PTR(h)	((struct ice_flow_entry *)(h))
+#define ICE_FLOW_ENTRY_HNDL(e)	((u64)(uintptr_t)e)
+#define ICE_FLOW_ENTRY_PTR(h)	((struct ice_flow_entry *)(uintptr_t)(h))

 struct ice_flow_prof {
 	struct list_head l_entry;
-- 
2.17.1

.

  reply	other threads:[~2020-09-23  1:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-31 10:57 [PATCH -next] net: ice: Fix pointer cast warnings Bixuan Cui
2020-07-31 10:07 ` [PATCH -next v2] " Bixuan Cui
2020-08-26 23:22   ` Brown, Aaron F
2020-09-23  1:58     ` Bixuan Cui [this message]
2020-09-23  1:44   ` Bixuan Cui

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=85dcea48-8b82-d806-0026-e6b371e6a092@huawei.com \
    --to=cuibixuan@huawei$(echo .)com \
    --cc=aaron.f.brown@intel$(echo .)com \
    --cc=davem@davemloft$(echo .)net \
    --cc=intel-wired-lan@lists$(echo .)osuosl.org \
    --cc=jeffrey.t.kirsher@intel$(echo .)com \
    --cc=kuba@kernel$(echo .)org \
    --cc=linux-next@vger$(echo .)kernel.org \
    --cc=netdev@vger$(echo .)kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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