From patchwork Sun Apr 15 23:42:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 898379 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=amsat.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="a9nhSVGZ"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40PT7Y35Kqz9s0b for ; Mon, 16 Apr 2018 10:01:29 +1000 (AEST) Received: from localhost ([::1]:52820 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f7raJ-0001ya-EJ for incoming@patchwork.ozlabs.org; Sun, 15 Apr 2018 20:01:27 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50936) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f7rJR-0004pX-5y for qemu-devel@nongnu.org; Sun, 15 Apr 2018 19:44:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f7rJQ-0000ZP-DE for qemu-devel@nongnu.org; Sun, 15 Apr 2018 19:44:01 -0400 Received: from mail-qk0-x242.google.com ([2607:f8b0:400d:c09::242]:46896) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f7rJO-0000Xq-4h; Sun, 15 Apr 2018 19:43:58 -0400 Received: by mail-qk0-x242.google.com with SMTP id l16so13887932qke.13; Sun, 15 Apr 2018 16:43:57 -0700 (PDT) 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 :mime-version:content-transfer-encoding; bh=jRvlgf+SGJi5ZSRNSBMn7y07pZ2VmHXkwI1D3ItLfIk=; b=a9nhSVGZy1dSyreBY7Z1KlM7Cl2C23I9VZ7agi40iDUr754I4uGemLV6yqMyrq6cNm +m7w+0jTDfjD7g55R1zOtTOlrn3EL0wSPv2Wma7a5YDuVQJkRvUD49hb2C6LPDI2Pobg NoZUv1rzMWtjIlXhbSlLqEyYebqs07BOTuT0wPX5zXnHs4rIrRM8G5e/MBUP5Hm8BzjA vTy5mCEwgPX1x8VPHIAVywhfNL/cHEKNGMLwTAr784rMrBNZsTFXQXKgpzUGI2+Q0GMQ txpJn6LPmfJiXrR4RbIWq68Kr4lUazQQESUUKeF44HEk9lUJyjtvfOpgdzkY4uSu1xPo tagQ== 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:mime-version:content-transfer-encoding; bh=jRvlgf+SGJi5ZSRNSBMn7y07pZ2VmHXkwI1D3ItLfIk=; b=U5OjEaS88gnEklzsmUaFDhYN4gznLWJaAOIinHGXyLZHYQpb+QyoWIV22Pe7xDlVAS Vh2v5YNgm2xWD2nLt2YpVcJnrw2OOfHzOfH5u7KMJKNqMDoVjO4OslLEz3m74m3qD2B9 PaW7yybC9qBuuJsctLdUx4gBbwcS6Dz2m7hp1E5xIX063MukfSB7s/vNwwM4zrFc9LwS LCyruNFrqUr8xtuUnPRoV6TZs4nWHGfnRqZ/tj2NAyEkquPZSIyradT/EDKvDbF2dS/w 9p1Dg1ZGZ6ztAkrgB8CHMZgQBNJvYoMnUPvYzWwVa3UjMmEpIKimj5LUIT8J2l5IVJfJ 4rrg== X-Gm-Message-State: ALQs6tBpOLO0A4Q63136VIxDGUJOuKHG9mpv317SCOUchIsLRQmCwMxP SnKnwieXSgXXAtmsOsHUgL62OPHz X-Google-Smtp-Source: AIpwx49MUPAzNQctCLSJpOlcBnOFQjZ5t4+AdvL9wlIJPXcUYsxOL0gng078DGOZF2wR0VdQjVwlKQ== X-Received: by 10.55.16.91 with SMTP id a88mr10492556qkh.199.1523835837459; Sun, 15 Apr 2018 16:43:57 -0700 (PDT) Received: from x1.local ([138.117.48.212]) by smtp.gmail.com with ESMTPSA id d1sm1081394qtk.57.2018.04.15.16.43.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 15 Apr 2018 16:43:57 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-trivial@nongnu.org, Thomas Huth Date: Sun, 15 Apr 2018 20:42:39 -0300 Message-Id: <20180415234307.28132-14-f4bug@amsat.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180415234307.28132-1-f4bug@amsat.org> References: <20180415234307.28132-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::242 Subject: [Qemu-devel] [PATCH v3 13/41] hw/block: Use the BYTE-based definitions 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: Kevin Wolf , "open list:nvme" , qemu-devel@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Max Reitz , Keith Busch Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" It eases code review, unit is explicit. Patch generated using: $ git grep -E '(1024|2048|4096|8192|(<<|>>).?(10|20|30))' hw/ include/hw/ and modified manually. Signed-off-by: Philippe Mathieu-Daudé --- hw/block/nvme.c | 3 ++- hw/block/tc58128.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/hw/block/nvme.c b/hw/block/nvme.c index 811084b6a7..273d36de76 100644 --- a/hw/block/nvme.c +++ b/hw/block/nvme.c @@ -25,6 +25,7 @@ */ #include "qemu/osdep.h" +#include "qemu/units.h" #include "hw/block/block.h" #include "hw/hw.h" #include "hw/pci/msix.h" @@ -648,7 +649,7 @@ static uint16_t nvme_identify_ns(NvmeCtrl *n, NvmeIdentify *c) static uint16_t nvme_identify_nslist(NvmeCtrl *n, NvmeIdentify *c) { - static const int data_len = 4096; + static const int data_len = 4 * K_BYTE; uint32_t min_nsid = le32_to_cpu(c->nsid); uint64_t prp1 = le64_to_cpu(c->prp1); uint64_t prp2 = le64_to_cpu(c->prp2); diff --git a/hw/block/tc58128.c b/hw/block/tc58128.c index 1d9f7ee000..42e1269546 100644 --- a/hw/block/tc58128.c +++ b/hw/block/tc58128.c @@ -1,4 +1,5 @@ #include "qemu/osdep.h" +#include "qemu/units.h" #include "hw/hw.h" #include "hw/sh4/sh.h" #include "hw/loader.h" @@ -26,7 +27,7 @@ typedef struct { static tc58128_dev tc58128_devs[2]; -#define FLASH_SIZE (16*1024*1024) +#define FLASH_SIZE (16 * M_BYTE) static void init_dev(tc58128_dev * dev, const char *filename) {