diff options
author | Tilman Schmidt <tilman@imap.cc> | 2012-04-25 09:02:20 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-05-07 22:37:56 -0400 |
commit | 81fa7b82570ec4337d328e6aee45689455508821 (patch) | |
tree | 79cdb018f497a18635ea78a171cd211845e0b605 /drivers/isdn/gigaset/isocdata.c | |
parent | 7643ffbd02ac46f880f64bed24a85d453b501418 (diff) |
isdn/gigaset: unify function return values
Various functions in the Gigaset driver were using different
conventions for the meaning of their int return values.
Align them to the usual negative error numbers convention.
Inspired-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Tilman Schmidt <tilman@imap.cc>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/isdn/gigaset/isocdata.c')
-rw-r--r-- | drivers/isdn/gigaset/isocdata.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/isdn/gigaset/isocdata.c b/drivers/isdn/gigaset/isocdata.c index a351c16705bd..bc29f1d52a2f 100644 --- a/drivers/isdn/gigaset/isocdata.c +++ b/drivers/isdn/gigaset/isocdata.c | |||
@@ -56,7 +56,7 @@ static inline int isowbuf_freebytes(struct isowbuf_t *iwb) | |||
56 | 56 | ||
57 | /* start writing | 57 | /* start writing |
58 | * acquire the write semaphore | 58 | * acquire the write semaphore |
59 | * return true if acquired, false if busy | 59 | * return 0 if acquired, <0 if busy |
60 | */ | 60 | */ |
61 | static inline int isowbuf_startwrite(struct isowbuf_t *iwb) | 61 | static inline int isowbuf_startwrite(struct isowbuf_t *iwb) |
62 | { | 62 | { |
@@ -64,12 +64,12 @@ static inline int isowbuf_startwrite(struct isowbuf_t *iwb) | |||
64 | atomic_inc(&iwb->writesem); | 64 | atomic_inc(&iwb->writesem); |
65 | gig_dbg(DEBUG_ISO, "%s: couldn't acquire iso write semaphore", | 65 | gig_dbg(DEBUG_ISO, "%s: couldn't acquire iso write semaphore", |
66 | __func__); | 66 | __func__); |
67 | return 0; | 67 | return -EBUSY; |
68 | } | 68 | } |
69 | gig_dbg(DEBUG_ISO, | 69 | gig_dbg(DEBUG_ISO, |
70 | "%s: acquired iso write semaphore, data[write]=%02x, nbits=%d", | 70 | "%s: acquired iso write semaphore, data[write]=%02x, nbits=%d", |
71 | __func__, iwb->data[iwb->write], iwb->wbits); | 71 | __func__, iwb->data[iwb->write], iwb->wbits); |
72 | return 1; | 72 | return 0; |
73 | } | 73 | } |
74 | 74 | ||
75 | /* finish writing | 75 | /* finish writing |
@@ -158,7 +158,7 @@ int gigaset_isowbuf_getbytes(struct isowbuf_t *iwb, int size) | |||
158 | /* no wraparound in valid data */ | 158 | /* no wraparound in valid data */ |
159 | if (limit >= write) { | 159 | if (limit >= write) { |
160 | /* append idle frame */ | 160 | /* append idle frame */ |
161 | if (!isowbuf_startwrite(iwb)) | 161 | if (isowbuf_startwrite(iwb) < 0) |
162 | return -EBUSY; | 162 | return -EBUSY; |
163 | /* write position could have changed */ | 163 | /* write position could have changed */ |
164 | write = iwb->write; | 164 | write = iwb->write; |
@@ -403,7 +403,7 @@ static inline int hdlc_buildframe(struct isowbuf_t *iwb, | |||
403 | unsigned char c; | 403 | unsigned char c; |
404 | 404 | ||
405 | if (isowbuf_freebytes(iwb) < count + count / 5 + 6 || | 405 | if (isowbuf_freebytes(iwb) < count + count / 5 + 6 || |
406 | !isowbuf_startwrite(iwb)) { | 406 | isowbuf_startwrite(iwb) < 0) { |
407 | gig_dbg(DEBUG_ISO, "%s: %d bytes free -> -EAGAIN", | 407 | gig_dbg(DEBUG_ISO, "%s: %d bytes free -> -EAGAIN", |
408 | __func__, isowbuf_freebytes(iwb)); | 408 | __func__, isowbuf_freebytes(iwb)); |
409 | return -EAGAIN; | 409 | return -EAGAIN; |
@@ -457,7 +457,7 @@ static inline int trans_buildframe(struct isowbuf_t *iwb, | |||
457 | return iwb->write; | 457 | return iwb->write; |
458 | 458 | ||
459 | if (isowbuf_freebytes(iwb) < count || | 459 | if (isowbuf_freebytes(iwb) < count || |
460 | !isowbuf_startwrite(iwb)) { | 460 | isowbuf_startwrite(iwb) < 0) { |
461 | gig_dbg(DEBUG_ISO, "can't put %d bytes", count); | 461 | gig_dbg(DEBUG_ISO, "can't put %d bytes", count); |
462 | return -EAGAIN; | 462 | return -EAGAIN; |
463 | } | 463 | } |