提交 65487fdc 编写于 作者: I Ira Weiny 提交者: Doug Ledford

IB/sysfs: Fix sparse warning on attr_id

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

Fixes: 35c4cbb1 ("IB/core: Create get_perf_mad function in sysfs.c")
Reported-by: NBart Van Assche <bart.vanassche@sandisk.com>
Signed-off-by: NIra Weiny <ira.weiny@intel.com>
Reviewed-by: NBart Van Assche <bart.vanassche@sandisk.com>
Reviewed-by: NChristoph Lameter <cl@linux.com>
Reviewed-by: NHal Rosenstock <hal@mellanox.com>
Signed-off-by: NDoug Ledford <dledford@redhat.com>
上级 9781808c
...@@ -77,7 +77,7 @@ struct port_table_attribute { ...@@ -77,7 +77,7 @@ struct port_table_attribute {
struct port_attribute attr; struct port_attribute attr;
char name[8]; char name[8];
int index; int index;
int attr_id; __be16 attr_id;
}; };
static ssize_t port_attr_show(struct kobject *kobj, static ssize_t port_attr_show(struct kobject *kobj,
...@@ -413,7 +413,7 @@ struct port_table_attribute port_pma_attr_ext_##_name = { \ ...@@ -413,7 +413,7 @@ struct port_table_attribute port_pma_attr_ext_##_name = { \
* Get a Perfmgmt MAD block of data. * Get a Perfmgmt MAD block of data.
* Returns error code or the number of bytes retrieved. * 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) void *data, int offset, size_t size)
{ {
struct ib_mad *in_mad; struct ib_mad *in_mad;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册