Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1296791

[PATCH v2] ti-st: Use a signed return type for st_ll_sleep_state()

From SF Markus Elfring <elfring@users.sourceforge.net>
Newsgroups linux.kernel
Subject [PATCH v2] ti-st: Use a signed return type for st_ll_sleep_state()
Date 2015-12-22 14:50 +0100
Message-ID <qIvua-4Bu-3@gated-at.bofh.it> (permalink)
References <qHsyl-5vX-3@gated-at.bofh.it> <qHw8W-7P7-17@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: Markus Elfring <elfring@users.sourceforge.net>
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.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/misc/ti-st/st_ll.c   | 2 +-
 include/linux/ti_wilink_st.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/misc/ti-st/st_ll.c b/drivers/misc/ti-st/st_ll.c
index 93b4d67..788d436 100644
--- a/drivers/misc/ti-st/st_ll.c
+++ b/drivers/misc/ti-st/st_ll.c
@@ -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) {
diff --git a/include/linux/ti_wilink_st.h b/include/linux/ti_wilink_st.h
index 0a0d568..4205eb2 100644
--- a/include/linux/ti_wilink_st.h
+++ b/include/linux/ti_wilink_st.h
@@ -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 *);
 
 /*
-- 
2.6.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH] ti-st: Use a signed return type for st_ll_sleep_state() SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-19 17:30 +0100
  Re: [PATCH] ti-st: Use a signed return type for st_ll_sleep_state() Dan Carpenter <dan.carpenter@oracle.com> - 2015-12-19 21:20 +0100
    [PATCH v2] ti-st: Use a signed return type for st_ll_sleep_state() SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-22 14:50 +0100

csiph-web