From: David Brownell Subject: Re: [PATCH] spi_mpc83xx: handle odd transfer sizes Date: Wed, 10 Sep 2008 10:28:01 -0700 Message-ID: <200809101028.01997.david-b@pacbell.net> References: <1221041160-19342-1-git-send-email-jacmet@sunsite.dk> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Cc: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org, joakim.tjernlund-SNLAxHN9vbcOP4wsBPIw7w@public.gmane.org To: Peter Korsgaard Return-path: In-Reply-To: <1221041160-19342-1-git-send-email-jacmet-OfajU3CKLf1/SzgSGea1oA@public.gmane.org> Content-Disposition: inline List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: spi-devel-general-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Errors-To: spi-devel-general-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: linux-spi.vger.kernel.org On Wednesday 10 September 2008, Peter Korsgaard wrote: > +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0/* invalid length? */ > +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0if (len & 1) > +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0ret= urn len; Count me puzzled ... "return -EINVAL;" would make sense. You're succeeding here, not failing. But then this routine puzzles me anyway. It always returns len, and then the caller fails with -EMSGSIZE if that return is nonzero. Surely the routine should return zero-or-errno? ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great priz= es Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=3D100&url=3D/