From patchwork Wed Feb 20 13:59:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Corey Minyard X-Patchwork-Id: 158828 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp5078425jaa; Wed, 20 Feb 2019 07:50:51 -0800 (PST) X-Google-Smtp-Source: AHgI3IaSs+FSE528NqHYM4lRhXiZk9N2F8Hs+jHHJt+zs6CFBtY4B/wklF4ccBPTapNAhdtWxfaF X-Received: by 2002:a81:9a0e:: with SMTP id r14mr27704421ywg.423.1550677851511; Wed, 20 Feb 2019 07:50:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550677851; cv=none; d=google.com; s=arc-20160816; b=lBEbO9CIaSzwfGdsfKgk3VKLCIoSFxeCRRltQp/tud2bCpST3N0yreQmJhKJQz9QXD 55SOSCGz6AEAJAhKif4mdBnqxWFOqRDEZ8Vbe7m8wMzG5yOmXtiFvc2oegt1TcDa+G5n MFPZQmNbfP10+AYKlSCHvKw5gzE1UsC0eRwBCyfEvnb5D69gueJ1DAMd+dKmDzV7F/ja fuLnrKvVEKmxTtFboUO4uQRi8ScCHvKe5ivfHo4OyQDv0aSCrYjWJ5iG9S+kUVjG+7Yk wTKTWGZaFeER8aRD83pgoW7tYc8PF7pMmBlT8MbhNlteIz+D3so9/4e2JapzbUqAx9bK ibGg== 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=bGHEUDtovpwcT3PZlFG/fI8E/5QZOAGTkf+Z+c7pcQF5JMWmM2PS+D/S1ry8Rz+DSb j/mpJ4FlgdT+v/uoVaA/WpqNM2SRrjFIqCcU7CyqU10WxQC+cqEgt+GGMkpMTsjUMMOY 0HIxKLkLGpAmO7mV/ZWi2apRjT8PFu6yL0wsEmjLeoeXbKebe6OHfEDg2FdtejJWlHlM GcGhA+hDd+oTkEXZ5GpUog41xP8iPZPgA6Bx8bf9cpVzHm4ltQAtM6oFzH6/DCSKgevY b6iuMmwv4c9QUbXenGFPxPBW/SeqpnLlwhBaKzU0ATGH+ffUPfwL4NsXbotqVDelwoYr BbdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b="p+xozL8/"; 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 z5si11448902ybc.157.2019.02.20.07.50.51 for (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 20 Feb 2019 07:50:51 -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="p+xozL8/"; 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]:41250 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gwU94-0003gd-Sy for patch@linaro.org; Wed, 20 Feb 2019 10:50:51 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44850) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gwTo6-0003gZ-Mu for qemu-devel@nongnu.org; Wed, 20 Feb 2019 10:29:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gwTo5-00014Z-Lw for qemu-devel@nongnu.org; Wed, 20 Feb 2019 10:29:10 -0500 Received: from mail-ot1-x343.google.com ([2607:f8b0:4864:20::343]:34620) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gwTo5-00010D-Eg for qemu-devel@nongnu.org; Wed, 20 Feb 2019 10:29:09 -0500 Received: by mail-ot1-x343.google.com with SMTP id 98so40874770oty.1 for ; Wed, 20 Feb 2019 07:28:56 -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=p+xozL8//L/89RyMeYFEmACOEpVcnjd4a/sVnV4473LKUhekwnDhKzkfDrjvG7Nnk2 aFCBhgAubqxi+8ZlZBMF4iS8MFhBUWxV1D27oa3jIWG1SiWeddLdGVgENmsHATh+pBqw XpZvaO6l9+OUZf/o43C5doZ9iRrTsLJA1MFGW9nUMIOq/dMFbQd1MhZZxwho+dH9f37S 8+11Mm+jxbqSeMLRao7Uyj7bweCSQ+iILA1wDYUf7AQAb4tStGs92FhIUzG1Ro38xXp/ 4MhYo2WR1IeyOz41zCfSg8bkU6jULLi3dlxvsP8iVeYJfm9Xiq5wFo9YUoPYmZmg9bO/ ScMQ== 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=H4TKamFSY1+UF09BUCtWUR4hpLo1ZNwpuV7Lc5kOaiZvoMReNzTfh/oMRb1iKft4k4 t+G43tFDT3lLBymjRdgC2DgWi9H7rsdniI81cKnt5urHBu5Bhi6jxS7hyjNslw7eqjCG SVzePwOV0365jmzp5zWS0+92QCha6wBh6mVYjRiWuOBHmASx4VgViuDnVBPVBbBRVWYU p6N8BxzbCRpz7Z96nKtYjvY33UYRnbdRODDrF9OabyQJDF+bFTNhwmiOOyu3dxnqqF7A 1YkUqSHOOOX2mXkSoqJCX11R8yVkR8rXXyHSRcjElUF+gQ1lhFaEkgg6B0Wj3K6ZUmez wWQA== X-Gm-Message-State: AHQUAuYZHsQPPCgX2cowkpPDGe2Ght1/AeGrhtTSD1/+DMEyuEA7hpmD RwaevyBsWnfaYC3T22Cl8StYJE8pGw== X-Received: by 2002:a9d:27a5:: with SMTP id c34mr21734405otb.30.1550671214026; Wed, 20 Feb 2019 06:00:14 -0800 (PST) Received: from serve.minyard.net ([47.184.128.64]) by smtp.gmail.com with ESMTPSA id u24sm9460427otj.44.2019.02.20.06.00.11 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 20 Feb 2019 06:00:12 -0800 (PST) Received: from t430.minyard.net (t430m.minyard.net [192.168.27.3]) by serve.minyard.net (Postfix) with ESMTPA id A09741808F6; Wed, 20 Feb 2019 14:00:09 +0000 (UTC) Received: by t430.minyard.net (Postfix, from userid 1000) id 74CAE302A6C; Wed, 20 Feb 2019 08:00:09 -0600 (CST) From: minyard@acm.org To: qemu-devel@nongnu.org Date: Wed, 20 Feb 2019 07:59:46 -0600 Message-Id: <20190220135956.22589-10-minyard@acm.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190220135956.22589-1-minyard@acm.org> References: <20190220135956.22589-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::343 Subject: [Qemu-devel] [PATCH 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 , Corey Minyard , Corey Minyard , "Michael S . Tsirkin" , "Dr . David Alan Gilbert" , Paolo Bonzini 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; }