Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1359727ybb; Sun, 29 Mar 2020 02:41:05 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtsgwAXt9xrssInY29+NMBTs8fOEa1NB0jiQUUGIh+JwR3tJK6u8nhvMTjw06/n4CZC4olI X-Received: by 2002:aca:ebc5:: with SMTP id j188mr4509869oih.65.1585474864941; Sun, 29 Mar 2020 02:41:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585474864; cv=none; d=google.com; s=arc-20160816; b=dBCG6K2Oy84RDyTy8HKm+wuLl2XWgVcfRRxJ8CH2x7cP55WDQ8uJ36TaOlP5tp3OTP HEfbqhRPelGFl1bxjKh7q4TTOs1kPlBQ7XBe2KTAN/mtAVc/YiTPucz5eQil8rHdji8D gaYxXyu9OVjlPYCtPLgwTdoAE82b6ifbq2wszlGvsIj2w6VRysjOBHDqSv0xZFXVNrdA OmITBuEsG4237hQzztVMBqAwLSQlNbeElpAr8ew5MmygY83o3pn85L1jSZskidGR7Wg5 Vz5ci6ByjATunZ1Sfg5puzJ8LpGiM+sPl1qsnwgs4sKdXfuGQko3FvPgAgn1/NAcVtCX iMvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id:dkim-signature; bh=1FjUt0FY4qG4swr3glwUOGPZovJqvh5BcKDS4lGNLW4=; b=EyIxdXgFyih/9YElxDAvF8U60zYW67xs8lyYCjmohCzg1RRCsslRD9UKiT6SjFIdMo IAGQGHmn9kCgMmxDDnpuy8FXml4h+jJho/p0CB6RgPJAA5bUnRAMa4yJrnDWIcnSHXpR oK4Jdiqz1FS53i5fUmuK4Pv5odTQPNYDbRytc5wAGZsJMZpwiwCr/jF0VcDcllkE/4q/ pSXGobRvKBdCSWQmMGp/1ZMCABa3kox1PoGWeMb/jLqiWMR/dkQb/Zk3O2PgkZyOeGQp +vlbl7IzgKyPvjmLHQMBslfHcZQjMIAZgj3P4MkBR8ijvNCF/lmJZsD39sbPsAKasIO+ 5U8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=JTmZm4tA; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m25si4523067oic.230.2020.03.29.02.40.53; Sun, 29 Mar 2020 02:41:04 -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=pass header.i=@gmail.com header.s=20161025 header.b=JTmZm4tA; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727936AbgC2Ji7 (ORCPT + 99 others); Sun, 29 Mar 2020 05:38:59 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:41338 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727286AbgC2Ji7 (ORCPT ); Sun, 29 Mar 2020 05:38:59 -0400 Received: by mail-pf1-f195.google.com with SMTP id a24so194572pfc.8; Sun, 29 Mar 2020 02:38:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:subject:from:to:cc:date:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=1FjUt0FY4qG4swr3glwUOGPZovJqvh5BcKDS4lGNLW4=; b=JTmZm4tANjipQr6DLS3RinvGorU5jef6avNVRWTXMGMOHc5zWJD8xRNxFdvfYAU4My dEKmoB/HJdqNKyrKgkKhGvUtY2NYkWNMrIpeZcIPjbvpkgSoKP+IlQUNP6CyEu+b4qGT l+YPnkDIixPJwYLwiuhYT1u38s37mYmi54uDWkT7EzzbeLUFYD5j78Upnr/2DGP4+d6m fXVTjObFPYSWpVc+/5VbiQy/dyhcRHQTNROPixtBi5Cc7g9PWtN2eezd9eFyd2k8FEjg w49fddJ9HlCac53/1mK3H20pfoGxPXiO70i0BlYo5w+3HCm3cV8SOG5GXIG7hlLiOHcB hA5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=1FjUt0FY4qG4swr3glwUOGPZovJqvh5BcKDS4lGNLW4=; b=Ta+fMBXBVVHCiMwkQNmuuJFGEplmsOrKixl7Jyd2QPcMFy8L/C+ACS45H2CVs5eBmt Chn2DC719xnITo/ye/d6D6+e2i1Tpn8wSBs56pXCxKX6jlrUP41hiwYqWxfiJg6laGSq EwaOx4VHxj5TFJklYzxUKuFhVahds783espD5zUEFgUgfLoQFRcKWl/c54rbp40G+IJE rWnKiAYjyYZDjbAT5GGPdIMVCe/VHCZHzM1X/f9wfPmVC7j2ZIv6xlV4Da1SYWEcPtpM tKqr1HJ2EsFQrvNQhoa1KIFHv/Crqbd5IWRA5XROlymLb2Tw4PauvSoDF4mGvOCPRHgP Nlgg== X-Gm-Message-State: ANhLgQ2QB3Ie5zxK1aP1wPiWl9LNZNRrT3tGWt15Xb/OmgzAAq+O5H+P ha9m+JzmmorSZewVPGulMMQ= X-Received: by 2002:a62:160b:: with SMTP id 11mr8149948pfw.189.1585474737395; Sun, 29 Mar 2020 02:38:57 -0700 (PDT) Received: from ManjaroKDE ([47.144.161.84]) by smtp.gmail.com with ESMTPSA id y29sm7265920pge.22.2020.03.29.02.38.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Mar 2020 02:38:56 -0700 (PDT) Message-ID: <2fccf96c3754e6319797a10856e438e023f734a7.camel@gmail.com> Subject: Re: [Outreachy kernel] [PATCH] staging: fbtft: Replace udelay with preferred usleep_range From: John Wyatt To: Julia Lawall 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 Date: Sun, 29 Mar 2020 02:38:51 -0700 In-Reply-To: References: <20200329092204.770405-1-jbwyatt4@gmail.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.36.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? > > 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 > > . > >