Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp1596571rdb; Wed, 24 Jan 2024 23:38:15 -0800 (PST) X-Google-Smtp-Source: AGHT+IGgPH+H8nDHpRd0VZMZ7kwSBWrK1nosGluKghnbFVc3mz9+i7Zy9JGQERCf5teGLt/8ewDc X-Received: by 2002:a05:6870:f212:b0:214:9c42:96e7 with SMTP id t18-20020a056870f21200b002149c4296e7mr520510oao.101.1706168295316; Wed, 24 Jan 2024 23:38:15 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706168295; cv=pass; d=google.com; s=arc-20160816; b=aNeiiDtwlVhFN6ZSD0vcyedqKxe3GxvC6II1gTQJ9sZYBud1tbhiNASD3Hb/m1+0iT ispesIrdZu1J11i5aInc1+wn+n3pinbBBxkz3YWFqFltd9yaWsc5LGFzkPLVvTnkl/qt fz9o2qml/Z9vF4LweCr6NB7ZwNzaH2WeLT8uJvu7QR2hkavwnG4g+olb9JS5gtdi2I0+ Kv5v3Fyl7tq/Gl8ZqdZ6sYrkK27Wn8ACubIk7dN5ABUCjAYRlANPkKnnCbRpAQfX91/6 j+AC9wwlj8z+D3Vvbhtk8wtd9VxL+JrDwFC6SJtNxSFD5XIdbACO8jqXqpIHtzR0w6ZZ HeUw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=SsS/dsIwAaZFIt52jP71l9pGgb4TQJklZkcjw8mEMJo=; fh=pNZHrWkYsxtWvcHbJaBDliDpk8r/diepJOZwmMlofDU=; b=VwNGgefjBq2LxRtf/4DVJwqRgyeBIecWWW3WmUzdohZQ4by59WgTgrVXYv2YfJyRdW oAXpUpZK6hpTXRjNF9ZPqf/M/nGbs7k+OcJUYk6OhCyERoVDPnJeRqibbCmI1SM7Ano3 r2UXFx8P1xJTxG0DAulJ7i+7EX9X7Xl1UOkNnV018kJ5tDPvQcOkZr1H/uu0d/WiRS/Y I2WTe89q7OmbUKCvUDEpqSpmco0/YCG0zHO+YGnDI9DVbbpVvaJisT6hVyrXvBAMybvi QfVK8W8HXS1tQs+P8fBntlH3ArvYCzMpVk3tFl6aigAyucFnSVuV2WeRz9ZZVUsiGJnx WrSw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=udGMN9yU; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-bluetooth+bounces-1348-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-1348-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id a12-20020a65418c000000b005d4af343858si2695500pgq.361.2024.01.24.23.38.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jan 2024 23:38:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-bluetooth+bounces-1348-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=udGMN9yU; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-bluetooth+bounces-1348-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-1348-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id DFF86B20C11 for ; Thu, 25 Jan 2024 07:37:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A5B9012B9C; Thu, 25 Jan 2024 07:36:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="udGMN9yU" X-Original-To: linux-bluetooth@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EF60F125D7; Thu, 25 Jan 2024 07:36:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706168216; cv=none; b=KgKcDeZ2g1MOvs+PW7AeqovtMR+5aPKn//ASd7OmZ3kVhNcriGB5uRe/juHS45d9BLI0DkhzztD/gA+ejQOEKH+mc6BOLBsJBX+DkhRGuoPaRK5EY5QMT+Q+AGn21H71Br8cNsYoHvacmcn5QlQm05qnA6ZjYnPx05pfetw3BKY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706168216; c=relaxed/simple; bh=Q0JfeFCfMgWrfWnzoium/IVe2Po+3kpp7VAaqloEz1k=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=hxam6yaYXeYmaPPKAU4FJT47p2dUEvtAWhbqDwfTUqemIyn3T0riMnG+BSEZiHjwpovZDjIFZ1slEoMezGtmX0m3T6QTzgrSV97BuOFWtCJqopF5oNOwcq0iYIXgMo7OU+ZtwH615Sr+Mxg526mxqc3saEkWLFH3aWS99qXUREM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=udGMN9yU; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7012AC433F1; Thu, 25 Jan 2024 07:36:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706168215; bh=Q0JfeFCfMgWrfWnzoium/IVe2Po+3kpp7VAaqloEz1k=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=udGMN9yUHMrxmaVOhoVNPCuuuvuWNxMNgTYMLtmrJz/NohKEw40gPBGRhBk/o8z66 SunP1i24pgaoednuaG5F0URxtAEbFYmKrN7DQxL/d6lRtm2lJ73Tthj4pKgcfmHWi3 AdnAQPY1/9hH3bJlR/zHWLCX+L3FVD0dNnpDdW/SYjNEMPpDH90yd7ulOM3KkkpOq6 SE+jiunstsmfRYgX6YIB7AzVU0H9FoJ78OeMZwt21R/vpFuYIhv8uw988w0ER9Y5UK BP7El39bEffgeKuj8WbQKV3dMX8XgshWr87G5PEh+J/T5P1vqAWS8Qp4MJVvujaz2A fuQDuh1Cn24UA== Received: from johan by xi.lan with local (Exim 4.97.1) (envelope-from ) id 1rSuIL-000000005sx-1MRL; Thu, 25 Jan 2024 08:37:05 +0100 Date: Thu, 25 Jan 2024 08:37:05 +0100 From: Johan Hovold To: Francesco Dolcini Cc: Greg Kroah-Hartman , Jiri Slaby , linux-bluetooth@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, greybus-dev@lists.linaro.org, linux-iio@vger.kernel.org, netdev@vger.kernel.org, chrome-platform@lists.linux.dev, platform-driver-x86@vger.kernel.org, linux-serial@vger.kernel.org, linux-sound@vger.kernel.org, Francesco Dolcini , Luiz Augusto von Dentz , Alex Elder , Jonathan Cameron , Lee Jones , Jakub Kicinski , Paolo Abeni , Eric Dumazet , "David S. Miller" , Krzysztof Kozlowski , Hans de Goede , Ilpo =?utf-8?B?SsOkcnZpbmVu?= , Benson Leung , Tzung-Bi Shih , Rob Herring , Jonathan Cameron Subject: Re: [PATCH v2] treewide, serdev: change receive_buf() return type to size_t Message-ID: References: <20240122180551.34429-1-francesco@dolcini.it> Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240122180551.34429-1-francesco@dolcini.it> On Mon, Jan 22, 2024 at 07:05:51PM +0100, Francesco Dolcini wrote: > From: Francesco Dolcini > > receive_buf() is called from ttyport_receive_buf() that expects values > ">= 0" from serdev_controller_receive_buf(), change its return type from > ssize_t to size_t. > > The need for this clean-up was noticed while fixing a warning, see > commit 94d053942544 ("Bluetooth: btnxpuart: fix recv_buf() return value"). > Changing the callback prototype to return an unsigned seems the best way > to document the API and ensure that is properly used. > > GNSS drivers implementation of serdev receive_buf() callback return > directly the return value of gnss_insert_raw(). gnss_insert_raw() > returns a signed int, however this is not an issue since the value > returned is always positive, because of the kfifo_in() implementation. > gnss_insert_raw() could be changed to return also an unsigned, however > this is not implemented here as request by the GNSS maintainer Johan > Hovold. > > Suggested-by: Jiri Slaby > Link: https://lore.kernel.org/all/087be419-ec6b-47ad-851a-5e1e3ea5cfcc@kernel.org/ > Signed-off-by: Francesco Dolcini > Acked-by: Jonathan Cameron #for-iio > --- > v1: > - https://lore.kernel.org/all/20231214170146.641783-1-francesco@dolcini.it/ > v2: > - rebased on 6.8-rc1 > - add acked-by Jonathan > - do not change gnss_insert_raw() > - do not change the code style of the gnss code > - commit message improvements, explain the reasons for doing only minimal > changes on the GNSS part Looks good to me now: Reviewed-by: Johan Hovold