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: 159430 Delivered-To: patch@linaro.org Received: by 2002:ac9:18c7:0:0:0:0:0 with SMTP id i7csp990250oce; Thu, 28 Feb 2019 10:34:57 -0800 (PST) X-Google-Smtp-Source: APXvYqx/XV3D21iFFzmSimOZ6/S8NNExlWkj7hKNYMNdfckTCM9Pt469geAmg9y3gWW1WrF1RsxD X-Received: by 2002:a81:12d6:: with SMTP id 205mr331321yws.338.1551378897216; Thu, 28 Feb 2019 10:34:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551378897; cv=none; d=google.com; s=arc-20160816; b=exmZWbtY2CsYKQUsNjAiBNNb8UbqH71cXfvlS3WVxNpSiKg+W7OyyXcnWGnCwYDVsF cJsvCs87i26VqKTUZ27EFmw2nqjal+cbZ/8uvAtYhKniJPxGYVXo07guKENX1TtChz4O X4pZinABi8sPHZwllgoyV2rNztbGZiKPTi5OsB+0QPtvvu/dkfFpkf5VmgQej+FUJ+0N lO5O3SqjnBJTmvwzT9yrfM3Lt+O+ep+DFLOhibYbIiTzua9NmIZhjTPRgUJ31T2hgyAj 0GJ3nPKUswSzO63SKZ/wfzUiFsJX+erMVrc2OE4NDvRiHtsQkWxE/7FXYdI5IanomZFN 4QlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=oH9xhrkt9kjzk6DixNaMkUYIa8qMXBRPQYhjGJFyUxM=; b=mqkhX4LsG1XnGV+7YFu1MVkDusEvewKlIg+C2uZa1ZJngMtpYt+H6AYz5xF1Zd+DdS Ei5kHo2Xl0HpuLBFurRAbJZ7VU3g7DKup3zWTh9v0Y46p1+1yX+c3Xxy7nPZPHRf/bea F3GgGAWVIoDboQtDcgRzJdTYwwt8Bz1mWum/EmRWizqXW+uFVu3SU/+NiliQNjgNjnvJ pqxBIHKL5xWzEA2GFUObiGElvrr+HmU+C2XEk6eRu68B522pZfTi3kIHLYygbFNJ/LIo v/qIVrRy8QIY4qLjhsuxd2Wq36VddPMU/m4VvQ5q9g1209RujsbHHgVDRzk/26xLItH4 wihA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=Ts2LUfmh; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id y67si10670577ywa.409.2019.02.28.10.34.57 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 28 Feb 2019 10:34:57 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=Ts2LUfmh; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Received: from localhost ([127.0.0.1]:44723 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gzQWG-0004gw-Pa for patch@linaro.org; Thu, 28 Feb 2019 13:34:56 -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-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+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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(+) -- 2.17.1 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; }