Skip to content

Commit

Permalink
platform/mellanox: mlxbf-pmc: fix signedness bugs
Browse files Browse the repository at this point in the history
These need to be signed for the error handling to work.  The
mlxbf_pmc_get_event_num() function returns int so int type is correct.

Fixes: 1ae9ffd ("platform/mellanox: mlxbf-pmc: Cleanup signed/unsigned mix-up")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://lore.kernel.org/r/a4af764e-990b-4ebd-b342-852844374032@moroto.mountain
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
  • Loading branch information
Dan Carpenter authored and ij-intel committed Mar 12, 2024
1 parent e8b4223 commit 7c8772f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions drivers/platform/mellanox/mlxbf-pmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1505,8 +1505,9 @@ static ssize_t mlxbf_pmc_counter_show(struct device *dev,
{
struct mlxbf_pmc_attribute *attr_counter = container_of(
attr, struct mlxbf_pmc_attribute, dev_attr);
unsigned int blk_num, cnt_num, offset;
unsigned int blk_num, cnt_num;
bool is_l3 = false;
int offset;
u64 value;

blk_num = attr_counter->nr;
Expand Down Expand Up @@ -1539,9 +1540,10 @@ static ssize_t mlxbf_pmc_counter_store(struct device *dev,
{
struct mlxbf_pmc_attribute *attr_counter = container_of(
attr, struct mlxbf_pmc_attribute, dev_attr);
unsigned int blk_num, cnt_num, offset, data;
unsigned int blk_num, cnt_num, data;
bool is_l3 = false;
u64 evt_num;
int offset;
int err;

blk_num = attr_counter->nr;
Expand Down Expand Up @@ -1621,8 +1623,9 @@ static ssize_t mlxbf_pmc_event_store(struct device *dev,
{
struct mlxbf_pmc_attribute *attr_event = container_of(
attr, struct mlxbf_pmc_attribute, dev_attr);
unsigned int blk_num, cnt_num, evt_num;
unsigned int blk_num, cnt_num;
bool is_l3 = false;
int evt_num;
int err;

blk_num = attr_event->nr;
Expand Down

0 comments on commit 7c8772f

Please sign in to comment.