Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp4626607ybg; Mon, 8 Jun 2020 12:38:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwMx4JHirSj5eLmFBy2VVa02sv9DbiH9CPB5gBYrPGr1/x3TFsRu8nY+lpm5dM9rLwF1sh9 X-Received: by 2002:aa7:cc19:: with SMTP id q25mr22332160edt.26.1591645118863; Mon, 08 Jun 2020 12:38:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591645118; cv=none; d=google.com; s=arc-20160816; b=0RpfmjrID78QqUSdIjIkAxvEehyhCkOwkKjjKAaFI5nFd1X4gBF63bOCLVe+Bqs3SV BoflYcS535J+gOVmnRL7byGbUZ9b3tERL8AyiK5aE6H4AGcSbZJT7h9cntTUW6RGuSsb IfhoI/yS9quwfXCmnnpOIPp1eo8HMzdPSeVt06kR/RhtmswmfkZ55oFwiRW96d850MQJ 1kSIGm5FnR2qSj1uwwe/k2YSXszNJ/sjGTKQjvosEodp1JHjP0craiuIDrf2pWwstzbT 7lZo0arQnJQzqb2QcsJ9XRgDKgMc1Y/EO+oSxVe8pPLuPdBd5JemP8OircF3Eto3j1UN ypfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=qsN50RK5r6jDucbLG6NxXwSMIZheMgVO+8udfaUFEhA=; b=gOsHjnHQ/SYK67mfeubScTDBA7MSEYEZqrud/G9mHIoq6Ld9K/W31RIt/oloZbWMt0 vsWyLVSb5qt9/6y+LL9pWjiYqx2VLbZ0apePyF9DYv6nluWbYpdaHqs70whlbPFXk5jC LHAb79YlF0RCuldvEBDaSdMv6m8mdmcj+0q/SR7B6AYfnfjnErtHVd9nRSPGAIb5XpBE JWRQDN0AqtQ/rtuBreMTcdVGOGouujJIhF9zzWNxgJy+/x6/UIG3ND6Dl++JzInD9ipn BDSaU+WfwX9MVmHCTKA2NvQVpU0hBcQNhNLJdP/uO55IXPcnSzHZchpjpQxeLiMkwaBw 5ryA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=dnPpG0sR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o18si9368970ejr.423.2020.06.08.12.37.53; Mon, 08 Jun 2020 12:38:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=dnPpG0sR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726488AbgFHTeG (ORCPT + 99 others); Mon, 8 Jun 2020 15:34:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33008 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726413AbgFHTeF (ORCPT ); Mon, 8 Jun 2020 15:34:05 -0400 Received: from mail-lj1-x241.google.com (mail-lj1-x241.google.com [IPv6:2a00:1450:4864:20::241]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0BD04C08C5C2 for ; Mon, 8 Jun 2020 12:34:05 -0700 (PDT) Received: by mail-lj1-x241.google.com with SMTP id a25so22014567ljp.3 for ; Mon, 08 Jun 2020 12:34:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=qsN50RK5r6jDucbLG6NxXwSMIZheMgVO+8udfaUFEhA=; b=dnPpG0sRgWJSwbphbBzlq6YmOObuGHcgN3CFvKiU+huwVjg+2CRTE23BcRjG7iDJUq sLmFZCJFRIjxW7Qa+IYWpCjcAfV6dKqhIQf4+ymNh9wdF9ye5UnkiJnXekhYt8+Sx04Y SkK3HbcXNBE+uspuN45JcFfAp8ixin0Maw7yVe+rlSYQd2UB3JVG2xIGtqOkk3tHtaGW S3mYm65yYjhDClDTl9/+uoaijEXqK5JaOtu/F+rL2OFUsKLEGOHmJWFaR+lDc+hYPPiS rGJtDWGh/bl4fvEW/+xLXw4DA862+2NFTPO95MsB8YPlxAo7garOjhhs8p1ufwbIPAme Q70Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=qsN50RK5r6jDucbLG6NxXwSMIZheMgVO+8udfaUFEhA=; b=NryrhO9UjucRC+OVvemiAnBnj+TZQlyiKrJTk5brosNHe9OC2fegbYeh4ToV2j3Mx/ 2D1RilrogH4jjyV45Ig7YOBs3VP6tao9dLB+FeBZt6y/rn7y6erhChUDr9gAsgYKxLdc wkXRzAmWXty4ebOZjRTX+RQQ53BM6OEepgZB0ZqEUf47Eo7/62/QuQqaDNcayWwnxjYQ XWhKXETnlYIAEYKFq4yw0dEqi/s3UJLwRyytTDsLVwHmbT+S0vZZ/tPR/9zTRHZk86Kz 6ZJaMfgW6Ts3ktB1Ugw9PJRrT+xx6adOG4mtQIvbWIQwWt4p0YYKsJqgJKBeDwE1LVar zf3g== X-Gm-Message-State: AOAM532g6rALmDvxk2y7TA3p+BxN4wIyT9yDPwwfLHt8zdJWpNz/ypqF YbaMkzeeT+sZEGvEoaHtoOIAwPENvmQlIplHkMs= X-Received: by 2002:a2e:83c7:: with SMTP id s7mr12235681ljh.68.1591644843450; Mon, 08 Jun 2020 12:34:03 -0700 (PDT) MIME-Version: 1.0 References: <1590947491-11194-1-git-send-email-jrdr.linux@gmail.com> <7e725dd0-7423-b85b-ff56-9705419d13b9@nvidia.com> <20200608191459.GZ30374@kadam> In-Reply-To: <20200608191459.GZ30374@kadam> From: Souptick Joarder Date: Tue, 9 Jun 2020 01:03:51 +0530 Message-ID: Subject: Re: [PATCH] staging: kpc2000: kpc_dma: Convert get_user_pages() --> pin_user_pages() To: Dan Carpenter Cc: John Hubbard , "open list:ANDROID DRIVERS" , Bharath Vedartham , harshjain32@gmail.com, Greg KH , linux-kernel@vger.kernel.org, =?UTF-8?Q?Simon_Sandstr=C3=B6m?= , jane.pnx9@gmail.com Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 9, 2020 at 12:47 AM Dan Carpenter wrote: > > On Tue, Jun 09, 2020 at 12:31:42AM +0530, Souptick Joarder wrote: > > > > @@ -189,10 +192,9 @@ static int kpc_dma_transfer(struct dev_private_data *priv, > > > > sg_free_table(&acd->sgt); > > > > err_dma_map_sg: > > > > err_alloc_sg_table: > > > > > > So now we end up with two unnecessary labels. Probably best to delete two of these > > > three and name the remaining one appropriately: > > > > Hmm, I thought about it. But later decided to wait for review comments > > on the same in v1. > > I will remove it now. > > These are all unrelated to pin_user_pages(). Please don't do it in the > same patch. Staging code is there because it's ugly... If you don't > want to do unrelated changes to label names then you don't have to. What I am planning is to put this changes in a series. One patch will take care of pin_user_pages() related changes, 2nd patch will take care of minor bug fix in error path + level correction and 3rd patch will take care of set_page_dirty() -> set_page_dirty_lock(). Does it make sense ? > > Also on a personal note. The label name should say what the goto does > just like a function name says what the function does. "goto put_pages;" > Or "goto free_foo;". > > Don't do this: > > p = kmalloc(); > if (!p) > goto kmalloc_failed; > > This is a come-from label name and does not provide any information that > is not there on the line above... > > If you send a patch which uses your own personal style of label names, > I won't say anything about unless there is a bug. But just know in your > heart that you are wrong and I have silently reviewed your patch to > drivers/staging. > > regards, > dan carpenter