From 5c988a910c5c32462da462263ea7cb63daecebbc Mon Sep 17 00:00:00 2001 From: Antonio Ospite Date: Wed, 14 Nov 2012 12:31:01 +0100 Subject: [PATCH] am7xxx: don't mention AM7XXX_DIRECTION_OUT in read_header() The validity check in read_header() looks for: h->direction == AM7XXX_DIRECTION_IN When this is false (direction is _not_equal_ to AM7XXX_DIRECTION_IN) it cannot be said for sure that the direction field value is going to really be AM7XXX_DIRECTION_OUT, technically the device may have put anything there. So, just report what happens don't try to overguess. --- src/am7xxx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/am7xxx.c b/src/am7xxx.c index c039147..47f79ea 100644 --- a/src/am7xxx.c +++ b/src/am7xxx.c @@ -390,7 +390,8 @@ static int read_header(am7xxx_device *dev, struct am7xxx_header *h) ret = 0; } else { error(dev->ctx, - "Received a packet with direction AM7XXX_DIRECTION_OUT, weird!\n"); + "Expected an AM7XXX_DIRECTION_IN packet, got one with direction = %d. Weird!\n", + h->direction); ret = -EINVAL; } -- 2.1.4