Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757254AbbLAXNS (ORCPT ); Tue, 1 Dec 2015 18:13:18 -0500 Received: from mezzanine.sirena.org.uk ([106.187.55.193]:56875 "EHLO mezzanine.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932144AbbLAXNN (ORCPT ); Tue, 1 Dec 2015 18:13:13 -0500 Date: Tue, 1 Dec 2015 23:12:33 +0000 From: Mark Brown To: Michal Suchanek Cc: Heiner Kallweit , David Woodhouse , Brian Norris , Han Xu , Boris Brezillon , Javier Martinez Canillas , Stephen Warren , "Andrew F. Davis" , Marek Vasut , =?utf-8?B?UmFmYcWCIE1pxYJlY2tp?= , Mika Westerberg , Gabor Juhos , Bean Huo =?utf-8?B?6ZyN5paM5paM?= , Furquan Shaikh , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, linux-spi@vger.kernel.org Message-ID: <20151201231233.GA1929@sirena.org.uk> References: <8c34c7790244489c2ce0072c72bd9bc7c4cdb965.1448988089.git.hramrach@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="2GxxjMFQpcQtANqJ" Content-Disposition: inline In-Reply-To: <8c34c7790244489c2ce0072c72bd9bc7c4cdb965.1448988089.git.hramrach@gmail.com> X-Cookie: A beer delayed is a beer denied. User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: 94.175.94.161 X-SA-Exim-Mail-From: broonie@sirena.org.uk Subject: Re: [PATCH v5 08/10] spi: expose master transfer size limitation. X-SA-Exim-Version: 4.2.1 (built Mon, 26 Dec 2011 16:24:06 +0000) X-SA-Exim-Scanned: Yes (on mezzanine.sirena.org.uk) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1441 Lines: 42 --2GxxjMFQpcQtANqJ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, Dec 01, 2015 at 04:51:06PM -0000, Michal Suchanek wrote: > +static inline size_t > +spi_max_transfer_size(struct spi_device *spi) > +{ > + struct spi_master *master = spi->master; > + if (!master->max_transfer_size) > + return 0; > + return master->max_transfer_size(spi); > +} Can we change this to return SIZE_MAX instead (ie, the maximum value for a size_t)? That way callers don't need to worry if there is a limit, if they want to handle it they can just unconditionally assume that a limit will be provided. --2GxxjMFQpcQtANqJ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJWXilhAAoJECTWi3JdVIfQK9UH/jE+6AVpFzPt0VbOKZrcz2Vg v7RRHUgejDpmu1oX/BYWkKtP8s+8148lOXNTH8kXoGEbXbNpFCe9iAv7Y/7YXQx8 fbXnMj+pdJcJGOddZbWbrAkybuJ27gN0zubQP+i3QhP3YOw8qbZHtgJMl2qpmX1/ aWy26urStV//8UnvzPUERIIvf1G77zJuSDuo164tqcgipuw6Y+uBu66ppYHivIxX RXefE+RIFL3YEJiEdVzVC7DLl0XWjN+Ao6HDGbyUDCn/2PiW9lQuOpUToUxaMMQG qBMroy5ZZW2md92GniJz1vfzPdUdQB+XZbIqu2TpeLeWv7OlnhlemwfolwHHxLQ= =O0zK -----END PGP SIGNATURE----- --2GxxjMFQpcQtANqJ-- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/