Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp396143rdh; Thu, 26 Oct 2023 05:29:16 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFFatsIQhCqzNSiXrp0LCo5nPbcQ2Y0OWwlYe9cfue/XpZpyBMB1Vbw728QytYD87k5mpWn X-Received: by 2002:a05:690c:709:b0:5ae:15bb:466a with SMTP id bs9-20020a05690c070900b005ae15bb466amr4192240ywb.14.1698323355975; Thu, 26 Oct 2023 05:29:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698323355; cv=none; d=google.com; s=arc-20160816; b=NtAn1PgYiR9v77DukEb5/XX78Encp9MjKyzO7QoEmOQJPWgUk/8eDONvZ+PluUbGwF cGd0159WVN779WQLwp5HZWg5ZJPkhw3z7Ydx99wg6hFLEr2CilnZyBPlq0fb+HgAgTW7 C1LgixMKvBlcisyn+R+33rJ2cZ/t5VMpu/OKb8iMkZaXiDZouQaXoS7D7cR4frRsDcyp umPRI/UCAlArOyoBRthPlKEOgRu4v09vkEiLr+e0f+ODOFSxnLq+C+X3/d6brsgvRKxZ hk4ka9ZhcQQtUvIN6sx5SUP3SSB0w68lF+Q6N/n0MF0OIpYpwwJf4fJAOV8jefyU7XAG 9IkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=9IBEv/O80HNkfZFTysz0lNdRsT33RzTkskLkw3trITY=; fh=8uCvlVcir7SYktHnpkKRLoKDISFxVavj8IULxfkTiK0=; b=pWyIj5Na6DJ3TCDMZj4OkXWJiPAqG+braLeTQQ62l+xk/U88v7X1UBIJswa9nNfGPW JlGqmva333fZcFe0td8c3XXjIu7cLliGWNG9jJYQQSn9X5OZsT8EWr2ICxP+/3gZHhVi Mh4ODzMax0VM5sOB/z6KGUC4d5UuDW1S+JFQlwuvm62m0JemsCHAJNpY4MiMdo3AkJy7 4TeJ8kMyEe2MjldM5qhS/jGo5+T1b4oOvTU74EvuSXl8U330xliSD1d8e50rFy5yGN97 JHAEJwK4lHJOnjZtH25TJ+VAiYTKo+lZsYFbG4N7OhnusSzFPbt1Ti+HsnVlH+2pkmyo ixfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=Dmi+v8z4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id b125-20020a0df283000000b005a242ee87dfsi13050949ywf.378.2023.10.26.05.29.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Oct 2023 05:29:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=Dmi+v8z4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id E5D6D810CA89; Thu, 26 Oct 2023 05:29:12 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344932AbjJZM3E (ORCPT + 99 others); Thu, 26 Oct 2023 08:29:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34084 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231287AbjJZM3C (ORCPT ); Thu, 26 Oct 2023 08:29:02 -0400 Received: from mail-ed1-x531.google.com (mail-ed1-x531.google.com [IPv6:2a00:1450:4864:20::531]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F09831B4 for ; Thu, 26 Oct 2023 05:28:59 -0700 (PDT) Received: by mail-ed1-x531.google.com with SMTP id 4fb4d7f45d1cf-53eeb28e8e5so9936a12.1 for ; Thu, 26 Oct 2023 05:28:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1698323338; x=1698928138; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=9IBEv/O80HNkfZFTysz0lNdRsT33RzTkskLkw3trITY=; b=Dmi+v8z4x3YyTvUumRpW0CQnjft4HCgqEST7xUOIlcEzPuF5yQEXh0pg6HLUNweT3l Z0wwTsCUn7tZ0GPGJ2PL6gxLDP75fwUKBo/D0x6z6DJf6q0ebeCcXfm8lyKmPSBpH+FD v+uEBD7OmfdoXJq7697xpjSWwbwAk9/Yteq8Exw7ANxVwyqhikIoIgAspd4B2MyYA6r2 +eVbv+dYhPMyc43r3CF6i+UBRVsq1scOnYYzmnp5U06Qf+hV8M5aVp2dRaG2GCEPPJYZ vqqlG79VswQqbEUTTubrKfedif1rYOvTO2mAJqBFQB65BjBecXAw7PZzlGk4sC6lI43H h9sg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698323338; x=1698928138; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9IBEv/O80HNkfZFTysz0lNdRsT33RzTkskLkw3trITY=; b=m3yDc0c1KzG+iNhetOV0SCQT5yyACOaiRUvdVX05F+iw3aKE8mT267rJaAART/Nujk zElillbTPRpV1PXDJrIAA/ZnDHduKZcQ/ihYGPMpvtKoQPMvMhbUCMS/062yFc+vhcXO e/WTfidIye5YXBcue4C02ebRiZTcBK/mbv0IAdTYfHZDMmqPItl2CPknfV9d7HQjNeK5 XbV8hlgNXR52dBatVcyM4oPuWtb+1MSG0kHVq/FrCplhKm7vG0PaMJQKKa85mhGDCygu nu2VHVXhT/0jlw5qPRCjPFkPGBN0AvtUucxMmgjG1+bLHU0NSzY9vR7nIbbdaA4lewl0 QyKg== X-Gm-Message-State: AOJu0Yx5ppkQEM/ohR4atRR5eN5sXn8klsiPEM4EJNGIuMMIHfJGXfXW 1pLc4LCBZhYaUPd8n+kIG38JqFAlvxwfEeWperGArg== X-Received: by 2002:aa7:da95:0:b0:540:e46d:1ee8 with SMTP id q21-20020aa7da95000000b00540e46d1ee8mr264669eds.4.1698323337997; Thu, 26 Oct 2023 05:28:57 -0700 (PDT) MIME-Version: 1.0 References: <20231025142609.2869769-1-vamshigajjela@google.com> <7e7eb495-8e54-49f3-bab7-0de72b2cf7b6@kernel.org> In-Reply-To: From: VAMSHI GAJJELA Date: Thu, 26 Oct 2023 17:58:45 +0530 Message-ID: Subject: Re: [PATCH v2 3/3] serial: core: Update uart_poll_timeout() function to return unsigned long To: =?UTF-8?Q?Ilpo_J=C3=A4rvinen?= Cc: Jiri Slaby , Greg Kroah-Hartman , linux-serial , LKML , manugautam@google.com, Subhash Jadavani , Channa Kadabi Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-8.4 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Thu, 26 Oct 2023 05:29:13 -0700 (PDT) On Thu, Oct 26, 2023 at 2:54=E2=80=AFPM Ilpo J=C3=A4rvinen wrote: > > On Thu, 26 Oct 2023, Jiri Slaby wrote: > > > On 25. 10. 23, 16:26, Vamshi Gajjela wrote: > > > From: VAMSHI GAJJELA > > > > > > The function uart_fifo_timeout() returns an unsigned long value, whic= h is > > > the number of jiffies. Therefore, the function uart_poll_timeout() ha= s been > > > modified to use an unsigned long type for timeout values instead of a= n int > > > and to avoid truncation. > > > > Hi, > > > > there is no truncation possible, right? > > That's very likely true (I didn't run the calculations), thus it's correc= t > to not have Fixes tag. It's more about having consistent typing since > we're talking about jiffies, so unsigned long as usual. > > > > The return type of the function uart_poll_timeout() has also been cha= nged > > > from int to unsigned long to be consistent with the type of timeout v= alues. > > Don't write changes you make in the patch in the past tense. Just say: > > Change the return type of uart_poll_timeout() from ... > > The comment also applies to the other sentence above this one. Sure, will update commit message. > > -- > i. > > > > Signed-off-by: VAMSHI GAJJELA > > > --- > > > v2: > > > - unsigned long instead of unsigned int > > > - added () after function name in short log > > > - updated description > > > include/linux/serial_core.h | 4 ++-- > > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > > > diff --git a/include/linux/serial_core.h b/include/linux/serial_core.= h > > > index bb6f073bc159..6916a1d7e477 100644 > > > --- a/include/linux/serial_core.h > > > +++ b/include/linux/serial_core.h > > > @@ -773,9 +773,9 @@ static inline unsigned long uart_fifo_timeout(str= uct > > > uart_port *port) > > > } > > > /* Base timer interval for polling */ > > > -static inline int uart_poll_timeout(struct uart_port *port) > > > +static inline unsigned long uart_poll_timeout(struct uart_port *port= ) > > > { > > > - int timeout =3D uart_fifo_timeout(port); > > > + unsigned long timeout =3D uart_fifo_timeout(port); > > > return timeout > 6 ? (timeout / 2 - 2) : 1; > > > } > > > >