Skip to contentSkip to conversation

IB/sysfs: Fix sparse warning on attr_id

PATCH Applied [email protected] 6 participants 6 messages Jan 4, 2016 – Jan 19, 2016 1 message not in the archive InfiniBand

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 IB/sysfs: Fix sparse warning on attr_id

From: Ira Weiny <[email protected]>

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")
---
 drivers/infiniband/core/sysfs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/infiniband/core/sysfs.c +2 -2
index 2daf83276cdf..3de93517efe4 100644
@@ -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;
Signature · 6 lines
1.8.2

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 1451879065-6513-1-git-send-email-ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org

#2 lore raw
Quoted 7 lines · On Mon, Jan 4, 2016 at 5:44 AM, <[email protected]…

From: Ira Weiny <[email protected]>

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)

Quoted 2 lines

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

Quoted 27 lines
---
 drivers/infiniband/core/sysfs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/infiniband/core/sysfs.c +2 -3
index 2daf83276cdf..3de93517efe4 100644
@@ -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;
--
Quoted 1 line

1.8.2

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

Reviewed-by
#3 lore raw
In reply to a message not in the archive
Quoted 9 lines · On 01/04/2016 04:44 AM, [email protected] wrote:

From: Ira Weiny <[email protected]>

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

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

Reviewed-by
#5 lore raw
In reply to a message not in the archive
Quoted 9 lines · On 1/3/2016 10:44 PM, [email protected] wrote:

From: Ira Weiny <[email protected]>

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

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

Applied
#6 lore raw
In reply to a message not in the archive
Quoted 28 lines · On 01/03/2016 10:44 PM, [email protected] wrote:

From: Ira Weiny <[email protected]>

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")
---
 drivers/infiniband/core/sysfs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/infiniband/core/sysfs.c +1 -1
index 2daf83276cdf..3de93517efe4 100644
@@ -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,

drivers/infiniband/core/sysfs.c struct port_table_attribute port_pma_attr_ext_##_name = { \ · line 419

Quoted 8 lines
drivers/infiniband/core/sysfs.c +1 -1
@@ -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.

Signature · 2 lines
Doug Ledford <[email protected]>
              GPG KeyID: 0E572FDD