[net-next:master 1267/1290] net/rds/ib_recv.c:382:28: sparse: incorrect type in initializer (different base types)

2015-08-25 Thread kbuild test robot
tree:   git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git master
head:   04e1b7341dc33abe4dd3f761e2e9137701e55684
commit: 73ce4317bf983282593aff710b112a7e705620c3 [1267/1290] RDS: make sure we 
post recv buffers
reproduce:
  # apt-get install sparse
  git checkout 73ce4317bf983282593aff710b112a7e705620c3
  make ARCH=x86_64 allmodconfig
  make C=1 CF=-D__CHECK_ENDIAN__


sparse warnings: (new ones prefixed by )

 net/rds/ib_recv.c:382:28: sparse: incorrect type in initializer (different 
 base types)
   net/rds/ib_recv.c:382:28:expected int [signed] can_wait
   net/rds/ib_recv.c:382:28:got restricted gfp_t
   net/rds/ib_recv.c:828:23: sparse: cast to restricted __le64

vim +382 net/rds/ib_recv.c

   366  }
   367  
   368  /*
   369   * This tries to allocate and post unused work requests after making 
sure that
   370   * they have all the allocations they need to queue received fragments 
into
   371   * sockets.
   372   *
   373   * -1 is returned if posting fails due to temporary resource exhaustion.
   374   */
   375  void rds_ib_recv_refill(struct rds_connection *conn, int prefill, gfp_t 
gfp)
   376  {
   377  struct rds_ib_connection *ic = conn-c_transport_data;
   378  struct rds_ib_recv_work *recv;
   379  struct ib_recv_wr *failed_wr;
   380  unsigned int posted = 0;
   381  int ret = 0;
  382  int can_wait = gfp  __GFP_WAIT;
   383  u32 pos;
   384  
   385  /* the goal here is to just make sure that someone, somewhere
   386   * is posting buffers.  If we can't get the refill lock,
   387   * let them do their thing
   388   */
   389  if (!acquire_refill(conn))
   390  return;

---
0-DAY kernel test infrastructureOpen Source Technology Center
https://lists.01.org/pipermail/kbuild-all   Intel Corporation
--
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [net-next:master 1267/1290] net/rds/ib_recv.c:382:28: sparse: incorrect type in initializer (different base types)

2015-08-25 Thread santosh.shilim...@oracle.com

On 8/25/15 3:55 PM, David Miller wrote:

From: kbuild test robot fengguang...@intel.com
Date: Wed, 26 Aug 2015 06:42:39 +0800


sparse warnings: (new ones prefixed by )


net/rds/ib_recv.c:382:28: sparse: incorrect type in initializer (different base 
types)

net/rds/ib_recv.c:382:28:expected int [signed] can_wait
net/rds/ib_recv.c:382:28:got restricted gfp_t
net/rds/ib_recv.c:828:23: sparse: cast to restricted __le64


Fixed by:


[PATCH] rds: Fix improper gfp_t usage.


net/rds/ib_recv.c:382:28: sparse: incorrect type in initializer (different base 
types)

net/rds/ib_recv.c:382:28:expected int [signed] can_wait
net/rds/ib_recv.c:382:28:got restricted gfp_t
net/rds/ib_recv.c:828:23: sparse: cast to restricted __le64

Reported-by: kbuild test robot fengguang...@intel.com
Signed-off-by: David S. Miller da...@davemloft.net
---

Thanks Dave. I was just creating the patch after noticing
the error from kbuild on my tree.

Regards,
Santosh
--
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [net-next:master 1267/1290] net/rds/ib_recv.c:382:28: sparse: incorrect type in initializer (different base types)

2015-08-25 Thread David Miller
From: kbuild test robot fengguang...@intel.com
Date: Wed, 26 Aug 2015 06:42:39 +0800

 sparse warnings: (new ones prefixed by )
 
 net/rds/ib_recv.c:382:28: sparse: incorrect type in initializer (different 
 base types)
net/rds/ib_recv.c:382:28:expected int [signed] can_wait
net/rds/ib_recv.c:382:28:got restricted gfp_t
net/rds/ib_recv.c:828:23: sparse: cast to restricted __le64

Fixed by:


[PATCH] rds: Fix improper gfp_t usage.

 net/rds/ib_recv.c:382:28: sparse: incorrect type in initializer (different 
 base types)
   net/rds/ib_recv.c:382:28:expected int [signed] can_wait
   net/rds/ib_recv.c:382:28:got restricted gfp_t
   net/rds/ib_recv.c:828:23: sparse: cast to restricted __le64

Reported-by: kbuild test robot fengguang...@intel.com
Signed-off-by: David S. Miller da...@davemloft.net
---
 net/rds/ib_recv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/rds/ib_recv.c b/net/rds/ib_recv.c
index 3afdcbd..ed9b41e 100644
--- a/net/rds/ib_recv.c
+++ b/net/rds/ib_recv.c
@@ -379,7 +379,7 @@ void rds_ib_recv_refill(struct rds_connection *conn, int 
prefill, gfp_t gfp)
struct ib_recv_wr *failed_wr;
unsigned int posted = 0;
int ret = 0;
-   int can_wait = gfp  __GFP_WAIT;
+   bool can_wait = !!(gfp  __GFP_WAIT);
u32 pos;
 
/* the goal here is to just make sure that someone, somewhere
-- 
2.1.0

--
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html