Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754209AbaF3Tg1 (ORCPT ); Mon, 30 Jun 2014 15:36:27 -0400 Received: from mail-qa0-f49.google.com ([209.85.216.49]:58350 "EHLO mail-qa0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752634AbaF3TgZ (ORCPT ); Mon, 30 Jun 2014 15:36:25 -0400 MIME-Version: 1.0 In-Reply-To: <1403898973-19571-3-git-send-email-dianders@chromium.org> References: <1403898973-19571-1-git-send-email-dianders@chromium.org> <1403898973-19571-3-git-send-email-dianders@chromium.org> Date: Mon, 30 Jun 2014 12:36:24 -0700 X-Google-Sender-Auth: froyutiU7OC_EhfV-1ej4Ttj468 Message-ID: Subject: Re: [PATCH 2/3] mfd: cros_ec: Use the proper size when looking at the cros_ec_i2c result From: Simon Glass To: Doug Anderson Cc: Lee Jones , Wolfram Sang , Mark Brown , Vincent Palatin , Bill Richardson , Randall Spangler , =?UTF-8?Q?Andreas_F=C3=A4rber?= , stephan@synkhronix.com, Olof Johansson , Samuel Ortiz , lk Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 27 June 2014 12:56, Doug Anderson wrote: > We know how many bytes the EC should be sending us (which is also the > number of bytes transferred) and also how many bytes the EC actually > wanted to send to us. When computing the checksum and copying back > data let's make sure we take the lesser of the two of those. We'll > also complain if the EC tried to send us too many bytes. The EC > sending us too few bytes is legit for when we send the EC an invalid > command. > > This is based on similar code in cros_ec_spi. > > Signed-off-by: Doug Anderson Reviewed-by: Simon Glass -- 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/