Re: [PATCH v3 2/2] IB/mad: Use ID allocator routines to allocate agent number (fwd)

2018-06-17 Thread Julia Lawall



On Sun, 17 Jun 2018, jackm wrote:

> On Sat, 16 Jun 2018 18:04:41 +0200 (CEST)
> Julia Lawall  wrote:
>
> > ib_mad_client_id is declared as u32, so it will not be < 0 (line 382).
> >
> > julia
> >
> Julia, your are correct.
> However, I was under the impression that this patch set was abandoned
> in favor of the one submitted by Matthew Wilcox! (Convert IB/mad to use
> an IDR for agent IDs)

No idea.  I just get the kbuild reports, and this was one that I didn't
get to in a timely manner.  So it's probably fine to ignore it.

julia

>
> Hans, Matthew?
>
> -Jack
> > -- Forwarded message --
> > Date: Fri, 8 Jun 2018 08:49:57 +0800
> > From: kbuild test robot 
> > To: kbu...@01.org
> > Cc: Julia Lawall 
> > Subject: Re: [PATCH v3 2/2] IB/mad: Use ID allocator routines to
> > allocate agent number
> >
> > Hi Hans,
> >
> > Thank you for the patch! Perhaps something to improve:
> >
> > [auto build test WARNING on linus/master]
> > [also build test WARNING on v4.17]
> > [if your patch is applied to the wrong git tree, please drop us a
> > note to help improve the system]
> >
> > url:
> > https://github.com/0day-ci/linux/commits/Hans-Westgaard-Ry/IB-mad-Use-ID-allocator-routines-to-allocate-agent-number/20180608-022348
> >  ::
> > branch date: 6 hours ago :: commit date: 6 hours ago
> >
> > >> drivers/infiniband/core/mad.c:382:5-21: WARNING: Unsigned
> > >> expression compared with zero: ib_mad_client_id < 0
> >
> > #
> > https://github.com/0day-ci/linux/commit/74b1ba09003c9d132878734bf44f32a62bad31db
> > git remote add linux-review https://github.com/0day-ci/linux git
> > remote update linux-review git checkout
> > 74b1ba09003c9d132878734bf44f32a62bad31db vim +382
> > drivers/infiniband/core/mad.c
> >
> > 2527e681 Sean Hefty2006-07-20  190
> > ^1da177e Linus Torvalds2005-04-16  191  /*
> > ^1da177e Linus Torvalds2005-04-16  192   * ib_register_mad_agent
> > - Register to send/receive MADs ^1da177e Linus Torvalds
> > 2005-04-16  193   */ ^1da177e Linus Torvalds2005-04-16  194
> > struct ib_mad_agent *ib_register_mad_agent(struct ib_device *device,
> > ^1da177e Linus Torvalds2005-04-16  195
> >u8 port_num, ^1da177e
> > Linus Torvalds2005-04-16  196
> >enum ib_qp_type qp_type,
> > ^1da177e Linus Torvalds2005-04-16  197
> >struct ib_mad_reg_req
> > *mad_reg_req, ^1da177e Linus Torvalds2005-04-16  198
> >u8 rmpp_version, ^1da177e
> > Linus Torvalds2005-04-16  199
> >ib_mad_send_handler
> > send_handler, ^1da177e Linus Torvalds2005-04-16  200
> >ib_mad_recv_handler
> > recv_handler, 0f29b46d Ira Weiny 2014-08-08  201
> >void *context, 0f29b46d
> > Ira Weiny 2014-08-08  202
> >u32 registration_flags)
> > ^1da177e Linus Torvalds2005-04-16  203  { ^1da177e Linus
> > Torvalds2005-04-16  204 struct ib_mad_port_private
> > *port_priv; ^1da177e Linus Torvalds2005-04-16  205
> > struct ib_mad_agent *ret = ERR_PTR(-EINVAL); ^1da177e Linus
> > Torvalds2005-04-16  206 struct ib_mad_agent_private
> > *mad_agent_priv; ^1da177e Linus Torvalds2005-04-16  207
> > struct ib_mad_reg_req *reg_req = NULL; ^1da177e Linus Torvalds
> > 2005-04-16  208 struct ib_mad_mgmt_class_table *class;
> > ^1da177e Linus Torvalds2005-04-16  209  struct
> > ib_mad_mgmt_vendor_class_table *vendor; ^1da177e Linus Torvalds
> > 2005-04-16  210 struct ib_mad_mgmt_vendor_class
> > *vendor_class; ^1da177e Linus Torvalds2005-04-16  211
> > struct ib_mad_mgmt_method_table *method; ^1da177e Linus Torvalds
> > 2005-04-16  212 int ret2, qpn; ^1da177e Linus Torvalds
> > 2005-04-16  213 unsigned long flags; ^1da177e Linus
> > Torvalds2005-04-16  214 u8 mgmt_class, vclass; 74b1ba09
> > Hans Westgaard Ry 2018-06-07  215   u32 ib_mad_client_id;
> > ^1da177e Linus Torvalds2005-04-16  216  /* Validate
> > parameters */ ^1da177e Linus Torvalds2005-04-16  217qpn
> > = get_spl_qp_index(qp_type); 9ad13a42 Ira Weiny 2014-08-08
> > 218 if (qpn == -1) { 9ad13a42 Ira Weiny 2014-08-08
> > 219 dev_notice(>dev, 9ad13a42 Ira
> > Weiny 2014-08-08  220
> > "ib_register_mad_agent: invalid QP Type %d\n", 9ad13a42 Ira
> > Weiny 2014-08-08  221  qp_type);
> > ^1da177e Linus Torvalds2005-04-16  222  goto
> > error1; 9ad13a42 Ira Weiny 2014-08-08  223  }
> > ^1da177e Linus Torvalds2005-04-16  224 9ad13a42 Ira Weiny
> > 2014-08-08  225 if (rmpp_version && rmpp_version !=
> > IB_MGMT_RMPP_VERSION) { 9ad13a42 Ira Weiny 2014-08-08  226
> > dev_notice(>dev, 

Re: [PATCH v3 2/2] IB/mad: Use ID allocator routines to allocate agent number (fwd)

2018-06-17 Thread Julia Lawall



On Sun, 17 Jun 2018, jackm wrote:

> On Sat, 16 Jun 2018 18:04:41 +0200 (CEST)
> Julia Lawall  wrote:
>
> > ib_mad_client_id is declared as u32, so it will not be < 0 (line 382).
> >
> > julia
> >
> Julia, your are correct.
> However, I was under the impression that this patch set was abandoned
> in favor of the one submitted by Matthew Wilcox! (Convert IB/mad to use
> an IDR for agent IDs)

No idea.  I just get the kbuild reports, and this was one that I didn't
get to in a timely manner.  So it's probably fine to ignore it.

julia

>
> Hans, Matthew?
>
> -Jack
> > -- Forwarded message --
> > Date: Fri, 8 Jun 2018 08:49:57 +0800
> > From: kbuild test robot 
> > To: kbu...@01.org
> > Cc: Julia Lawall 
> > Subject: Re: [PATCH v3 2/2] IB/mad: Use ID allocator routines to
> > allocate agent number
> >
> > Hi Hans,
> >
> > Thank you for the patch! Perhaps something to improve:
> >
> > [auto build test WARNING on linus/master]
> > [also build test WARNING on v4.17]
> > [if your patch is applied to the wrong git tree, please drop us a
> > note to help improve the system]
> >
> > url:
> > https://github.com/0day-ci/linux/commits/Hans-Westgaard-Ry/IB-mad-Use-ID-allocator-routines-to-allocate-agent-number/20180608-022348
> >  ::
> > branch date: 6 hours ago :: commit date: 6 hours ago
> >
> > >> drivers/infiniband/core/mad.c:382:5-21: WARNING: Unsigned
> > >> expression compared with zero: ib_mad_client_id < 0
> >
> > #
> > https://github.com/0day-ci/linux/commit/74b1ba09003c9d132878734bf44f32a62bad31db
> > git remote add linux-review https://github.com/0day-ci/linux git
> > remote update linux-review git checkout
> > 74b1ba09003c9d132878734bf44f32a62bad31db vim +382
> > drivers/infiniband/core/mad.c
> >
> > 2527e681 Sean Hefty2006-07-20  190
> > ^1da177e Linus Torvalds2005-04-16  191  /*
> > ^1da177e Linus Torvalds2005-04-16  192   * ib_register_mad_agent
> > - Register to send/receive MADs ^1da177e Linus Torvalds
> > 2005-04-16  193   */ ^1da177e Linus Torvalds2005-04-16  194
> > struct ib_mad_agent *ib_register_mad_agent(struct ib_device *device,
> > ^1da177e Linus Torvalds2005-04-16  195
> >u8 port_num, ^1da177e
> > Linus Torvalds2005-04-16  196
> >enum ib_qp_type qp_type,
> > ^1da177e Linus Torvalds2005-04-16  197
> >struct ib_mad_reg_req
> > *mad_reg_req, ^1da177e Linus Torvalds2005-04-16  198
> >u8 rmpp_version, ^1da177e
> > Linus Torvalds2005-04-16  199
> >ib_mad_send_handler
> > send_handler, ^1da177e Linus Torvalds2005-04-16  200
> >ib_mad_recv_handler
> > recv_handler, 0f29b46d Ira Weiny 2014-08-08  201
> >void *context, 0f29b46d
> > Ira Weiny 2014-08-08  202
> >u32 registration_flags)
> > ^1da177e Linus Torvalds2005-04-16  203  { ^1da177e Linus
> > Torvalds2005-04-16  204 struct ib_mad_port_private
> > *port_priv; ^1da177e Linus Torvalds2005-04-16  205
> > struct ib_mad_agent *ret = ERR_PTR(-EINVAL); ^1da177e Linus
> > Torvalds2005-04-16  206 struct ib_mad_agent_private
> > *mad_agent_priv; ^1da177e Linus Torvalds2005-04-16  207
> > struct ib_mad_reg_req *reg_req = NULL; ^1da177e Linus Torvalds
> > 2005-04-16  208 struct ib_mad_mgmt_class_table *class;
> > ^1da177e Linus Torvalds2005-04-16  209  struct
> > ib_mad_mgmt_vendor_class_table *vendor; ^1da177e Linus Torvalds
> > 2005-04-16  210 struct ib_mad_mgmt_vendor_class
> > *vendor_class; ^1da177e Linus Torvalds2005-04-16  211
> > struct ib_mad_mgmt_method_table *method; ^1da177e Linus Torvalds
> > 2005-04-16  212 int ret2, qpn; ^1da177e Linus Torvalds
> > 2005-04-16  213 unsigned long flags; ^1da177e Linus
> > Torvalds2005-04-16  214 u8 mgmt_class, vclass; 74b1ba09
> > Hans Westgaard Ry 2018-06-07  215   u32 ib_mad_client_id;
> > ^1da177e Linus Torvalds2005-04-16  216  /* Validate
> > parameters */ ^1da177e Linus Torvalds2005-04-16  217qpn
> > = get_spl_qp_index(qp_type); 9ad13a42 Ira Weiny 2014-08-08
> > 218 if (qpn == -1) { 9ad13a42 Ira Weiny 2014-08-08
> > 219 dev_notice(>dev, 9ad13a42 Ira
> > Weiny 2014-08-08  220
> > "ib_register_mad_agent: invalid QP Type %d\n", 9ad13a42 Ira
> > Weiny 2014-08-08  221  qp_type);
> > ^1da177e Linus Torvalds2005-04-16  222  goto
> > error1; 9ad13a42 Ira Weiny 2014-08-08  223  }
> > ^1da177e Linus Torvalds2005-04-16  224 9ad13a42 Ira Weiny
> > 2014-08-08  225 if (rmpp_version && rmpp_version !=
> > IB_MGMT_RMPP_VERSION) { 9ad13a42 Ira Weiny 2014-08-08  226
> > dev_notice(>dev, 

Re: [PATCH v3 2/2] IB/mad: Use ID allocator routines to allocate agent number (fwd)

2018-06-17 Thread jackm
On Sat, 16 Jun 2018 18:04:41 +0200 (CEST)
Julia Lawall  wrote:

> ib_mad_client_id is declared as u32, so it will not be < 0 (line 382).
> 
> julia
> 
Julia, your are correct.
However, I was under the impression that this patch set was abandoned
in favor of the one submitted by Matthew Wilcox! (Convert IB/mad to use
an IDR for agent IDs)

Hans, Matthew?

-Jack
> -- Forwarded message --
> Date: Fri, 8 Jun 2018 08:49:57 +0800
> From: kbuild test robot 
> To: kbu...@01.org
> Cc: Julia Lawall 
> Subject: Re: [PATCH v3 2/2] IB/mad: Use ID allocator routines to
> allocate agent number
> 
> Hi Hans,
> 
> Thank you for the patch! Perhaps something to improve:
> 
> [auto build test WARNING on linus/master]
> [also build test WARNING on v4.17]
> [if your patch is applied to the wrong git tree, please drop us a
> note to help improve the system]
> 
> url:
> https://github.com/0day-ci/linux/commits/Hans-Westgaard-Ry/IB-mad-Use-ID-allocator-routines-to-allocate-agent-number/20180608-022348
>  ::
> branch date: 6 hours ago :: commit date: 6 hours ago
> 
> >> drivers/infiniband/core/mad.c:382:5-21: WARNING: Unsigned
> >> expression compared with zero: ib_mad_client_id < 0  
> 
> #
> https://github.com/0day-ci/linux/commit/74b1ba09003c9d132878734bf44f32a62bad31db
> git remote add linux-review https://github.com/0day-ci/linux git
> remote update linux-review git checkout
> 74b1ba09003c9d132878734bf44f32a62bad31db vim +382
> drivers/infiniband/core/mad.c
> 
> 2527e681 Sean Hefty2006-07-20  190
> ^1da177e Linus Torvalds2005-04-16  191  /*
> ^1da177e Linus Torvalds2005-04-16  192   * ib_register_mad_agent
> - Register to send/receive MADs ^1da177e Linus Torvalds
> 2005-04-16  193   */ ^1da177e Linus Torvalds2005-04-16  194
> struct ib_mad_agent *ib_register_mad_agent(struct ib_device *device,
> ^1da177e Linus Torvalds2005-04-16  195
>  u8 port_num, ^1da177e
> Linus Torvalds2005-04-16  196
>  enum ib_qp_type qp_type,
> ^1da177e Linus Torvalds2005-04-16  197
>  struct ib_mad_reg_req
> *mad_reg_req, ^1da177e Linus Torvalds2005-04-16  198
>  u8 rmpp_version, ^1da177e
> Linus Torvalds2005-04-16  199
>  ib_mad_send_handler
> send_handler, ^1da177e Linus Torvalds2005-04-16  200
>  ib_mad_recv_handler
> recv_handler, 0f29b46d Ira Weiny 2014-08-08  201
>  void *context, 0f29b46d
> Ira Weiny 2014-08-08  202
>  u32 registration_flags)
> ^1da177e Linus Torvalds2005-04-16  203  { ^1da177e Linus
> Torvalds2005-04-16  204   struct ib_mad_port_private
> *port_priv; ^1da177e Linus Torvalds2005-04-16  205
> struct ib_mad_agent *ret = ERR_PTR(-EINVAL); ^1da177e Linus
> Torvalds2005-04-16  206   struct ib_mad_agent_private
> *mad_agent_priv; ^1da177e Linus Torvalds2005-04-16  207
> struct ib_mad_reg_req *reg_req = NULL; ^1da177e Linus Torvalds
> 2005-04-16  208   struct ib_mad_mgmt_class_table *class;
> ^1da177e Linus Torvalds2005-04-16  209struct
> ib_mad_mgmt_vendor_class_table *vendor; ^1da177e Linus Torvalds
> 2005-04-16  210   struct ib_mad_mgmt_vendor_class
> *vendor_class; ^1da177e Linus Torvalds2005-04-16  211
> struct ib_mad_mgmt_method_table *method; ^1da177e Linus Torvalds
> 2005-04-16  212   int ret2, qpn; ^1da177e Linus Torvalds
> 2005-04-16  213   unsigned long flags; ^1da177e Linus
> Torvalds2005-04-16  214   u8 mgmt_class, vclass; 74b1ba09
> Hans Westgaard Ry 2018-06-07  215 u32 ib_mad_client_id;
> ^1da177e Linus Torvalds2005-04-16  216/* Validate
> parameters */ ^1da177e Linus Torvalds2005-04-16  217  qpn
> = get_spl_qp_index(qp_type); 9ad13a42 Ira Weiny 2014-08-08
> 218   if (qpn == -1) { 9ad13a42 Ira Weiny 2014-08-08
> 219   dev_notice(>dev, 9ad13a42 Ira
> Weiny 2014-08-08  220
> "ib_register_mad_agent: invalid QP Type %d\n", 9ad13a42 Ira
> Weiny 2014-08-08  221qp_type);
> ^1da177e Linus Torvalds2005-04-16  222goto
> error1; 9ad13a42 Ira Weiny 2014-08-08  223}
> ^1da177e Linus Torvalds2005-04-16  224 9ad13a42 Ira Weiny
> 2014-08-08  225   if (rmpp_version && rmpp_version !=
> IB_MGMT_RMPP_VERSION) { 9ad13a42 Ira Weiny 2014-08-08  226
>   dev_notice(>dev, 9ad13a42 Ira Weiny
> 2014-08-08  227  "ib_register_mad_agent:
> invalid RMPP Version %u\n", 9ad13a42 Ira Weiny 2014-08-08
> 228  rmpp_version); fa619a77 Hal
> Rosenstock2005-07-27  229 goto error1; 9ad13a42
> Ira Weiny 2014-08-08  230 } ^1da177e Linus
> Torvalds2005-04-16  231 ^1da177e Linus Torvalds  

Re: [PATCH v3 2/2] IB/mad: Use ID allocator routines to allocate agent number (fwd)

2018-06-17 Thread jackm
On Sat, 16 Jun 2018 18:04:41 +0200 (CEST)
Julia Lawall  wrote:

> ib_mad_client_id is declared as u32, so it will not be < 0 (line 382).
> 
> julia
> 
Julia, your are correct.
However, I was under the impression that this patch set was abandoned
in favor of the one submitted by Matthew Wilcox! (Convert IB/mad to use
an IDR for agent IDs)

Hans, Matthew?

-Jack
> -- Forwarded message --
> Date: Fri, 8 Jun 2018 08:49:57 +0800
> From: kbuild test robot 
> To: kbu...@01.org
> Cc: Julia Lawall 
> Subject: Re: [PATCH v3 2/2] IB/mad: Use ID allocator routines to
> allocate agent number
> 
> Hi Hans,
> 
> Thank you for the patch! Perhaps something to improve:
> 
> [auto build test WARNING on linus/master]
> [also build test WARNING on v4.17]
> [if your patch is applied to the wrong git tree, please drop us a
> note to help improve the system]
> 
> url:
> https://github.com/0day-ci/linux/commits/Hans-Westgaard-Ry/IB-mad-Use-ID-allocator-routines-to-allocate-agent-number/20180608-022348
>  ::
> branch date: 6 hours ago :: commit date: 6 hours ago
> 
> >> drivers/infiniband/core/mad.c:382:5-21: WARNING: Unsigned
> >> expression compared with zero: ib_mad_client_id < 0  
> 
> #
> https://github.com/0day-ci/linux/commit/74b1ba09003c9d132878734bf44f32a62bad31db
> git remote add linux-review https://github.com/0day-ci/linux git
> remote update linux-review git checkout
> 74b1ba09003c9d132878734bf44f32a62bad31db vim +382
> drivers/infiniband/core/mad.c
> 
> 2527e681 Sean Hefty2006-07-20  190
> ^1da177e Linus Torvalds2005-04-16  191  /*
> ^1da177e Linus Torvalds2005-04-16  192   * ib_register_mad_agent
> - Register to send/receive MADs ^1da177e Linus Torvalds
> 2005-04-16  193   */ ^1da177e Linus Torvalds2005-04-16  194
> struct ib_mad_agent *ib_register_mad_agent(struct ib_device *device,
> ^1da177e Linus Torvalds2005-04-16  195
>  u8 port_num, ^1da177e
> Linus Torvalds2005-04-16  196
>  enum ib_qp_type qp_type,
> ^1da177e Linus Torvalds2005-04-16  197
>  struct ib_mad_reg_req
> *mad_reg_req, ^1da177e Linus Torvalds2005-04-16  198
>  u8 rmpp_version, ^1da177e
> Linus Torvalds2005-04-16  199
>  ib_mad_send_handler
> send_handler, ^1da177e Linus Torvalds2005-04-16  200
>  ib_mad_recv_handler
> recv_handler, 0f29b46d Ira Weiny 2014-08-08  201
>  void *context, 0f29b46d
> Ira Weiny 2014-08-08  202
>  u32 registration_flags)
> ^1da177e Linus Torvalds2005-04-16  203  { ^1da177e Linus
> Torvalds2005-04-16  204   struct ib_mad_port_private
> *port_priv; ^1da177e Linus Torvalds2005-04-16  205
> struct ib_mad_agent *ret = ERR_PTR(-EINVAL); ^1da177e Linus
> Torvalds2005-04-16  206   struct ib_mad_agent_private
> *mad_agent_priv; ^1da177e Linus Torvalds2005-04-16  207
> struct ib_mad_reg_req *reg_req = NULL; ^1da177e Linus Torvalds
> 2005-04-16  208   struct ib_mad_mgmt_class_table *class;
> ^1da177e Linus Torvalds2005-04-16  209struct
> ib_mad_mgmt_vendor_class_table *vendor; ^1da177e Linus Torvalds
> 2005-04-16  210   struct ib_mad_mgmt_vendor_class
> *vendor_class; ^1da177e Linus Torvalds2005-04-16  211
> struct ib_mad_mgmt_method_table *method; ^1da177e Linus Torvalds
> 2005-04-16  212   int ret2, qpn; ^1da177e Linus Torvalds
> 2005-04-16  213   unsigned long flags; ^1da177e Linus
> Torvalds2005-04-16  214   u8 mgmt_class, vclass; 74b1ba09
> Hans Westgaard Ry 2018-06-07  215 u32 ib_mad_client_id;
> ^1da177e Linus Torvalds2005-04-16  216/* Validate
> parameters */ ^1da177e Linus Torvalds2005-04-16  217  qpn
> = get_spl_qp_index(qp_type); 9ad13a42 Ira Weiny 2014-08-08
> 218   if (qpn == -1) { 9ad13a42 Ira Weiny 2014-08-08
> 219   dev_notice(>dev, 9ad13a42 Ira
> Weiny 2014-08-08  220
> "ib_register_mad_agent: invalid QP Type %d\n", 9ad13a42 Ira
> Weiny 2014-08-08  221qp_type);
> ^1da177e Linus Torvalds2005-04-16  222goto
> error1; 9ad13a42 Ira Weiny 2014-08-08  223}
> ^1da177e Linus Torvalds2005-04-16  224 9ad13a42 Ira Weiny
> 2014-08-08  225   if (rmpp_version && rmpp_version !=
> IB_MGMT_RMPP_VERSION) { 9ad13a42 Ira Weiny 2014-08-08  226
>   dev_notice(>dev, 9ad13a42 Ira Weiny
> 2014-08-08  227  "ib_register_mad_agent:
> invalid RMPP Version %u\n", 9ad13a42 Ira Weiny 2014-08-08
> 228  rmpp_version); fa619a77 Hal
> Rosenstock2005-07-27  229 goto error1; 9ad13a42
> Ira Weiny 2014-08-08  230 } ^1da177e Linus
> Torvalds2005-04-16  231 ^1da177e Linus Torvalds  

Re: [PATCH v3 2/2] IB/mad: Use ID allocator routines to allocate agent number (fwd)

2018-06-16 Thread Julia Lawall
ib_mad_client_id is declared as u32, so it will not be < 0 (line 382).

julia

-- Forwarded message --
Date: Fri, 8 Jun 2018 08:49:57 +0800
From: kbuild test robot 
To: kbu...@01.org
Cc: Julia Lawall 
Subject: Re: [PATCH v3 2/2] IB/mad: Use ID allocator routines to allocate agent
number

Hi Hans,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on linus/master]
[also build test WARNING on v4.17]
[if your patch is applied to the wrong git tree, please drop us a note to help 
improve the system]

url:
https://github.com/0day-ci/linux/commits/Hans-Westgaard-Ry/IB-mad-Use-ID-allocator-routines-to-allocate-agent-number/20180608-022348
:: branch date: 6 hours ago
:: commit date: 6 hours ago

>> drivers/infiniband/core/mad.c:382:5-21: WARNING: Unsigned expression 
>> compared with zero: ib_mad_client_id < 0

# 
https://github.com/0day-ci/linux/commit/74b1ba09003c9d132878734bf44f32a62bad31db
git remote add linux-review https://github.com/0day-ci/linux
git remote update linux-review
git checkout 74b1ba09003c9d132878734bf44f32a62bad31db
vim +382 drivers/infiniband/core/mad.c

2527e681 Sean Hefty2006-07-20  190
^1da177e Linus Torvalds2005-04-16  191  /*
^1da177e Linus Torvalds2005-04-16  192   * ib_register_mad_agent - Register 
to send/receive MADs
^1da177e Linus Torvalds2005-04-16  193   */
^1da177e Linus Torvalds2005-04-16  194  struct ib_mad_agent 
*ib_register_mad_agent(struct ib_device *device,
^1da177e Linus Torvalds2005-04-16  195  
   u8 port_num,
^1da177e Linus Torvalds2005-04-16  196  
   enum ib_qp_type qp_type,
^1da177e Linus Torvalds2005-04-16  197  
   struct ib_mad_reg_req *mad_reg_req,
^1da177e Linus Torvalds2005-04-16  198  
   u8 rmpp_version,
^1da177e Linus Torvalds2005-04-16  199  
   ib_mad_send_handler send_handler,
^1da177e Linus Torvalds2005-04-16  200  
   ib_mad_recv_handler recv_handler,
0f29b46d Ira Weiny 2014-08-08  201  
   void *context,
0f29b46d Ira Weiny 2014-08-08  202  
   u32 registration_flags)
^1da177e Linus Torvalds2005-04-16  203  {
^1da177e Linus Torvalds2005-04-16  204  struct ib_mad_port_private 
*port_priv;
^1da177e Linus Torvalds2005-04-16  205  struct ib_mad_agent *ret = 
ERR_PTR(-EINVAL);
^1da177e Linus Torvalds2005-04-16  206  struct ib_mad_agent_private 
*mad_agent_priv;
^1da177e Linus Torvalds2005-04-16  207  struct ib_mad_reg_req *reg_req 
= NULL;
^1da177e Linus Torvalds2005-04-16  208  struct ib_mad_mgmt_class_table 
*class;
^1da177e Linus Torvalds2005-04-16  209  struct 
ib_mad_mgmt_vendor_class_table *vendor;
^1da177e Linus Torvalds2005-04-16  210  struct ib_mad_mgmt_vendor_class 
*vendor_class;
^1da177e Linus Torvalds2005-04-16  211  struct ib_mad_mgmt_method_table 
*method;
^1da177e Linus Torvalds2005-04-16  212  int ret2, qpn;
^1da177e Linus Torvalds2005-04-16  213  unsigned long flags;
^1da177e Linus Torvalds2005-04-16  214  u8 mgmt_class, vclass;
74b1ba09 Hans Westgaard Ry 2018-06-07  215  u32 ib_mad_client_id;
^1da177e Linus Torvalds2005-04-16  216  /* Validate parameters */
^1da177e Linus Torvalds2005-04-16  217  qpn = get_spl_qp_index(qp_type);
9ad13a42 Ira Weiny 2014-08-08  218  if (qpn == -1) {
9ad13a42 Ira Weiny 2014-08-08  219  dev_notice(>dev,
9ad13a42 Ira Weiny 2014-08-08  220 
"ib_register_mad_agent: invalid QP Type %d\n",
9ad13a42 Ira Weiny 2014-08-08  221 qp_type);
^1da177e Linus Torvalds2005-04-16  222  goto error1;
9ad13a42 Ira Weiny 2014-08-08  223  }
^1da177e Linus Torvalds2005-04-16  224
9ad13a42 Ira Weiny 2014-08-08  225  if (rmpp_version && 
rmpp_version != IB_MGMT_RMPP_VERSION) {
9ad13a42 Ira Weiny 2014-08-08  226  dev_notice(>dev,
9ad13a42 Ira Weiny 2014-08-08  227 
"ib_register_mad_agent: invalid RMPP Version %u\n",
9ad13a42 Ira Weiny 2014-08-08  228 
rmpp_version);
fa619a77 Hal Rosenstock2005-07-27  229  goto error1;
9ad13a42 Ira Weiny 2014-08-08  230  }
^1da177e Linus Torvalds2005-04-16  231
^1da177e Linus Torvalds2005-04-16  232  /* Validate MAD registration 
request if supplied */
^1da177e Linus Torvalds2005-04-16  233  if (mad_reg_req) {
9ad13a42 Ira Weiny 2014-08-08  234  if 
(mad_reg_req->mgmt_class_version >= MAX_MGMT_VERSION) {
9ad13a42 Ira Weiny 2014-08-08  235  
dev_notice(>dev,
9ad13a42 Ira 

Re: [PATCH v3 2/2] IB/mad: Use ID allocator routines to allocate agent number (fwd)

2018-06-16 Thread Julia Lawall
ib_mad_client_id is declared as u32, so it will not be < 0 (line 382).

julia

-- Forwarded message --
Date: Fri, 8 Jun 2018 08:49:57 +0800
From: kbuild test robot 
To: kbu...@01.org
Cc: Julia Lawall 
Subject: Re: [PATCH v3 2/2] IB/mad: Use ID allocator routines to allocate agent
number

Hi Hans,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on linus/master]
[also build test WARNING on v4.17]
[if your patch is applied to the wrong git tree, please drop us a note to help 
improve the system]

url:
https://github.com/0day-ci/linux/commits/Hans-Westgaard-Ry/IB-mad-Use-ID-allocator-routines-to-allocate-agent-number/20180608-022348
:: branch date: 6 hours ago
:: commit date: 6 hours ago

>> drivers/infiniband/core/mad.c:382:5-21: WARNING: Unsigned expression 
>> compared with zero: ib_mad_client_id < 0

# 
https://github.com/0day-ci/linux/commit/74b1ba09003c9d132878734bf44f32a62bad31db
git remote add linux-review https://github.com/0day-ci/linux
git remote update linux-review
git checkout 74b1ba09003c9d132878734bf44f32a62bad31db
vim +382 drivers/infiniband/core/mad.c

2527e681 Sean Hefty2006-07-20  190
^1da177e Linus Torvalds2005-04-16  191  /*
^1da177e Linus Torvalds2005-04-16  192   * ib_register_mad_agent - Register 
to send/receive MADs
^1da177e Linus Torvalds2005-04-16  193   */
^1da177e Linus Torvalds2005-04-16  194  struct ib_mad_agent 
*ib_register_mad_agent(struct ib_device *device,
^1da177e Linus Torvalds2005-04-16  195  
   u8 port_num,
^1da177e Linus Torvalds2005-04-16  196  
   enum ib_qp_type qp_type,
^1da177e Linus Torvalds2005-04-16  197  
   struct ib_mad_reg_req *mad_reg_req,
^1da177e Linus Torvalds2005-04-16  198  
   u8 rmpp_version,
^1da177e Linus Torvalds2005-04-16  199  
   ib_mad_send_handler send_handler,
^1da177e Linus Torvalds2005-04-16  200  
   ib_mad_recv_handler recv_handler,
0f29b46d Ira Weiny 2014-08-08  201  
   void *context,
0f29b46d Ira Weiny 2014-08-08  202  
   u32 registration_flags)
^1da177e Linus Torvalds2005-04-16  203  {
^1da177e Linus Torvalds2005-04-16  204  struct ib_mad_port_private 
*port_priv;
^1da177e Linus Torvalds2005-04-16  205  struct ib_mad_agent *ret = 
ERR_PTR(-EINVAL);
^1da177e Linus Torvalds2005-04-16  206  struct ib_mad_agent_private 
*mad_agent_priv;
^1da177e Linus Torvalds2005-04-16  207  struct ib_mad_reg_req *reg_req 
= NULL;
^1da177e Linus Torvalds2005-04-16  208  struct ib_mad_mgmt_class_table 
*class;
^1da177e Linus Torvalds2005-04-16  209  struct 
ib_mad_mgmt_vendor_class_table *vendor;
^1da177e Linus Torvalds2005-04-16  210  struct ib_mad_mgmt_vendor_class 
*vendor_class;
^1da177e Linus Torvalds2005-04-16  211  struct ib_mad_mgmt_method_table 
*method;
^1da177e Linus Torvalds2005-04-16  212  int ret2, qpn;
^1da177e Linus Torvalds2005-04-16  213  unsigned long flags;
^1da177e Linus Torvalds2005-04-16  214  u8 mgmt_class, vclass;
74b1ba09 Hans Westgaard Ry 2018-06-07  215  u32 ib_mad_client_id;
^1da177e Linus Torvalds2005-04-16  216  /* Validate parameters */
^1da177e Linus Torvalds2005-04-16  217  qpn = get_spl_qp_index(qp_type);
9ad13a42 Ira Weiny 2014-08-08  218  if (qpn == -1) {
9ad13a42 Ira Weiny 2014-08-08  219  dev_notice(>dev,
9ad13a42 Ira Weiny 2014-08-08  220 
"ib_register_mad_agent: invalid QP Type %d\n",
9ad13a42 Ira Weiny 2014-08-08  221 qp_type);
^1da177e Linus Torvalds2005-04-16  222  goto error1;
9ad13a42 Ira Weiny 2014-08-08  223  }
^1da177e Linus Torvalds2005-04-16  224
9ad13a42 Ira Weiny 2014-08-08  225  if (rmpp_version && 
rmpp_version != IB_MGMT_RMPP_VERSION) {
9ad13a42 Ira Weiny 2014-08-08  226  dev_notice(>dev,
9ad13a42 Ira Weiny 2014-08-08  227 
"ib_register_mad_agent: invalid RMPP Version %u\n",
9ad13a42 Ira Weiny 2014-08-08  228 
rmpp_version);
fa619a77 Hal Rosenstock2005-07-27  229  goto error1;
9ad13a42 Ira Weiny 2014-08-08  230  }
^1da177e Linus Torvalds2005-04-16  231
^1da177e Linus Torvalds2005-04-16  232  /* Validate MAD registration 
request if supplied */
^1da177e Linus Torvalds2005-04-16  233  if (mad_reg_req) {
9ad13a42 Ira Weiny 2014-08-08  234  if 
(mad_reg_req->mgmt_class_version >= MAX_MGMT_VERSION) {
9ad13a42 Ira Weiny 2014-08-08  235  
dev_notice(>dev,
9ad13a42 Ira