From patchwork Mon Jan 28 17:54:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Corey Minyard X-Patchwork-Id: 156833 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp3722474jaa; Mon, 28 Jan 2019 10:07:35 -0800 (PST) X-Google-Smtp-Source: AHgI3Iav2Jfno50hXK6kN1GakF5fIWREtPYLJOFesATlua2Z4o9Ve/aG6uSn3pN2XGy3y2UNLtp2 X-Received: by 2002:adf:a743:: with SMTP id e3mr215368wrd.56.1548698855897; Mon, 28 Jan 2019 10:07:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548698855; cv=none; d=google.com; s=arc-20160816; b=vBVMFcOH+1119twcg/eZhWY7TBxDf0B/OIGa97Kxlasj2/0HUTi8mLjMGqWvXBQyf+ OC9Qi4cttHbMOxNSVZ8GQd0v5nNHV2hvOsPdUDcc/O+U7+FpwxibOzFmQVuFBdC9F9Yo nqjT2R9lZxv7GNBk4SjXl5FYuFXpWapU+T9IW65c9ud0Fqgz5Zi1twVEY9wUz/O5DcnS 9IDiODHKQaPrWQarSojiw9VVOsNSAofIMUUVNhQYmuVnfyJ/q9OwOIBcXvF1XrgWMg5/ P+RxmkYfG2q9eBdDcEsF+2ChiDyfpzPCJkheHod+6ZxDtkFAx3JEsgWojBvwODZvNmK8 SbYQ== 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=DeXSrCT3B6p8DUPYURe2MDxRH/yvcRPnqNQHR91f/+o=; b=kdNicqgOm1KaZtgONESSWiPGyYeZd0EJHYRNZX2WFmb3iFMaYyMAtHJyNkfGoEodEl RFAnPfhbR51UzjJ89HGEQnmYtpBzaybpsALegRsyMsPEhn8eumfmHzWlLIK9OrdXZCZc q6cu4NrtRHOCFSEKuOzNySI95LAqT2ELlTWD4plM+45YIK0hsKcShixLNvmuMxo1SGTL 5X6E8d9WZ3fbkg0WDww9oQ725xeq2wZQViFyjA9uNtioVuIHFNlQj/V3Ay+dpXjvJfbg JDXRpqQUKF1K0t+U0xQW/BD7f9cZM7I9rfbeYuA7ShH/TksQSWukI5zigIAOq/qpnTcg /TvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=dQcFAWcg; 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 p5si78101757wrt.259.2019.01.28.10.07.34 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 28 Jan 2019 10:07:35 -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=dQcFAWcg; 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]:36288 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1goBJm-0007pe-3A for patch@linaro.org; Mon, 28 Jan 2019 13:07:34 -0500 Received: from eggs.gnu.org ([209.51.188.92]:37045) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1goBEG-0003Db-Hw for qemu-devel@nongnu.org; Mon, 28 Jan 2019 13:01:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1goB7z-0005dh-Qz for qemu-devel@nongnu.org; Mon, 28 Jan 2019 12:55:36 -0500 Received: from mail-it1-x144.google.com ([2607:f8b0:4864:20::144]:38418) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1goB7x-0005YU-Ih for qemu-devel@nongnu.org; Mon, 28 Jan 2019 12:55:22 -0500 Received: by mail-it1-x144.google.com with SMTP id z20so20674377itc.3 for ; Mon, 28 Jan 2019 09:55:19 -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=DeXSrCT3B6p8DUPYURe2MDxRH/yvcRPnqNQHR91f/+o=; b=dQcFAWcg0BjT7ub2/b95TpRcODFMuZq5o4+ehwGSAxjIcmZwwwy1NLuiTtWn/InFgs sD834gChUICu9WED5l6HbLSyGwsu7FEQvBO24O1Dwb7B26oBhhKqPZ1mBJhCmocKZUGB IevcOrpP69cphxGQPKRVIdFMsE+NTRl5txU9eeZc+e6GxhGKq87gNQN1w7uKgEYkA3BZ zBdaqv7L3lBwsOsI3GnLVZw8iGgrXIz+i6H6YnYBFkkNuh075GNszhPboGUvNRWr+TWn W+nGyWYegLmWfSe9B612y0/NP37+BpPw7U55nkhmnRW7EGBfdkQ0LRv4MGEjDysZdvyl N66A== 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=DeXSrCT3B6p8DUPYURe2MDxRH/yvcRPnqNQHR91f/+o=; b=gF3vdIehvPftYv3S18pkIv28D3FshAuG+TVioPl9yhv+gqiCsc/Y4S1Qq5IdDquuND r7CkQV4DEipkrRG+EmF1rnwODcyMxgnQpKAy/Kl/mPTVwZ7NSQHkfj7L+UNHF42kA06y VXmk3m0Jo136RfKl+0IZW2uLE+CxC7fySdCDGW3TwutzAY3h9qbV+hbUYT0ZUDyZoKBR U7k0d98D+qeM33OfqxACMrGL48MfhXuOXDeaEO5KTqXu7lY3C2G2OGv61OTHdJlzLPwk JeC3iWeEqTokcZqGVozojGIGInnAfG9TOxXHL1XNYwrtxPlaOvfjNGhvwh7A4Wyk7FeZ Yakg== X-Gm-Message-State: AJcUukccAih7dUeauPtXzHp6R10tw0GTYK4/FpIe/2hs4Ih+mVkWFmW3 NSBv9kL9Dosf/wqR9kZAWg== X-Received: by 2002:a02:183:: with SMTP id 3mr14160742jak.130.1548698118421; Mon, 28 Jan 2019 09:55:18 -0800 (PST) Received: from serve.minyard.net ([47.184.128.64]) by smtp.gmail.com with ESMTPSA id y76sm49429ita.18.2019.01.28.09.55.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 28 Jan 2019 09:55:16 -0800 (PST) Received: from t430.minyard.net (t430m.minyard.net [192.168.27.3]) by serve.minyard.net (Postfix) with ESMTPA id 09283B93; Mon, 28 Jan 2019 11:55:13 -0600 (CST) Received: by t430.minyard.net (Postfix, from userid 1000) id 16547301161; Mon, 28 Jan 2019 11:55:07 -0600 (CST) From: minyard@acm.org To: qemu-devel@nongnu.org, "Dr . David Alan Gilbert" Date: Mon, 28 Jan 2019 11:54:48 -0600 Message-Id: <20190128175458.27255-10-minyard@acm.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190128175458.27255-1-minyard@acm.org> References: <20190128175458.27255-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::144 Subject: [Qemu-devel] [PATCH v4 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: Peter Maydell , Paolo Bonzini , Corey Minyard , Corey Minyard , "Michael S . Tsirkin" 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 4bc579e69e..62e634c745 100644 --- a/hw/i2c/smbus_eeprom.c +++ b/hw/i2c/smbus_eeprom.c @@ -41,6 +41,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; }