From patchwork Thu Feb 28 18:17:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Corey Minyard X-Patchwork-Id: 10833607 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C773A180E for ; Thu, 28 Feb 2019 18:35:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B36832F747 for ; Thu, 28 Feb 2019 18:35:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A7D5C2F74C; Thu, 28 Feb 2019 18:35:39 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 46AA42F747 for ; Thu, 28 Feb 2019 18:35:39 +0000 (UTC) Received: from localhost ([127.0.0.1]:44761 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gzQWw-0005LU-KQ for patchwork-qemu-devel@patchwork.kernel.org; Thu, 28 Feb 2019 13:35:38 -0500 Received: from eggs.gnu.org ([209.51.188.92]:46765) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gzQFo-0000aD-1a for qemu-devel@nongnu.org; Thu, 28 Feb 2019 13:18:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gzQFc-0002MR-TB for qemu-devel@nongnu.org; Thu, 28 Feb 2019 13:17:56 -0500 Received: from mail-ot1-x32b.google.com ([2607:f8b0:4864:20::32b]:43698) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gzQFY-0002Bg-Bx for qemu-devel@nongnu.org; Thu, 28 Feb 2019 13:17:42 -0500 Received: by mail-ot1-x32b.google.com with SMTP id n71so18528058ota.10 for ; Thu, 28 Feb 2019 10:17:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=oH9xhrkt9kjzk6DixNaMkUYIa8qMXBRPQYhjGJFyUxM=; b=Ts2LUfmhrSid+GZYaTq1WV3kb1GLnXiF/0xoia3YEsipUYBmaPpxNN0LxYsAqcBxLC JNwwLlNVJ3m+G6ZgkiUGf6nvSi6bDc4T7BM+Kyri/O236CA16nZ2x3YlvLi2Qltd/97A YPJqeo10gTJcRZv1bCLI0QwbHft+ONCelA8+tln/MskR/2J9xGiDdYjNJvn22htTElUf qvlDMRxDpFYevlXEB1yOJmRqQbf+W9gKPSJ+15tMMcd7tzoGLZU44y7lrGlnjoV7uM96 guM5gvhoy1/rq4+Q62sToCP/CRIL23RZTtcm84uJVmGi6hnkOzfd4TdxJ5T33p/AwgxA NY1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=oH9xhrkt9kjzk6DixNaMkUYIa8qMXBRPQYhjGJFyUxM=; b=VBrhPmTL3WWhHYSsLmiLWLoOqlyTywMnTcKbBUn8l1I+4ClY8iGXSOXEdGBBoMtf9Z 0iosldcosMl6nS4nQYh0PeGp/nISTWImi34Ec4GWhaga7bY0y8of/91yk8tqftL/Ezn5 lCUp8fHaNqar8Cxnpo+6p3S5aiUGSrbiDDY9gh13MdyS+U5Wbw724HLsXihqWDhLCPAf Klfx9LkYAoWhPnAgTZzG0OPLff/Q7s8QkR1P1QubvvS5PQtLvSLKBKkny0rVnw9xTSBT UV9+Gw5o6ESNpbx+RKHd4+AZDhpBk80MZaomaIPxl4zjJ12ECbAy6glaX65bc2Bf+DQK ym1Q== X-Gm-Message-State: APjAAAWCxZaqrLdoVs0g6m6zpjkGOmPnAPJG7IDgjZQL1QSLAn2Imtln /rlWcPqWV78wXFQh5gA57Q== X-Google-Smtp-Source: APXvYqydsqqM1jHC6ogYxbcicRPwpAipycFXRfM+cScAwQjS5lQtFeQ/7WjlyvWpMuOo73bIduKnBg== X-Received: by 2002:a9d:74c1:: with SMTP id a1mr659954otl.107.1551377843266; Thu, 28 Feb 2019 10:17:23 -0800 (PST) Received: from serve.minyard.net ([47.184.128.64]) by smtp.gmail.com with ESMTPSA id u5sm7978349otb.62.2019.02.28.10.17.16 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 28 Feb 2019 10:17:17 -0800 (PST) Received: from t430.minyard.net (t430m.minyard.net [192.168.27.3]) by serve.minyard.net (Postfix) with ESMTPA id 1CFBE1808F9; Thu, 28 Feb 2019 18:17:14 +0000 (UTC) Received: by t430.minyard.net (Postfix, from userid 1000) id 00A6D3028CF; Thu, 28 Feb 2019 12:17:13 -0600 (CST) From: minyard@acm.org To: Peter Maydell Date: Thu, 28 Feb 2019 12:17:00 -0600 Message-Id: <20190228181710.2477-10-minyard@acm.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190228181710.2477-1-minyard@acm.org> References: <20190228181710.2477-1-minyard@acm.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::32b Subject: [Qemu-devel] [PULL 09/19] i2c:smbus: Make white space in switch statements consistent X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Corey Minyard , QEMU Developers , minyard@acm.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Corey Minyard It had spaces between cases in some places and not others. Add a space for every one. Signed-off-by: Corey Minyard --- hw/i2c/smbus_eeprom.c | 1 + hw/i2c/smbus_slave.c | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/hw/i2c/smbus_eeprom.c b/hw/i2c/smbus_eeprom.c index 2f90287b69..2816e35bcc 100644 --- a/hw/i2c/smbus_eeprom.c +++ b/hw/i2c/smbus_eeprom.c @@ -43,6 +43,7 @@ static uint8_t eeprom_receive_byte(SMBusDevice *dev) SMBusEEPROMDevice *eeprom = (SMBusEEPROMDevice *) dev; uint8_t *data = eeprom->data; uint8_t val = data[eeprom->offset++]; + #ifdef DEBUG printf("eeprom_receive_byte: addr=0x%02x val=0x%02x\n", dev->i2c.address, val); diff --git a/hw/i2c/smbus_slave.c b/hw/i2c/smbus_slave.c index 52a57423ee..5b3046f6a3 100644 --- a/hw/i2c/smbus_slave.c +++ b/hw/i2c/smbus_slave.c @@ -70,6 +70,7 @@ static int smbus_i2c_event(I2CSlave *s, enum i2c_event event) DPRINTF("Incoming data\n"); dev->mode = SMBUS_WRITE_DATA; break; + default: BADF("Unexpected send start condition in state %d\n", dev->mode); dev->mode = SMBUS_CONFUSED; @@ -83,6 +84,7 @@ static int smbus_i2c_event(I2CSlave *s, enum i2c_event event) DPRINTF("Read mode\n"); dev->mode = SMBUS_READ_DATA; break; + case SMBUS_WRITE_DATA: if (dev->data_len == 0) { BADF("Read after write with no data\n"); @@ -93,6 +95,7 @@ static int smbus_i2c_event(I2CSlave *s, enum i2c_event event) dev->mode = SMBUS_READ_DATA; } break; + default: BADF("Unexpected recv start condition in state %d\n", dev->mode); dev->mode = SMBUS_CONFUSED; @@ -129,9 +132,11 @@ static int smbus_i2c_event(I2CSlave *s, enum i2c_event event) case SMBUS_DONE: /* Nothing to do. */ break; + case SMBUS_READ_DATA: dev->mode = SMBUS_DONE; break; + default: BADF("Unexpected NACK in state %d\n", dev->mode); dev->mode = SMBUS_CONFUSED; @@ -155,11 +160,13 @@ static uint8_t smbus_i2c_recv(I2CSlave *s) } DPRINTF("Read data %02x\n", ret); break; + default: BADF("Unexpected read in state %d\n", dev->mode); dev->mode = SMBUS_CONFUSED; break; } + return ret; } @@ -176,10 +183,12 @@ static int smbus_i2c_send(I2CSlave *s, uint8_t data) dev->data_buf[dev->data_len++] = data; } break; + default: BADF("Unexpected write in state %d\n", dev->mode); break; } + return 0; }