search for: curr

Displaying 20 results from an estimated 333 matches for "curr".

Did you mean: cur
2023 Mar 22
1
[PATCH vhost v4 02/11] virtio_ring: packed: separate dma codes
...@@ static inline int virtqueue_add_packed(struct virtqueue *_vq, struct vring_virtqueue *vq = to_vvq(_vq); struct vring_packed_desc *desc; struct scatterlist *sg; - unsigned int i, n, c, descs_used, err_idx; + unsigned int i, n, c, descs_used; __le16 head_flags, flags; - u16 head, id, prev, curr, avail_used_flags; + u16 head, id, prev, curr; int err; START_USE(vq); @@ -1461,7 +1461,6 @@ static inline int virtqueue_add_packed(struct virtqueue *_vq, } head = vq->packed.next_avail_idx; - avail_used_flags = vq->packed.avail_used_flags; WARN_ON_ONCE(total_sg > vq->pa...
2011 Feb 14
1
[PATCH] Staging: hv: Use list_entry for msg_info and remove associated comment
...nel_mgmt.c index a9c9d49..6c497e9 100644 --- a/drivers/staging/hv/channel_mgmt.c +++ b/drivers/staging/hv/channel_mgmt.c @@ -580,8 +580,9 @@ static void vmbus_onopen_result(struct vmbus_channel_message_header *hdr) spin_lock_irqsave(&vmbus_connection.channelmsg_lock, flags); list_for_each(curr, &vmbus_connection.chn_msg_list) { -/* FIXME: this should probably use list_entry() instead */ - msginfo = (struct vmbus_channel_msginfo *)curr; + msginfo = list_entry(curr, struct vmbus_channel_msginfo, + msglistentry); + requestheader = (struct vmbus_channel_message_header *)msgin...
2011 Feb 14
1
[PATCH] Staging: hv: Use list_entry for msg_info and remove associated comment
...nel_mgmt.c index a9c9d49..6c497e9 100644 --- a/drivers/staging/hv/channel_mgmt.c +++ b/drivers/staging/hv/channel_mgmt.c @@ -580,8 +580,9 @@ static void vmbus_onopen_result(struct vmbus_channel_message_header *hdr) spin_lock_irqsave(&vmbus_connection.channelmsg_lock, flags); list_for_each(curr, &vmbus_connection.chn_msg_list) { -/* FIXME: this should probably use list_entry() instead */ - msginfo = (struct vmbus_channel_msginfo *)curr; + msginfo = list_entry(curr, struct vmbus_channel_msginfo, + msglistentry); + requestheader = (struct vmbus_channel_message_header *)msgin...
2010 Apr 27
4
Patch sensible callback framework
...def void (*cb_loadfile_t)(const char* file, size_t cur, size_t total); +typedef void (*cb_floadfile_t)(size_t cur, size_t total); + + +int register_callback(uint16_t type, void *callback); +int unregister_callback(uint16_t type, void *callback); + +callback_record* foreach_callback(callback_record *current); +callback_record* foreach_callback_type(callback_record *current, uint16_t type); + +#endif diff -uprN syslinux-3.86-vanilla/com32/lib/Makefile syslinux-3.86/com32/lib/Makefile --- syslinux-3.86-vanilla/com32/lib/Makefile 2010-03-31 11:24:25.000000000 -0500 +++ syslinux-3.86/com32/lib/Makefile...
2012 Oct 02
3
[LLVMdev] interesting possible compiler bug
...Fix the test with a volatile pointer: Why would that be required? malloc() is defined by the standard to return a pointer that is distinct from any other valid pointer, or NULL. Any optimisation that makes any assumptions about its next value is invalid. > int main() { > volatile char *curr; > > do { > curr = malloc(1); > int i = *curr; This, in particular, looks very wrong. If curr is void, then you are dereferencing an invalid pointer, and so you are doing something undefined. In fact, this version of the code is completely free to elide the conditional loo...
2011 Feb 04
3
[LLVMdev] Data layout of structs
Dear all, I'm currently working on the automated program analysis tool AProVE (http://aprove.informatik.rwth-aachen.de/) and would like to use LLVM for analysis of C programs. I have the following example C program dealing with simple lists of integers: ------------ start C example ------------- #include<stdlib...
2012 Oct 02
2
[LLVMdev] interesting possible compiler bug
...cause Linux does not actually make malloc'd memory available until it is used. Here the allocated memory is never used, so if the compiler recognizes malloc as a standard library function with well-defined semantics, it can eliminate the actual call and pretend it succeeded. Since variable curr is not visible outside main and is not declared volatile, it can be optimized away." On 10/02/2012 02:12 AM, Nick Lewycky wrote: > David Chisnall wrote: >> On 2 Oct 2012, at 03:40, Nick Lewycky wrote: >> >>> As far as I know, this optimization is legal. Fix the test...
2023 Mar 02
1
[PATCH vhost v1 06/12] virtio_ring: packed: separate DMA codes
...eue *vq, @@ -1498,15 +1483,14 @@ static inline int virtqueue_add_vring_packed(struct vring_virtqueue *vq, { struct vring_packed_desc *desc; struct scatterlist *sg; - unsigned int i, n, c, descs_used, err_idx; + unsigned int i, n, c, descs_used; __le16 head_flags, flags; - u16 head, id, prev, curr, avail_used_flags; + u16 head, id, prev, curr; desc = vq->packed.vring.desc; head = vq->packed.next_avail_idx; i = head; descs_used = total_sg; - avail_used_flags = vq->packed.avail_used_flags; id = vq->free_head; BUG_ON(id == vq->packed.vring.num); @@ -1515,11 +1499,...
2012 Oct 02
4
[LLVMdev] interesting possible compiler bug
This code is essentially from an LTP test ( http://ltp.sourceforge.net/ <http://ltp.sourceforge.net/> ). #include <stdlib.h> int main() { void *curr; do { curr = malloc(1); } while (curr); return 0; } If you compile it with no optimization, it will keep the malloc calls. If you compile it with -O2, it will create an infinite loop, i.e. assuming that malloc always returns a non zero result and the result is not used. ~/llvm...
2012 Oct 02
0
[LLVMdev] interesting possible compiler bug
...e, and the last one goes through I/O which is permitted to do its own thing. (For instance, we don't forbid constant-folding "1+1" because a program may fopen and disassemble itself to look for the "add 1, 1" instruction.) >> int main() { >> volatile char *curr; >> >> do { >> curr = malloc(1); >> int i = *curr; > > This, in particular, looks very wrong. If curr is void, then you are dereferencing an invalid pointer, and so you are doing something undefined. Do you mean, if curr is NULL? It's a char*, not vo...
2012 Oct 02
0
[LLVMdev] interesting possible compiler bug
...actually make malloc'd memory available until it is used. Here the > allocated memory is never used, so if the compiler recognizes malloc as a > standard library function with well-defined semantics, it can eliminate the > actual call and pretend it succeeded. > > Since variable curr is not visible outside main and is not declared > volatile, it can be optimized away." > > > > > On 10/02/2012 02:12 AM, Nick Lewycky wrote: > >> David Chisnall wrote: >> >>> On 2 Oct 2012, at 03:40, Nick Lewycky wrote: >>> >>> As fa...
2012 Oct 02
0
[LLVMdev] interesting possible compiler bug
On 1 October 2012 18:34, reed kotler <rkotler at mips.com> wrote: > This code is essentially from an LTP test ( http://ltp.sourceforge.net/). > > > #include <stdlib.h> > > int main() { > void *curr; > > do { > curr = malloc(1); > } while (curr); > > return 0; > > } > > If you compile it with no optimization, it will keep the malloc calls. > > If you compile it with -O2, it will create an infinite loop, i.e. assuming > that malloc always returns...
2014 Nov 16
2
[PATCH] list-applications: Add support for pacman
...g, struct inspect_fs *fs) return ret; } +static struct guestfs_application2_list * +list_applications_pacman (guestfs_h *g, struct inspect_fs *fs) +{ + CLEANUP_FREE char *desc_file = NULL, *fname = NULL; + struct guestfs_application2_list *apps = NULL, *ret = NULL; + struct guestfs_dirent *curr = NULL; + FILE *fp; + char line[1024]; + size_t i, len; + CLEANUP_FREE char *name = NULL, *version = NULL, *desc = NULL; + CLEANUP_FREE char *arch = NULL, *url = NULL; + char *release = NULL; + char **key = NULL; + const size_t path_len = strlen ("/var/lib/pacman/local/") + strlen...
2015 Nov 02
2
help with push
Hi, sorry if I misunderstood everything... In the file src/gallium/drivers/nouveau/nv30/nv30_screen.c there is loans of PUSH_DATA which is basically *push->curr = data; I'm thinking that somehow push->curr is the bo->map = drm_mmap(...) that is called in nouveau_bo_map. But I cannot see how they are linked... Because when nouveau_bo_map calls nouveau_bo_wait push = cli_push_get(client, bo) returns NULL... Is push->curr the region of memory t...
2010 Dec 30
4
perl code to remove newlines
...here's just one: --------- begin snippet --------- while (<$in>) { s/<(\w*\W)/<\L$1/g; # Downcase XXX in "<XXX". s/<\/(\w*\W)/<\/\L$1/g; # Downcase XXX in "</XXX". if(/^>/) # if this line starts with '>' { # then $curr = tell $in; # Note current file position, seek $in, $prev, 0; # go back to previous line, chomp; # remove its trailing newline char, seek $in, $curr, 0; # and reset position to current line. } else { $curr = tell $in; # Note current file position, seek $in, $prev, 0; # go back to...
2010 Sep 21
1
[PATCH] Check cpus capacity, not real cores.
...2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/task-omatic/taskomatic.rb b/src/task-omatic/taskomatic.rb index 6f699d2..59a0fdd 100755 --- a/src/task-omatic/taskomatic.rb +++ b/src/task-omatic/taskomatic.rb @@ -169,7 +169,7 @@ class TaskOmatic #puts "and not #{curr.is_disabled.nil?} and #{curr.is_disabled == 0}" #puts "and #{vm ? vm : 'nil'} or #{vm ? vm.active : 'nil'}) or #{vm ? vm.node : 'nil'} != #{node.object_id}" - if node and node.cores >= db_vm.num_vcpus_allocated \ + if node and node.cpus &...
2015 Nov 02
2
help with push
But at the time the mesa3d file src/gallium/drivers/nouveau/nv30/nv30_screen.c is called and when the various PUSH_DATA begin to be called there is not yet a call to nouveau_pushbuf_space. So it would generate a seg fault in push->curr. Again, sorry for the confusion and thanks for the reply. Awaiting for an answer if possible. Thanks in advance. 2015-11-02 14:44 GMT-03:00 Ilia Mirkin <imirkin at alum.mit.edu>: > See libdrm's pushbuf.c -- iirc push->cur points to a GART-mapped bo. > > http://cgit.freedeskt...
2016 Jul 27
4
[PATCH v2 repost 6/7] mm: add the related functions to get free page info
On 07/26/2016 06:23 PM, Liang Li wrote: > + for_each_migratetype_order(order, t) { > + list_for_each(curr, &zone->free_area[order].free_list[t]) { > + pfn = page_to_pfn(list_entry(curr, struct page, lru)); > + if (pfn >= start_pfn && pfn <= end_pfn) { > + page_num = 1UL << order; > + if (pfn + page_num > end_pfn) > + page_num = end_pfn - pfn; &...
2016 Jul 27
4
[PATCH v2 repost 6/7] mm: add the related functions to get free page info
On 07/26/2016 06:23 PM, Liang Li wrote: > + for_each_migratetype_order(order, t) { > + list_for_each(curr, &zone->free_area[order].free_list[t]) { > + pfn = page_to_pfn(list_entry(curr, struct page, lru)); > + if (pfn >= start_pfn && pfn <= end_pfn) { > + page_num = 1UL << order; > + if (pfn + page_num > end_pfn) > + page_num = end_pfn - pfn; &...
2014 Nov 17
1
[PATCH] list-applications: Add support for pacman
...* +list_applications_pacman (guestfs_h *g, struct inspect_fs *fs) +{ + CLEANUP_FREE char *desc_file = NULL, *fname = NULL, *line = NULL; + CLEANUP_FREE_DIRENT_LIST struct guestfs_dirent_list *local_db = NULL; + struct guestfs_application2_list *apps = NULL, *ret = NULL; + struct guestfs_dirent *curr = NULL; + FILE *fp; + size_t i, allocsize = 0; + ssize_t len; + CLEANUP_FREE char *name = NULL, *version = NULL, *desc = NULL; + CLEANUP_FREE char *arch = NULL, *url = NULL; + char **key = NULL, *rel = NULL, *ver = NULL, *p; + int32_t epoch; + const size_t path_len = strlen ("/var/lib/...