Lines Matching defs:item
41 /* for log item ----------------------------------- */
185 static bool check_log_item_validite(const struct log_item *item,
188 bool con = (item && (item->magic == LOG_ITEM_MAGIC) &&
189 (item->buffer_len > 0) &&
190 (item->real_len > 0) &&
191 (item->buffer_len % LOG_ITEM_LEN_ALIGN == 0) &&
192 (item->real_len <= item->buffer_len) &&
193 ((item->buffer_len - item->real_len) < LOG_ITEM_LEN_ALIGN) &&
194 (item->buffer_len + sizeof(*item) <= item_max_size));
203 struct log_item *item = NULL;
209 while ((i + sizeof(*item) + LOG_ITEM_LEN_ALIGN) <= scope_len) {
211 item = (struct log_item *)(uintptr_t)(buffer_start + read_pos + i);
214 if (check_log_item_validite(item, max_size))
218 item = NULL;
221 return item;
267 tloge("copy failed, item len %u\n", item_len);
750 static int log_pool_item_check(struct log_item *item, struct teelogger_log_pool pool_item)
752 if (item->magic != LOG_ITEM_MAGIC || item->buffer_len == 0 || item->real_len == 0||
753 item->buffer_len % LOG_ITEM_LEN_ALIGN != 0 || item->real_len > item->buffer_len ||
754 (item->buffer_len - item->real_len) >= (uint16_t)LOG_ITEM_LEN_ALIGN ||
755 (uint64_t)(item->buffer_len + sizeof(struct log_item)) > pool_item.size)
765 struct log_item *item = NULL;
795 item = (struct log_item *)(uintptr_t)((uint64_t)(uintptr_t)pool_buffer->buffer_start +
797 if (copy_from_user((void *)item, (void *)pool_item.addr, pool_item.size) != 0) {
798 tloge("item copy_from_user error\n");
802 if (log_pool_item_check(item, pool_item) != 0) {
803 tloge("item check error\n");
808 item->serial_no = ++g_logserialno;
810 if (item->serial_no == 0)
811 item->serial_no = ++g_logserialno;
812 item->new_line = (unsigned char)'\n';
989 struct log_item *item = NULL;
994 ((read_pos + i + sizeof(*item)) < max_len)) {
998 item = (struct log_item *)(buffer_start + read_pos + i);
1000 if (check_log_item_validite(item, item_max_size)) {
1001 if ((read_pos + i + sizeof(*item) +
1002 item->buffer_len) > max_len) {
1003 tloge("check item len error\n");
1007 return item;
1011 item = NULL;