summaryrefslogtreecommitdiff
path: root/drivers/platform
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@linaro.org>2024-02-29 16:11:36 +0300
committerIlpo Järvinen <ilpo.jarvinen@linux.intel.com>2024-03-12 12:48:00 +0200
commit7c8772fef2c25b951660ff31aa1d2174b45af043 (patch)
tree1f71216cfd8e0c60ae6a6ac797915512f63e1160 /drivers/platform
parente8b4223dbf12cb6b722e1b8c48a9386cb096d4fb (diff)
platform/mellanox: mlxbf-pmc: fix signedness bugs
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: 1ae9ffd303c2 ("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>
Diffstat (limited to 'drivers/platform')
-rw-r--r--drivers/platform/mellanox/mlxbf-pmc.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/platform/mellanox/mlxbf-pmc.c b/drivers/platform/mellanox/mlxbf-pmc.c
index 746567767e5b..4ed9c7fd2b62 100644
--- a/drivers/platform/mellanox/mlxbf-pmc.c
+++ b/drivers/platform/mellanox/mlxbf-pmc.c
@@ -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;
@@ -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;
@@ -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;