Received: by 10.213.65.68 with SMTP id h4csp1552076imn; Mon, 19 Mar 2018 07:15:58 -0700 (PDT) X-Google-Smtp-Source: AG47ELtBCpNPEoVDKzGRvf+zJe2gFAG/b6gqACEqWtw5nEGSP9v8lHB/pPp2qE2nZn8z5w7N7nXH X-Received: by 10.98.232.6 with SMTP id c6mr10317454pfi.242.1521468958818; Mon, 19 Mar 2018 07:15:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521468958; cv=none; d=google.com; s=arc-20160816; b=b20so7hYTyjfHJYS+60vHn9E5G1q8F1dbOR2siLjZ7GRNPcVIZ13eKAZpwvYQGtxcJ J6YgRGQAWDxdLcbCw9YP8HMxDG1LxVuRYx55va158CM9WHgLYLi2mhru+KwrjwUY0ag9 foapyBp4l53ZJGs6aN4rZXSxBxx9mVGRHJJEry7QYoP6V4JgA/HC8kR0Cg1XNa/kYcWZ arAjLLntmraefMokgsnYmB6yLkRdiITnhIY679VjDPyQUe9EEPUGkpf1CrRnsAVvZSPj WYhRy/ww7MTZytlNsOBIUQQfDbzxc0jWVF3PV3oMeurzLZ83/CUMZZ0aKhqJn4CAH3w0 bAUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:mail-followup-to :message-id:subject:cc:to:from:date:dkim-signature :arc-authentication-results; bh=ErkHpsCZwuNJAcBMGqsubnJQStBFZDyIcUzZotoleXM=; b=NDslqzUOjRMvYJdQN29qE+XA6IUyV9ebfIp9A04N5GioasFWfGhK5S0L1wPH3wkIwR pPvEE8UyIY/xQdzXPgMniV9D4R6vCIsp6bel5PTgtJq46SbPc5ybhGMRLcghEqhGnuTE CJHzZJrnHVkYuBrlrCFgtQiIrq9bKKe770udseUJ/o+Ih4UBZIsuV5A93CCLcyvxUOyh nMqi8m5aucBe9X5Eim17m/crPgY0hl3mASUyGTo36qjvPqSre36945QNcUU2F7/IgHIy ApdAJ222LF7TufGk9F3gWKamicLItMlDh/Rq2r+CqiA5tjeMRZ/g4pt/76RXsYTEespy tK5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@ffwll.ch header.s=google header.b=J05XW8L3; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o26si36365pge.538.2018.03.19.07.15.44; Mon, 19 Mar 2018 07:15:58 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@ffwll.ch header.s=google header.b=J05XW8L3; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933419AbeCSONN (ORCPT + 99 others); Mon, 19 Mar 2018 10:13:13 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:39802 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933258AbeCSONI (ORCPT ); Mon, 19 Mar 2018 10:13:08 -0400 Received: by mail-wm0-f68.google.com with SMTP id f125so7625073wme.4 for ; Mon, 19 Mar 2018 07:13:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=sender:date:from:to:cc:subject:message-id:mail-followup-to :references:mime-version:content-disposition:in-reply-to:user-agent; bh=ErkHpsCZwuNJAcBMGqsubnJQStBFZDyIcUzZotoleXM=; b=J05XW8L3SwAAubFWOZqI2lHjzzZfLiYvW2gHsqCrj0QThUdicx7Cm8aFBqax67wSuS hVkNIvpgNjOStlEmiKiCM6iCrxwZZTNIBIbrO3XoEDVycWiQofbhv9/JO+gWnb3rDN46 nbX8QrNzmOjb0QP6Qw6IAuhyHTAiPqsWS85NA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to:user-agent; bh=ErkHpsCZwuNJAcBMGqsubnJQStBFZDyIcUzZotoleXM=; b=lnaRc0E4YFl1TH16DAJeQKRlcSQ4gOHzLxpR6WtyP5t01YNbmVD0qcrPztr8mVLdya Sr8iOaqVzzeJahKhsOdj5yWJ+yl03nHeB01Zu3ArDMPan158sJIBA9KqpHxT7/NAfCT7 oBQZOHZ48/6zDGKaiJ0ErMemmmnzmexWLbtK4zxUS2AVsGS09Ae2RYChH8NZHFKPdGVM SOHtpqmo4LbU8jyE8fYEeO+jH67ks5iOPP2tsZB+mrVgo98OCWHDmPAhIIysd8X920w2 H8PQjZDvB47Y8m+1VnxyqpS5jue1E2i1UJPRhsr8AlOIbFBu7tq3AHKFAYvZyzOpAgUO Cq8Q== X-Gm-Message-State: AElRT7HAV+Ig/ucM4u66/F95zSGEhQR6IWpk9p+/Dnc1WKuG9RdNG808 FT3I4jyE6J/Y7nT3PDwBIYvLsg== X-Received: by 10.80.184.9 with SMTP id j9mr10212755ede.272.1521468786909; Mon, 19 Mar 2018 07:13:06 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:5635:0:39d2:f87e:2033:9f6]) by smtp.gmail.com with ESMTPSA id m5sm247066edb.97.2018.03.19.07.13.05 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 19 Mar 2018 07:13:06 -0700 (PDT) Date: Mon, 19 Mar 2018 15:13:04 +0100 From: Daniel Vetter To: Arushi Singhal Cc: daniel.vetter@intel.com, Gustavo Padovan , Sean Paul , David Airlie , Ben Skeggs , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, nouveau@lists.freedesktop.org, outreachy-kernel@googlegroups.com Subject: Re: [Outreachy kernel] [PATCH] gpu: drm: Use list_{next/prev}_entry instead of list_entry Message-ID: <20180319141304.GP14155@phenom.ffwll.local> Mail-Followup-To: Arushi Singhal , daniel.vetter@intel.com, Gustavo Padovan , Sean Paul , David Airlie , Ben Skeggs , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, nouveau@lists.freedesktop.org, outreachy-kernel@googlegroups.com References: <20180319050530.GA25589@seema-Inspiron-15-3567> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180319050530.GA25589@seema-Inspiron-15-3567> X-Operating-System: Linux phenom 4.15.0-1-amd64 User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Mar 19, 2018 at 10:35:30AM +0530, Arushi Singhal wrote: > 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 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 a nouveau: prefix. Both patches need to be submitted to slightly different sets of maintainers too, pls consult scripts/get_maintainers.pl Thanks, Daniel > --- > 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/gpu/drm/drm_lease.c > index 1402c0e..4dcfb5f 100644 > --- a/drivers/gpu/drm/drm_lease.c > +++ b/drivers/gpu/drm/drm_lease.c > @@ -340,7 +340,7 @@ static void _drm_lease_revoke(struct drm_master *top) > break; > > /* Over */ > - master = list_entry(master->lessee_list.next, struct drm_master, lessee_list); > + master = list_next_entry(master, lessee_list); > } > } > } > diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/clk/base.c b/drivers/gpu/drm/nouveau/nvkm/subdev/clk/base.c > index e4c8d31..81c3567 100644 > --- a/drivers/gpu/drm/nouveau/nvkm/subdev/clk/base.c > +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/clk/base.c > @@ -134,7 +134,7 @@ 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 > > -- > You received this message because you are subscribed to the Google Groups "outreachy-kernel" group. > To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com. > To post to this group, send email to outreachy-kernel@googlegroups.com. > To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20180319050530.GA25589%40seema-Inspiron-15-3567. > For more options, visit https://groups.google.com/d/optout. -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch