| 245 | /* buffer del */ |
| 246 | |
| 247 | int |
| 248 | cirbuf_del_buf_tail(struct cirbuf *cbuf, unsigned int size) |
| 249 | { |
| 250 | if (!cbuf || !size || size > CIRBUF_GET_LEN(cbuf)) |
| 251 | return -EINVAL; |
| 252 | |
| 253 | cbuf->len -= size; |
| 254 | if (CIRBUF_IS_EMPTY(cbuf)) { |
| 255 | cbuf->end += (cbuf->maxlen - size + 1); |
| 256 | cbuf->end %= cbuf->maxlen; |
| 257 | } |
| 258 | else { |
| 259 | cbuf->end += (cbuf->maxlen - size); |
| 260 | cbuf->end %= cbuf->maxlen; |
| 261 | } |
| 262 | return 0; |
| 263 | } |
| 264 | |
| 265 | /* del at head */ |
| 266 |
no outgoing calls