Thread (37 messages) 37 messages, 3 authors, 2015-12-11

[PATCH V6 18/26] coresight: etb10: implementing AUX space API

From: mathieu.poirier@linaro.org (Mathieu Poirier)
Date: 2015-12-11 21:17:14
Also in: lkml

On 11 December 2015 at 07:00, Alexander Shishkin
[off-list ref] wrote:
Mathieu Poirier [off-list ref] writes:
quoted
+static void *etb_get_config(struct coresight_device *csdev, int cpu,
+                         void **pages, int nr_pages, bool overwrite)
+{
+     int node;
+     struct cs_buffers *buf;
+
+     if (cpu == -1)
+             cpu = smp_processor_id();
+     node = cpu_to_node(cpu);
+
+     buf = kzalloc_node(sizeof(struct cs_buffers), GFP_KERNEL, node);
+     if (!buf)
+             return NULL;
+
+     buf->snapshot = overwrite;
+     buf->nr_pages = nr_pages;
+     buf->data_pages = pages;
+
+     return buf;
+}
Nitpick: why is this called "get_config"? I was just looking for
something else and noticed that both sources and sinks have
.get_config() callback (I was looking for the source's one), but this
guy doesn't seem to be getting any config, but rather allocating a
buffer descriptor.
My goal was to harmonise the naming convention between source and
sinks as much as possible, and I'm still not quite sure how to call
that function... Given the end result something like
"etb_alloc_buffer" would likely be more appropriate.
Regards,
--
Alex
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help