Displaying 14 results from an estimated 14 matches for "list_prev_entry".
2018 Mar 19
4
[PATCH] gpu: drm: Use list_{next/prev}_entry instead of list_entry
This patch replace list_entry with list_{next/prev}_entry as it makes
the code more clear to read.
Done using coccinelle:
@@
expression e1;
identifier e3;
type t;
@@
(
- list_entry(e1->e3.next,t,e3)
+ list_next_entry(e1,e3)
|
- list_entry(e1->e3.prev,t,e3)
+ list_prev_entry(e1,e3)
)
Signed-off-by: Arushi Singhal <arushisinghal19971997 at gmail.com>
---
drivers/gpu/drm/drm_lease.c | 2 +-
drivers/gpu/drm/nouveau/nvkm/subdev/clk/base.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/drm_lease.c b/drivers/...
2018 Mar 25
2
[Outreachy kernel] [PATCH] gpu: drm: Use list_{next/prev}_entry instead of list_entry
...ad.
> > Done using coccinelle:
> >
> > @@
> > expression e1;
> > identifier e3;
> > type t;
> > @@
> > (
> > - list_entry(e1->e3.next,t,e3)
> > + list_next_entry(e1,e3)
> > |
> > - list_entry(e1->e3.prev,t,e3)
> > + list_prev_entry(e1,e3)
> > )
>
> This looks like a rule that could be nice for the Linux kernel in general,
> because the code really is much simpler.
>
> I would suggest to write the rule in a more robust way, as follows:
>
> @@
> identifier e3;
> type t;
> t *e1;
> @@
>...
2018 Mar 19
0
[Outreachy kernel] [PATCH] gpu: drm: Use list_{next/prev}_entry instead of list_entry
...list_{next/prev}_entry as it makes
> the code more clear to read.
> Done using coccinelle:
>
> @@
> expression e1;
> identifier e3;
> type t;
> @@
> (
> - list_entry(e1->e3.next,t,e3)
> + list_next_entry(e1,e3)
> |
> - list_entry(e1->e3.prev,t,e3)
> + list_prev_entry(e1,e3)
> )
This looks like a rule that could be nice for the Linux kernel in general,
because the code really is much simpler.
I would suggest to write the rule in a more robust way, as follows:
@@
identifier e3;
type t;
t *e1;
@@
(
- list_entry(e1->e3.next,t,e3)
+ list_next_entry(e1,e3)...
2018 Mar 26
2
[PATCH v2 2/2] gpu: drm: nouveau: Use list_{next/prev}_entry instead of list_entry
...te *pstate,
> nvkm_volt_map(volt, volt->max2_id, clk->temp));
>
> for (cstate = start; &cstate->head != &pstate->list;
> - cstate = list_entry(cstate->head.prev, typeof(*cstate), head)) {
> + cstate = list_prev_entry(cstate, head)) {
> if (nvkm_cstate_valid(clk, cstate, max_volt, clk->temp))
> break;
> }
> --
> 2.7.4
>
2018 Mar 27
2
[PATCH] gpu: drm: nouveau: Use list_for_each_entry_from_reverse
...if (!pstate || !start)
@@ -133,13 +132,12 @@ nvkm_cstate_find_best(struct nvkm_clk *clk, struct nvkm_pstate *pstate,
max_volt = min(max_volt,
nvkm_volt_map(volt, volt->max2_id, clk->temp));
- for (cstate = start; &cstate->head != &pstate->list;
- cstate = list_prev_entry(cstate, head)) {
- if (nvkm_cstate_valid(clk, cstate, max_volt, clk->temp))
+ list_for_each_entry_from_reverse(start, &pstate->list, head) {
+ if (nvkm_cstate_valid(clk, start, max_volt, clk->temp))
break;
}
- return cstate;
+ return start;
}
static struct nvkm_cstate *
-...
2018 Mar 19
0
[Outreachy kernel] [PATCH] gpu: drm: Use list_{next/prev}_entry instead of list_entry
...ist_{next/prev}_entry as it makes
> the code more clear to read.
> Done using coccinelle:
>
> @@
> expression e1;
> identifier e3;
> type t;
> @@
> (
> - list_entry(e1->e3.next,t,e3)
> + list_next_entry(e1,e3)
> |
> - list_entry(e1->e3.prev,t,e3)
> + list_prev_entry(e1,e3)
> )
>
> Signed-off-by: Arushi Singhal <arushisinghal19971997 at gmail.com>
Thanks for your patch. Looks correct, but for merge technical reasons can
you please split it into 2 patches? One for drm_lease.c, with a drm/lease:
prefix, and one for the nouveau driver change, with...
2018 Mar 25
4
[PATCH v2 0/2] drm: Replace list_entry
Replace list_entry with list_{next/prev}_entry.
Arushi Singhal (2):
gpu: drm/lease:: Use list_{next/prev}_entry instead of list_entry
gpu: drm: nouveau: Use list_{next/prev}_entry instead of list_entry
drivers/gpu/drm/drm_lease.c | 2 +-
drivers/gpu/drm/nouveau/nvkm/subdev/clk/base.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
--
changes in v2
*All the
2018 Mar 25
0
[PATCH v2 2/2] gpu: drm: nouveau: Use list_{next/prev}_entry instead of list_entry
...nvkm_cstate_find_best(struct nvkm_clk *clk, struct nvkm_pstate *pstate,
nvkm_volt_map(volt, volt->max2_id, clk->temp));
for (cstate = start; &cstate->head != &pstate->list;
- cstate = list_entry(cstate->head.prev, typeof(*cstate), head)) {
+ cstate = list_prev_entry(cstate, head)) {
if (nvkm_cstate_valid(clk, cstate, max_volt, clk->temp))
break;
}
--
2.7.4
2018 Mar 26
0
[PATCH v2 2/2] gpu: drm: nouveau: Use list_{next/prev}_entry instead of list_entry
...nvkm_volt_map(volt, volt->max2_id, clk->temp));
> >
> > for (cstate = start; &cstate->head != &pstate->list;
> > - cstate = list_entry(cstate->head.prev, typeof(*cstate), head)) {
> > + cstate = list_prev_entry(cstate, head)) {
This loop could be written as:
cstate = start; /* cstate looks redundant here, just use start? */
list_for_each_entry_from_reverse(cstate, &pstate->list, head)
> > if (nvkm_cstate_valid(clk, cstate, max_volt, clk->temp))
> >...
2018 Mar 27
0
[PATCH] gpu: drm: nouveau: Use list_for_each_entry_from_reverse
...t(struct nvkm_clk *clk, struct nvkm_pstate *pstate,
> max_volt = min(max_volt,
> nvkm_volt_map(volt, volt->max2_id, clk->temp));
>
> - for (cstate = start; &cstate->head != &pstate->list;
> - cstate = list_prev_entry(cstate, head)) {
> - if (nvkm_cstate_valid(clk, cstate, max_volt, clk->temp))
> + list_for_each_entry_from_reverse(start, &pstate->list, head) {
> + if (nvkm_cstate_valid(clk, start, max_volt, clk->temp))
> break;
&g...
2018 Mar 27
0
[PATCH v2] gpu: drm: nouveau: Use list_for_each_entry_from_reverse
...(volt->max0_id != 0xff)
@@ -133,8 +132,7 @@ nvkm_cstate_find_best(struct nvkm_clk *clk, struct nvkm_pstate *pstate,
max_volt = min(max_volt,
nvkm_volt_map(volt, volt->max2_id, clk->temp));
- for (cstate = start; &cstate->head != &pstate->list;
- cstate = list_prev_entry(cstate, head)) {
+ list_for_each_entry_from_reverse(cstate, &pstate->list, head) {
if (nvkm_cstate_valid(clk, cstate, max_volt, clk->temp))
break;
}
--
2.7.4
2023 Jun 29
3
[PATCH drm-next v6 02/13] drm: manager to keep track of GPUs VA mappings
...gpuva_ops to get the last &drm_gpuva_op from
+ */
+#define drm_gpuva_last_op(ops) \
+ list_last_entry(&(ops)->list, struct drm_gpuva_op, entry)
+
+/**
+ * drm_gpuva_prev_op - previous &drm_gpuva_op in the list
+ * @op: the current &drm_gpuva_op
+ */
+#define drm_gpuva_prev_op(op) list_prev_entry(op, entry)
+
+/**
+ * drm_gpuva_next_op - next &drm_gpuva_op in the list
+ * @op: the current &drm_gpuva_op
+ */
+#define drm_gpuva_next_op(op) list_next_entry(op, entry)
+
+struct drm_gpuva_ops *
+drm_gpuva_sm_map_ops_create(struct drm_gpuva_manager *mgr,
+ u64 addr, u64 range,
+...
2023 Jul 13
1
[PATCH drm-next v7 02/13] drm: manager to keep track of GPUs VA mappings
...uva_ops to get the last &drm_gpuva_op from
+ */
+#define drm_gpuva_last_op(ops) \
+ list_last_entry(&(ops)->list, struct drm_gpuva_op, entry)
+
+/**
+ * drm_gpuva_prev_op() - previous &drm_gpuva_op in the list
+ * @op: the current &drm_gpuva_op
+ */
+#define drm_gpuva_prev_op(op) list_prev_entry(op, entry)
+
+/**
+ * drm_gpuva_next_op() - next &drm_gpuva_op in the list
+ * @op: the current &drm_gpuva_op
+ */
+#define drm_gpuva_next_op(op) list_next_entry(op, entry)
+
+struct drm_gpuva_ops *
+drm_gpuva_sm_map_ops_create(struct drm_gpuva_manager *mgr,
+ u64 addr, u64 range,
+...
2023 Jul 20
2
[PATCH drm-misc-next v8 01/12] drm: manager to keep track of GPUs VA mappings
...uva_ops to get the last &drm_gpuva_op from
+ */
+#define drm_gpuva_last_op(ops) \
+ list_last_entry(&(ops)->list, struct drm_gpuva_op, entry)
+
+/**
+ * drm_gpuva_prev_op() - previous &drm_gpuva_op in the list
+ * @op: the current &drm_gpuva_op
+ */
+#define drm_gpuva_prev_op(op) list_prev_entry(op, entry)
+
+/**
+ * drm_gpuva_next_op() - next &drm_gpuva_op in the list
+ * @op: the current &drm_gpuva_op
+ */
+#define drm_gpuva_next_op(op) list_next_entry(op, entry)
+
+struct drm_gpuva_ops *
+drm_gpuva_sm_map_ops_create(struct drm_gpuva_manager *mgr,
+ u64 addr, u64 range,
+...