Message ID | 20231030073542.251281-2-vamshigajjela@google.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:d641:0:b0:403:3b70:6f57 with SMTP id cy1csp2038475vqb; Mon, 30 Oct 2023 00:36:30 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF8ynPjsAakjQVPlKOlf2c7WUT+W/WJN/YMeF2i5yo1ggBSqEbm4aaDvz9cReU2g/Leh1/Y X-Received: by 2002:a17:902:cac4:b0:1bb:598a:14e5 with SMTP id y4-20020a170902cac400b001bb598a14e5mr8172348pld.43.1698651389864; Mon, 30 Oct 2023 00:36:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698651389; cv=none; d=google.com; s=arc-20160816; b=qpScgs0b2wc7OELvfLLKg1WLZDcbJIiVIjKWBc1i4eIqzz7eyXo7PL98SLsEpmbcIt tVhra2cJGFdgaMbnxu8GLMQxIj92sGSKeyJwMVX/374EBPv6tlwgCoAG00gmLnVeY1Nf ZS5eqe5qzxG9EGWCAmSyU0Hw3ekf5k4GPUZV1JTd6IdzCWOEsBB3Fi4zyXT8LOT1PGVe M1vNySUIFPWIf133mJOoYNo8hulhZd96uEd8+9nX9huPHgG4ZclKB0fH/oFzik1Z+75q lFo1MkYgWh7hfqU36H6ZV/w2ZmL+aeGJZS/k9tUca+CajUAjha/Q8+S57vcfiLrHONQT mM1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:dkim-signature; bh=+7qdvEqH9UQsG0XvkLdIs7iHiJPjbaVFxlERbYdwdFA=; fh=Ws+G2RLMFRfpE0Jj9T2OymJKcfnhuU2My4BZfo0fXLE=; b=Z01f56MUGCWWE8p8qtjiWKqJkq+IwHCQ0So2Jq8WnCY5YoLCW6X+ZDQixHc2ri9xbP e1dDDGWQkTAn640DXr3d0xc6jSbLdU6Qu+Bz1Uu4qn0w2qPktGTL0rziZon46KuhsBtr 8OEcq+9IFGxeVWygTRcSkxvB4O6SPvO1fFzQLhHAlk2uTPNngnGQWc+wDzfN2E9a8HwL ToQlX2nyhD4tUhV77u8BxWGQb+9TOGWsOOZkx7+9PoNpzhJ0Un/GcGgJrNKIR4oU3An/ YV48haZr9oBVoGVTHaf6wqk85qa3MSP4SpPU3th1MMJrAMOl4ho3xiqkxWWDZCpVM/8V 9r8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=yGlGjCtz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id cp10-20020a170902e78a00b001bdafae4b7dsi4587022plb.43.2023.10.30.00.36.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Oct 2023 00:36:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=yGlGjCtz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (Postfix) with ESMTP id E26E380A4415; Mon, 30 Oct 2023 00:36:19 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232125AbjJ3HgD (ORCPT <rfc822;chrisjones.unixmen@gmail.com> + 32 others); Mon, 30 Oct 2023 03:36:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48742 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231752AbjJ3Hf5 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 30 Oct 2023 03:35:57 -0400 Received: from mail-yw1-x114a.google.com (mail-yw1-x114a.google.com [IPv6:2607:f8b0:4864:20::114a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6DDB1BD for <linux-kernel@vger.kernel.org>; Mon, 30 Oct 2023 00:35:55 -0700 (PDT) Received: by mail-yw1-x114a.google.com with SMTP id 00721157ae682-5afa77f9a33so28138037b3.0 for <linux-kernel@vger.kernel.org>; Mon, 30 Oct 2023 00:35:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1698651354; x=1699256154; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=+7qdvEqH9UQsG0XvkLdIs7iHiJPjbaVFxlERbYdwdFA=; b=yGlGjCtzcTwGQw5JyaI6KGo0AWun2Q8LefN3Yl1A7nL/t1Bcpf20YlYdVF/NntJL7r JgCDQxAI6daFerTQlw1rjltEjj+xiM5kCWHHqlgqshfXtW7lzCu5we95ByeML6rEGdLM qLgguYIuAhBEg/1ANr1a8zcmrB4BGe1h6uRo9BGvPc2lFBrTOGLUT6R6LMVPon4bp3yU 6ZnLKVWXG+xhKZrzoCKKPC46l6WM7RovGNhCfTGe+JzIjDg4JfFi02goqLlBC2SnvoQy zy0oD/QsWX2ReMOtGiejPqRiLHba+o+XsUOK3QCb1Xk3F2q8wsiK7ya/cj5ZbxR9X1Ze cKxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698651354; x=1699256154; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=+7qdvEqH9UQsG0XvkLdIs7iHiJPjbaVFxlERbYdwdFA=; b=qIGz8TGeeOBpZh0oWtXSgUnIaEJcRcmmSvwB3mZn7tGz85seHDRalVanQni2EoJ+MK bDdJjgr97sU/JAX9vEUo4LjIgQ3TFdhErNQXkXvjT4SK/hJO7wEXNdIqDvl1lptaeniD EyvMBMEP89OVrVKaqOvLoENTmWP/JG9U4XmP2ify99x5O8SwyVJ/r8uIY8B0AwwY4iqI sYTjgSSdW+EzhPwlLWcqv9q+MF1Iu7dlq+Z4dLZm/6YCHGbjSmvqUy4DI3Yk7A2hXjGA 1JZ8FfzoUZv4PxEonj3cJfAMr12ekP72jYNLp1wsO5CVs1nRA1t7CsMC7sVg55hTS4N0 v4jw== X-Gm-Message-State: AOJu0YxeMkB86smQfLPoPVtefs8xQnQvV0b02mEegppCvCUYX3/PhfOY cYcBhO8cCO81vqhSrSgRVpvTNz11WvRdaStXNvb3 X-Received: from vamshig51.c.googlers.com ([fda3:e722:ac3:cc00:3:22c1:c0a8:70c]) (user=vamshigajjela job=sendgmr) by 2002:a81:6cc5:0:b0:5a7:ad67:b4b6 with SMTP id h188-20020a816cc5000000b005a7ad67b4b6mr174772ywc.2.1698651354698; Mon, 30 Oct 2023 00:35:54 -0700 (PDT) Date: Mon, 30 Oct 2023 13:05:41 +0530 In-Reply-To: <20231030073542.251281-1-vamshigajjela@google.com> Mime-Version: 1.0 References: <20231030073542.251281-1-vamshigajjela@google.com> X-Mailer: git-send-email 2.42.0.820.g83a721a137-goog Message-ID: <20231030073542.251281-2-vamshigajjela@google.com> Subject: [PATCH v5 1/2] serial: core: Update uart_poll_timeout() function to return unsigned long From: Vamshi Gajjela <vamshigajjela@google.com> To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Jiri Slaby <jirislaby@kernel.org>, ilpo.jarvinen@linux.intel.com Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, manugautam@google.com, Subhash Jadavani <sjadavani@google.com>, Channa Kadabi <kadabi@google.com>, Vamshi Gajjela <vamshigajjela@google.com> Content-Type: text/plain; charset="UTF-8" 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 agentk.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Mon, 30 Oct 2023 00:36:19 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781165079437693474 X-GMAIL-MSGID: 1781165079437693474 |
Series |
serial core type consistency and clean up
|
|
Commit Message
Vamshi Gajjela
Oct. 30, 2023, 7:35 a.m. UTC
The function uart_fifo_timeout() returns an unsigned long value, which
is the number of jiffies. Therefore, change the variable timeout in the
function uart_poll_timeout() from int to unsigned long.
Change the return type of the function uart_poll_timeout() from int to
unsigned long to be consistent with the type of timeout values.
Signed-off-by: Vamshi Gajjela <vamshigajjela@google.com>
---
v5:
- no change. Consistent version for series
v4:
- author name in capitals to lowercase
v3:
- updated description
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(-)
Comments
On Mon, 30 Oct 2023, Vamshi Gajjela wrote: > The function uart_fifo_timeout() returns an unsigned long value, which > is the number of jiffies. Therefore, change the variable timeout in the > function uart_poll_timeout() from int to unsigned long. > Change the return type of the function uart_poll_timeout() from int to > unsigned long to be consistent with the type of timeout values. > > Signed-off-by: Vamshi Gajjela <vamshigajjela@google.com> > --- > v5: > - no change. Consistent version for series > v4: > - author name in capitals to lowercase > v3: > - updated description > 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(struct 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 = uart_fifo_timeout(port); > + unsigned long timeout = uart_fifo_timeout(port); > > return timeout > 6 ? (timeout / 2 - 2) : 1; > } > Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
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(struct 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 = uart_fifo_timeout(port); + unsigned long timeout = uart_fifo_timeout(port); return timeout > 6 ? (timeout / 2 - 2) : 1; }