Skip to content

Commit 261a39c

Browse files
committed
platform/mellanox: mlxbf-pmc: fix signedness bugs
JIRA: https://issues.redhat.com/browse/RHEL-45234 commit 7c8772f Author: Dan Carpenter <dan.carpenter@linaro.org> Date: Thu, 29 Feb 2024 16:11:36 +0300 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> Signed-off-by: Luiz Capitulino <luizcap@redhat.com>
1 parent fe2ea10 commit 261a39c

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

drivers/platform/mellanox/mlxbf-pmc.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1505,8 +1505,9 @@ static ssize_t mlxbf_pmc_counter_show(struct device *dev,
15051505
{
15061506
struct mlxbf_pmc_attribute *attr_counter = container_of(
15071507
attr, struct mlxbf_pmc_attribute, dev_attr);
1508-
unsigned int blk_num, cnt_num, offset;
1508+
unsigned int blk_num, cnt_num;
15091509
bool is_l3 = false;
1510+
int offset;
15101511
u64 value;
15111512

15121513
blk_num = attr_counter->nr;
@@ -1539,9 +1540,10 @@ static ssize_t mlxbf_pmc_counter_store(struct device *dev,
15391540
{
15401541
struct mlxbf_pmc_attribute *attr_counter = container_of(
15411542
attr, struct mlxbf_pmc_attribute, dev_attr);
1542-
unsigned int blk_num, cnt_num, offset, data;
1543+
unsigned int blk_num, cnt_num, data;
15431544
bool is_l3 = false;
15441545
u64 evt_num;
1546+
int offset;
15451547
int err;
15461548

15471549
blk_num = attr_counter->nr;
@@ -1621,8 +1623,9 @@ static ssize_t mlxbf_pmc_event_store(struct device *dev,
16211623
{
16221624
struct mlxbf_pmc_attribute *attr_event = container_of(
16231625
attr, struct mlxbf_pmc_attribute, dev_attr);
1624-
unsigned int blk_num, cnt_num, evt_num;
1626+
unsigned int blk_num, cnt_num;
16251627
bool is_l3 = false;
1628+
int evt_num;
16261629
int err;
16271630

16281631
blk_num = attr_event->nr;

0 commit comments

Comments
 (0)