Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp6797410rdb; Fri, 15 Dec 2023 08:32:58 -0800 (PST) X-Google-Smtp-Source: AGHT+IHDokLccDltf/RutXH1pkxQGVTyXWQIBhrIb/+21xVTiXHjugyZ37a+5EUNOyk5B4mE5m6S X-Received: by 2002:a17:902:f550:b0:1d3:6c37:23b1 with SMTP id h16-20020a170902f55000b001d36c3723b1mr2216537plf.75.1702657978489; Fri, 15 Dec 2023 08:32:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702657978; cv=none; d=google.com; s=arc-20160816; b=Lwm2kG5tJFfhJjfulQYb/+2My4nIk6O0BqasTiGOafYYjEYkD1bavf1BvzDK/GjSDg oW/eFHQ7Yz3FUNmcIUVvi7s+1armeJ4O78Wy3ZWQt1QUccllkNpyWeLaJCXwhKf4TgnL K63Q5T6wwZONG7dAn2ER66r6KoXjpqTP6mQkZvfqDEdyKGg98o5dqSCLOz2QzHQ9o2WZ Mg45th9jmDqxG9FUn0e+uEsiFuIF4iHHcmMju5QYNrOm2iMFlei3y/cD9s2TcW2bXx/4 iayGMMB6fYP64H1qKODdxU43l4sPKq7GkxC7NE/hXB3Kd25OeusiGW8W+N96+/G7J+7/ MXwA== ARC-Message-Signature: i=1; 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=z8TRshG8UwggIbNm6dhAJ2F/S2TwLsw2ZFfTLMLVJoM=; fh=kvdcJCTwf1vcydG1m274qd2tDYYlziXHNGrfAX061SE=; b=bN5FXBF+z4UsijpY2KCDwIUpIlP7M8wDOicIphl/He3oLon2ycsLojBA5lGaA5EZzF k2eImzcK398J+x5Zzprf5n1vEKuz412Cq0hB+XhkvXgjcomSRhs8UrTeNqKQ5T9jNu6V ZYQf3/QIO7RzzQNqY5lsh1AZfSwZwQufELI2j9ja4PX7h+poSVMQJr/XUHR65TOIyaG4 n5qE/KA4YQx/EzHIE5KruNj8UvSEhaGohOkYCs1w7tzPspty67EvDmWVbWEdCtRG7bXA G4KhRTn+63u/kei7qHKeDv8/LhUBPQ3K8gTRV/TiIcROKAKPB/gRyvCh88y5wNymbS1t hk3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=u23Widco; spf=pass (google.com: domain of linux-kernel+bounces-1302-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-1302-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 l12-20020a170903244c00b001cfec9dcd7fsi13698191pls.408.2023.12.15.08.32.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Dec 2023 08:32:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-1302-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=u23Widco; spf=pass (google.com: domain of linux-kernel+bounces-1302-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-1302-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 AC34CB21200 for ; Fri, 15 Dec 2023 16:32:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7E2DA3DBAE; Fri, 15 Dec 2023 16:32:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="u23Widco" X-Original-To: linux-kernel@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 8A67E3FE2C; Fri, 15 Dec 2023 16:32:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id ECD69C433C8; Fri, 15 Dec 2023 16:32:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1702657953; bh=5xSZ6gC57XpMcrBYmJ5djtgBGtNosockr7ypfWQ/UoA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=u23WidcobeXI8hJTBO02gH39xAVyMZg3S/gk8R3+oMsy1a46PrrJRqER62yDtrdtf 1sP9G3jW6bt0TkUH+FVWaUXb2WUMuoifq5UkKLSL9Vihbw/4tLEgQtVy3f2vCcs/Dv wXTrDDgayoevbU8NQT5CXG0gCcWFBHIOSHMEoJhbkn1WLbj/H/Eu2Fuq4FA4d679tr 0edO8rQox64QgmVeY5DX9u/1v/sBmf4kwA7Zaxt4jUW2eY9C5xbVFoGtvPd+mKK3Eo sfxBmvoKrJU1x51n4fbHg8VooER+eL425YDkyzu8lDJ1d7HJ/0OT8IaPHRNo28jX8y dWVhTFyyt4wKA== Received: from johan by xi.lan with local (Exim 4.96.2) (envelope-from ) id 1rEB6x-0000ZV-31; Fri, 15 Dec 2023 17:32:28 +0100 Date: Fri, 15 Dec 2023 17:32:27 +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 Subject: Re: [PATCH v1] treewide, serdev: change receive_buf() return type to size_t Message-ID: References: <20231214170146.641783-1-francesco@dolcini.it> Precedence: bulk X-Mailing-List: linux-kernel@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: On Fri, Dec 15, 2023 at 02:59:35PM +0100, Francesco Dolcini wrote: > On Fri, Dec 15, 2023 at 02:51:09PM +0100, Johan Hovold wrote: > > On Thu, Dec 14, 2023 at 06:01:46PM +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. > > > drivers/bluetooth/btmtkuart.c | 4 ++-- > > > drivers/bluetooth/btnxpuart.c | 4 ++-- > > > -static ssize_t btnxpuart_receive_buf(struct serdev_device *serdev, > > > - const u8 *data, size_t count) > > > +static size_t btnxpuart_receive_buf(struct serdev_device *serdev, > > > + const u8 *data, size_t count) > > > { > > > struct btnxpuart_dev *nxpdev = serdev_device_get_drvdata(serdev); > > > > A quick check of just the first two functions here shows that they can > > return negative values. > > This is already fixed. Patches are in next. > > There were 3 buggy user of this API. > - 1 patch was merged a few days ago in mainline > - 2 patches are in next, the maintainer decided to wait for the next merge window > > commit 687d2de93b11 ("Bluetooth: btmtkuart: fix recv_buf() return value") > commit 7954bbcdd7ea ("Bluetooth: btnxpuart: fix recv_buf() return value") > commit c8820c92caf0 ("platform/surface: aggregator: fix recv_buf() return value") Then why was that not mentioned in the patch (e.g. below the --- line)? You are certainly not making it easy for reviewers, but good to see that you thought about this, and I see now when reviewing the mail archives that those bugs were the reason for this patch in the first place. Johan