linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] IB/sysfs: Fix sparse warning on attr_id
@ 2016-01-04  3:44 ira.weiny-ral2JQCrhuEAvxtiuMwx3w
       [not found] ` <1451879065-6513-1-git-send-email-ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: ira.weiny-ral2JQCrhuEAvxtiuMwx3w @ 2016-01-04  3:44 UTC (permalink / raw)
  To: dledford-H+wXaHxf7aLQT0dZR+AlfA,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA
  Cc: bart.vanassche-XdAiOPVOjttBDgjK7y7TUQ, Ira Weiny

From: Ira Weiny <ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>

Attributed ID was declared as an int while the value should really be big
endian 16.

Fixes: 35c4cbb17811 ("IB/core: Create get_perf_mad function in sysfs.c")

Reported-by: Bart Van Assche <bart.vanassche-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
Signed-off-by: Ira Weiny <ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
 drivers/infiniband/core/sysfs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/infiniband/core/sysfs.c b/drivers/infiniband/core/sysfs.c
index 2daf83276cdf..3de93517efe4 100644
--- a/drivers/infiniband/core/sysfs.c
+++ b/drivers/infiniband/core/sysfs.c
@@ -77,7 +77,7 @@ struct port_table_attribute {
 	struct port_attribute	attr;
 	char			name[8];
 	int			index;
-	int			attr_id;
+	__be16			attr_id;
 };
 
 static ssize_t port_attr_show(struct kobject *kobj,
@@ -413,7 +413,7 @@ struct port_table_attribute port_pma_attr_ext_##_name = {		\
  * Get a Perfmgmt MAD block of data.
  * Returns error code or the number of bytes retrieved.
  */
-static int get_perf_mad(struct ib_device *dev, int port_num, int attr,
+static int get_perf_mad(struct ib_device *dev, int port_num, __be16 attr,
 		void *data, int offset, size_t size)
 {
 	struct ib_mad *in_mad;
-- 
1.8.2

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] IB/sysfs: Fix sparse warning on attr_id
       [not found] ` <1451879065-6513-1-git-send-email-ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
@ 2016-01-04  6:36   ` Or Gerlitz
  2016-01-04  8:01   ` Bart Van Assche
                     ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Or Gerlitz @ 2016-01-04  6:36 UTC (permalink / raw)
  To: Weiny, Ira
  Cc: Doug Ledford, linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Bart Van Assche

On Mon, Jan 4, 2016 at 5:44 AM,  <ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> wrote:
> From: Ira Weiny <ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
>
> Attributed ID was declared as an int while the value should really be big
> endian 16.
>
> Fixes: 35c4cbb17811 ("IB/core: Create get_perf_mad function in sysfs.c")
>

remove this blank line (&& I provided you this comment multiple times
in the past)

> Reported-by: Bart Van Assche <bart.vanassche-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
> Signed-off-by: Ira Weiny <ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>

reverse the order, your S.O.B sig line should come 1st and later the rest of
the reporters/ackers/testers/maintainers notes

> ---
>  drivers/infiniband/core/sysfs.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/infiniband/core/sysfs.c b/drivers/infiniband/core/sysfs.c
> index 2daf83276cdf..3de93517efe4 100644
> --- a/drivers/infiniband/core/sysfs.c
> +++ b/drivers/infiniband/core/sysfs.c
> @@ -77,7 +77,7 @@ struct port_table_attribute {
>         struct port_attribute   attr;
>         char                    name[8];
>         int                     index;
> -       int                     attr_id;
> +       __be16                  attr_id;
>  };
>
>  static ssize_t port_attr_show(struct kobject *kobj,
> @@ -413,7 +413,7 @@ struct port_table_attribute port_pma_attr_ext_##_name = {           \
>   * Get a Perfmgmt MAD block of data.
>   * Returns error code or the number of bytes retrieved.
>   */
> -static int get_perf_mad(struct ib_device *dev, int port_num, int attr,
> +static int get_perf_mad(struct ib_device *dev, int port_num, __be16 attr,
>                 void *data, int offset, size_t size)
>  {
>         struct ib_mad *in_mad;
> --
> 1.8.2
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] IB/sysfs: Fix sparse warning on attr_id
       [not found] ` <1451879065-6513-1-git-send-email-ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
  2016-01-04  6:36   ` Or Gerlitz
@ 2016-01-04  8:01   ` Bart Van Assche
  2016-01-04 14:37   ` Christoph Lameter
                     ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Bart Van Assche @ 2016-01-04  8:01 UTC (permalink / raw)
  To: ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org,
	dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org

On 01/04/2016 04:44 AM, ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org wrote:
> From: Ira Weiny <ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
>
> Attributed ID was declared as an int while the value should really be big
> endian 16.
>
> Fixes: 35c4cbb17811 ("IB/core: Create get_perf_mad function in sysfs.c")
>
> Reported-by: Bart Van Assche <bart.vanassche-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
> Signed-off-by: Ira Weiny <ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>

Reviewed-by: Bart Van Assche <bart.vanassche-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] IB/sysfs: Fix sparse warning on attr_id
       [not found] ` <1451879065-6513-1-git-send-email-ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
  2016-01-04  6:36   ` Or Gerlitz
  2016-01-04  8:01   ` Bart Van Assche
@ 2016-01-04 14:37   ` Christoph Lameter
  2016-01-05  3:09   ` Hal Rosenstock
  2016-01-19 19:14   ` Doug Ledford
  4 siblings, 0 replies; 6+ messages in thread
From: Christoph Lameter @ 2016-01-04 14:37 UTC (permalink / raw)
  To: Ira Weiny
  Cc: dledford-H+wXaHxf7aLQT0dZR+AlfA,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	bart.vanassche-XdAiOPVOjttBDgjK7y7TUQ

On Sun, 3 Jan 2016, ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org wrote:

> Attributed ID was declared as an int while the value should really be big
> endian 16.

Reviewed-by: Christoph Lameter <cl-vYTEC60ixJUAvxtiuMwx3w@public.gmane.org>

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] IB/sysfs: Fix sparse warning on attr_id
       [not found] ` <1451879065-6513-1-git-send-email-ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
                     ` (2 preceding siblings ...)
  2016-01-04 14:37   ` Christoph Lameter
@ 2016-01-05  3:09   ` Hal Rosenstock
  2016-01-19 19:14   ` Doug Ledford
  4 siblings, 0 replies; 6+ messages in thread
From: Hal Rosenstock @ 2016-01-05  3:09 UTC (permalink / raw)
  To: ira.weiny-ral2JQCrhuEAvxtiuMwx3w, dledford-H+wXaHxf7aLQT0dZR+AlfA,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA
  Cc: bart.vanassche-XdAiOPVOjttBDgjK7y7TUQ

On 1/3/2016 10:44 PM, ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org wrote:
> From: Ira Weiny <ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> 
> Attributed ID was declared as an int while the value should really be big
> endian 16.
> 
> Fixes: 35c4cbb17811 ("IB/core: Create get_perf_mad function in sysfs.c")
> 
> Reported-by: Bart Van Assche <bart.vanassche-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
> Signed-off-by: Ira Weiny <ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>

Reviewed-by: Hal Rosenstock <hal-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] IB/sysfs: Fix sparse warning on attr_id
       [not found] ` <1451879065-6513-1-git-send-email-ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
                     ` (3 preceding siblings ...)
  2016-01-05  3:09   ` Hal Rosenstock
@ 2016-01-19 19:14   ` Doug Ledford
  4 siblings, 0 replies; 6+ messages in thread
From: Doug Ledford @ 2016-01-19 19:14 UTC (permalink / raw)
  To: ira.weiny-ral2JQCrhuEAvxtiuMwx3w,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA
  Cc: bart.vanassche-XdAiOPVOjttBDgjK7y7TUQ

[-- Attachment #1: Type: text/plain, Size: 1608 bytes --]

On 01/03/2016 10:44 PM, ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org wrote:
> From: Ira Weiny <ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> 
> Attributed ID was declared as an int while the value should really be big
> endian 16.
> 
> Fixes: 35c4cbb17811 ("IB/core: Create get_perf_mad function in sysfs.c")
> 
> Reported-by: Bart Van Assche <bart.vanassche-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
> Signed-off-by: Ira Weiny <ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> ---
>  drivers/infiniband/core/sysfs.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/infiniband/core/sysfs.c b/drivers/infiniband/core/sysfs.c
> index 2daf83276cdf..3de93517efe4 100644
> --- a/drivers/infiniband/core/sysfs.c
> +++ b/drivers/infiniband/core/sysfs.c
> @@ -77,7 +77,7 @@ struct port_table_attribute {
>  	struct port_attribute	attr;
>  	char			name[8];
>  	int			index;
> -	int			attr_id;
> +	__be16			attr_id;
>  };
>  
>  static ssize_t port_attr_show(struct kobject *kobj,
> @@ -413,7 +413,7 @@ struct port_table_attribute port_pma_attr_ext_##_name = {		\
>   * Get a Perfmgmt MAD block of data.
>   * Returns error code or the number of bytes retrieved.
>   */
> -static int get_perf_mad(struct ib_device *dev, int port_num, int attr,
> +static int get_perf_mad(struct ib_device *dev, int port_num, __be16 attr,
>  		void *data, int offset, size_t size)
>  {
>  	struct ib_mad *in_mad;
> 

Thanks, applied.

-- 
Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
              GPG KeyID: 0E572FDD



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 884 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-01-19 19:14 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-04  3:44 [PATCH] IB/sysfs: Fix sparse warning on attr_id ira.weiny-ral2JQCrhuEAvxtiuMwx3w
     [not found] ` <1451879065-6513-1-git-send-email-ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2016-01-04  6:36   ` Or Gerlitz
2016-01-04  8:01   ` Bart Van Assche
2016-01-04 14:37   ` Christoph Lameter
2016-01-05  3:09   ` Hal Rosenstock
2016-01-19 19:14   ` Doug Ledford

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).