ti-st: Use a signed return type for st_ll_sleep_state()
Subsystems (2)
PATCH 1/1 ti-st: Use a signed return type for st_ll_sleep_state()
From: Markus Elfring <[email protected]>
Date: Sat, 19 Dec 2015 17:15:34 +0100
The return type "unsigned long" was used by the st_ll_sleep_state() function despite of the aspect that it will eventually return a negative error code.
Improve this implementation detail by deletion of the type modifier then.
This issue was detected by using the Coccinelle software.
--- drivers/misc/ti-st/st_ll.c | 2 +- include/linux/ti_wilink_st.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/misc/ti-st/st_ll.c +1 -1
@@ -128,7 +128,7 @@ unsigned long st_ll_getstate(struct st_data_s *ll) }/* called from ST Core, when a PM related packet arrives */ -unsigned long st_ll_sleep_state (struct st_data_s *st_data, +long st_ll_sleep_state (struct st_data_s *st_data,unsigned char cmd) {switch (cmd) {
include/linux/ti_wilink_st.h +1 -1
@@ -391,7 +391,7 @@ void st_ll_disable(struct st_data_s *);* of the chip. */ unsigned long st_ll_getstate (struct st_data_s *); -unsigned long st_ll_sleep_state (struct st_data_s *,unsigned char ); +long st_ll_sleep_state (struct st_data_s *,unsigned char );void st_ll_wakeup (struct st_data_s *);/*
Signature · 1 line
2.6.3
It returns zero or negative error codes. The return value is never checked. Make it an int.
regards,
dan carpenter
PATCH v2 1/1 ti-st: Use a signed return type for st_ll_sleep_state()
From: Markus Elfring <[email protected]>
Date: Tue, 22 Dec 2015 14:40:47 +0100
The return type "unsigned long" was used by the st_ll_sleep_state() function even though it will eventually return a negative error code. Improve this implementation detail by using the type "int" instead.
This issue was detected by using the Coccinelle software.
--- drivers/misc/ti-st/st_ll.c | 2 +- include/linux/ti_wilink_st.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/misc/ti-st/st_ll.c +1 -1
@@ -128,7 +128,7 @@ unsigned long st_ll_getstate(struct st_data_s *ll) }/* called from ST Core, when a PM related packet arrives */ -unsigned long st_ll_sleep_state (struct st_data_s *st_data, +int st_ll_sleep_state (struct st_data_s *st_data,unsigned char cmd) {switch (cmd) {
include/linux/ti_wilink_st.h +1 -1
@@ -391,7 +391,7 @@ void st_ll_disable(struct st_data_s *);* of the chip. */ unsigned long st_ll_getstate (struct st_data_s *); -unsigned long st_ll_sleep_state (struct st_data_s *,unsigned char ); +int st_ll_sleep_state (struct st_data_s *,unsigned char );void st_ll_wakeup (struct st_data_s *);/*
Signature · 1 line
2.6.3