Skip to contentSkip to conversation

platform/surface: aggregator: Fixes for user-space interface extension series

PATCH In review Maximilian Luz 2 participants 4 messages Jun 4, 2021 – Jun 9, 2021

Subsystems (3)
lore
Share & tools
lore

Maximilian Luz

author maintainer
#0 lore raw

cover platform/surface: aggregator: Fixes for user-space interface extension series

Small fixes for "platform/surface: aggregator: Extend user-space interface for events".

Specifically, prevent use of an uniniitalized variable and drop an unnecessary initialization.

Maximilian Luz (2):
platform/surface: aggregator: Do not return uninitialized value platform/surface: aggregator: Drop unnecessary variable initialization

 drivers/platform/surface/aggregator/controller.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Signature · 1 line
2.31.1
author maintainer
#1 lore raw

PATCH 1/2 platform/surface: aggregator: Do not return uninitialized value

The status variable in ssam_nf_refcount_disable_free() is only set when the reference count equals zero. Otherwise, it is returned uninitialized. Fix this by always initializing status to zero.

Fixes 640ee17199e4 ("platform/surface: aggregator: Allow enabling of events without notifiers")
---
 drivers/platform/surface/aggregator/controller.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/platform/surface/aggregator/controller.c +1 -1
index 6646f4d6e10d..634399387d76 100644
@@ -2228,7 +2228,7 @@ static int ssam_nf_refcount_disable_free(struct ssam_controller *ctrl,
 	const struct ssam_event_registry reg = entry->key.reg;
 	const struct ssam_event_id id = entry->key.id;
 	struct ssam_nf *nf = &ctrl->cplt.event.notif;
-	int status;
+	int status = 0;
 
 	lockdep_assert_held(&nf->lock);
 
Signature · 1 line
2.31.1
author maintainer
#2 lore raw

PATCH 2/2 platform/surface: aggregator: Drop unnecessary variable initialization

In reply to Maximilian Luz

The status variable in ssam_controller_event_disable() is always set, no need to initialize it.

---
 drivers/platform/surface/aggregator/controller.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/platform/surface/aggregator/controller.c +1 -1
index 634399387d76..b8c377b3f932 100644
@@ -2464,7 +2464,7 @@ int ssam_controller_event_disable(struct ssam_controller *ctrl,
 	u16 rqid = ssh_tc_to_rqid(id.target_category);
 	struct ssam_nf *nf = &ctrl->cplt.event.notif;
 	struct ssam_nf_refcount_entry *entry;
-	int status = 0;
+	int status;
 
 	if (!ssh_rqid_is_event(rqid))
 		return -EINVAL;
Signature · 1 line
2.31.1
#3 lore raw
In reply to Maximilian Luz

Hi,

Quoted 9 lines · Maximilian Luz

Small fixes for "platform/surface: aggregator: Extend user-space interface for events".

Specifically, prevent use of an uniniitalized variable and drop an unnecessary initialization.

Maximilian Luz (2):
platform/surface: aggregator: Do not return uninitialized value platform/surface: aggregator: Drop unnecessary variable initialization

Thank you for your patch-series, I've applied the series to my review-hans branch:
https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/log/?h=review-hans

Note it will show up in my review-hans branch once I've pushed my local branch there, which might take a while.

Once I've run some tests on this branch the patches there will be added to the platform-drivers-x86/for-next branch and eventually will be included in the pdx86 pull-request to Linus for the next merge-window.

Regards,

Hans