Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1364756ybb; Sun, 29 Mar 2020 02:49:35 -0700 (PDT) X-Google-Smtp-Source: ADFU+vttU/tC54qw3Zd3PsEyshM4azFAY7OvACfuHS4/SPbycd8pZPwao30RGeBcQGQtjom6twkE X-Received: by 2002:a05:6808:b3b:: with SMTP id t27mr4536919oij.5.1585475375084; Sun, 29 Mar 2020 02:49:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585475375; cv=none; d=google.com; s=arc-20160816; b=nAns6QYXbMdDCL7AZu4PoyaeKjeuxpU2kSIgeQ6891EOyhtWQ8rrlMV9PK9tI3KOFE kUor9OY4SuVB/YhYaDCJHwv08Q6VbK32FBj7c2pj7QW9LfmXAL2PQCRRM6GRersq9kwj d7UoCuG5wIlpHvkjaYjH6WeuyoYqzn27v7JpGGlw+S4jjqjm4xpgk5o3EO8R2xprxoEu lrGFAbgYUn6UTFG9O1uTn8F8rvvs0AQ1mfkD7zG7bZVbIOlniXQr1ru7BVd7Ew0/3o7s wLhO5xRR6+wdCZX6KD60RZzBP2OpqSl+vcwsSxfJ1fyf2X4mMAGKx5LL3zCblOT8lTbl c2IQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=UMZgN5fOaszUGo75SoFyix2dp4Q8KUGdss6+As6J5NI=; b=ytGE2ujkVDlsHYZKbgg/+MQEl8W1Sj2VWhx1jpeCzShUBxtOw0bDHXaRhTfKn/jbY7 RGIEH0F0qwHVg7vfPpsQ+AbExCIjeJgF/pZBS36ZM5f5C+ys10aHERnZPKqsAgGwRkco 6V5/GCEh0sSDWdhx59gr4Gv7opzM4AJ/QIqoIzvt+7nh2vQWeu6oQL0NMgbNpvXod7Rb N6mxrKl+kQrJsYG/vQWXjIjMDlUmhtUz+1JpZtk3SqWEcRm3DMdkPplNCfhE1pdxHM0+ 1jL6ycQJ1gs1QDa7eroigCDMWsDyO4fCR9HZKu6lgTeMqkf0J8HZlc5bL5knNh79JdFB 50Ew== ARC-Authentication-Results: i=1; mx.google.com; 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 t11si4703143oig.108.2020.03.29.02.49.20; Sun, 29 Mar 2020 02:49:35 -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; 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 S1727903AbgC2Jrf (ORCPT + 99 others); Sun, 29 Mar 2020 05:47:35 -0400 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:42026 "EHLO mail2-relais-roc.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727503AbgC2Jrf (ORCPT ); Sun, 29 Mar 2020 05:47:35 -0400 X-IronPort-AV: E=Sophos;i="5.72,319,1580770800"; d="scan'208";a="442806325" Received: from abo-173-121-68.mrs.modulonet.fr (HELO hadrien) ([85.68.121.173]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Mar 2020 11:47:33 +0200 Date: Sun, 29 Mar 2020 11:47:33 +0200 (CEST) From: Julia Lawall X-X-Sender: jll@hadrien To: John Wyatt cc: outreachy-kernel@googlegroups.com, Greg Kroah-Hartman , Payal Kshirsagar , dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: Re: [Outreachy kernel] [PATCH] staging: fbtft: Replace udelay with preferred usleep_range In-Reply-To: <2fccf96c3754e6319797a10856e438e023f734a7.camel@gmail.com> Message-ID: References: <20200329092204.770405-1-jbwyatt4@gmail.com> <2fccf96c3754e6319797a10856e438e023f734a7.camel@gmail.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 29 Mar 2020, John Wyatt wrote: > On Sun, 2020-03-29 at 11:28 +0200, Julia Lawall wrote: > > > > On Sun, 29 Mar 2020, John B. Wyatt IV wrote: > > > > > Fix style issue with usleep_range being reported as preferred over > > > udelay. > > > > > > Issue reported by checkpatch. > > > > > > Please review. > > > > > > As written in Documentation/timers/timers-howto.rst udelay is the > > > generally preferred API. hrtimers, as noted in the docs, may be too > > > expensive for this short timer. > > > > > > Are the docs out of date, or, is this a checkpatch issue? > > > > > > Signed-off-by: John B. Wyatt IV > > > --- > > > drivers/staging/fbtft/fb_agm1264k-fl.c | 2 +- > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > diff --git a/drivers/staging/fbtft/fb_agm1264k-fl.c > > > b/drivers/staging/fbtft/fb_agm1264k-fl.c > > > index eeeeec97ad27..019c8cce6bab 100644 > > > --- a/drivers/staging/fbtft/fb_agm1264k-fl.c > > > +++ b/drivers/staging/fbtft/fb_agm1264k-fl.c > > > @@ -85,7 +85,7 @@ static void reset(struct fbtft_par *par) > > > dev_dbg(par->info->device, "%s()\n", __func__); > > > > > > gpiod_set_value(par->gpio.reset, 0); > > > - udelay(20); > > > + usleep_range(20, 20); > > > > usleep_range should have a range, eg usleep_range(50, 100);. But it > > is > > hard to know a priori what the range should be. So it is probably > > better > > to leave the code alone. > > Understood. > > With the question I wrote in the commit message: > > "As written in Documentation/timers/timers-howto.rst udelay is the > generally preferred API. hrtimers, as noted in the docs, may be too > expensive for this short timer. > > Are the docs out of date, or, is this a checkpatch issue?" > > Is usleep_range too expensive for this operation? > > Why does checkpatch favor usleep_range while the docs favor udelay? I don't know the answer in detail, but it is quite possible that checkpatch doesn't pay any attention to the delay argument. Checkpatch is a perl script that highlights things that may be of concern. It is not a precise static analsis tool. As a matter of form, all of your Please review comments should have been put below the ---. Currently, if someone had wanted to apply the patch, you would make them do extra work to remove this information. julia > > > > > julia > > > > > gpiod_set_value(par->gpio.reset, 1); > > > mdelay(120); > > > } > > > -- > > > 2.25.1 > > > > > > -- > > > 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 view this discussion on the web visit > > > https://groups.google.com/d/msgid/outreachy-kernel/20200329092204.770405-1-jbwyatt4%40gmail.com > > > . > > > > >