| 225 | /* buffer del */ |
| 226 | |
| 227 | int |
| 228 | cirbuf_del_buf_head(struct cirbuf *cbuf, unsigned int size) |
| 229 | { |
| 230 | if (!cbuf || !size || size > CIRBUF_GET_LEN(cbuf)) |
| 231 | return -EINVAL; |
| 232 | |
| 233 | cbuf->len -= size; |
| 234 | if (CIRBUF_IS_EMPTY(cbuf)) { |
| 235 | cbuf->start += size - 1; |
| 236 | cbuf->start %= cbuf->maxlen; |
| 237 | } |
| 238 | else { |
| 239 | cbuf->start += size; |
| 240 | cbuf->start %= cbuf->maxlen; |
| 241 | } |
| 242 | return 0; |
| 243 | } |
| 244 | |
| 245 | /* buffer del */ |
| 246 |
no outgoing calls