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: 10784261 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 BD0F66C2 for ; Mon, 28 Jan 2019 18:08:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ABE602B970 for ; Mon, 28 Jan 2019 18:08:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9EA8F2B9CB; Mon, 28 Jan 2019 18:08:43 +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 DFB982B970 for ; Mon, 28 Jan 2019 18:08:37 +0000 (UTC) Received: from localhost ([127.0.0.1]:36300 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1goBKl-0000V4-ON for patchwork-qemu-devel@patchwork.kernel.org; Mon, 28 Jan 2019 13:08:35 -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-Google-Smtp-Source: ALg8bN7UU8ZdpLPj4RkRaNTXrVIY816U2gB1tjrQ58JXati8u7d63pjHlaFDgHgtZ6ZDY/i37h0R2w== 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+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 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; }