From patchwork Fri Jan 13 03:02:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Li Qiang X-Patchwork-Id: 9514515 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B353760710 for ; Fri, 13 Jan 2017 03:03:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AB2982869D for ; Fri, 13 Jan 2017 03:03:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9FD912870A; Fri, 13 Jan 2017 03:03:27 +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=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D5D962869D for ; Fri, 13 Jan 2017 03:03:25 +0000 (UTC) Received: from localhost ([::1]:38746 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cRs9E-0007m5-VX for patchwork-qemu-devel@patchwork.kernel.org; Thu, 12 Jan 2017 22:03:25 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51042) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cRs8o-0007l4-I5 for qemu-devel@nongnu.org; Thu, 12 Jan 2017 22:02:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cRs8l-00059r-Hw for qemu-devel@nongnu.org; Thu, 12 Jan 2017 22:02:58 -0500 Received: from mail-wm0-x241.google.com ([2a00:1450:400c:c09::241]:35671) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cRs8l-00059h-BI for qemu-devel@nongnu.org; Thu, 12 Jan 2017 22:02:55 -0500 Received: by mail-wm0-x241.google.com with SMTP id l2so8345620wml.2 for ; Thu, 12 Jan 2017 19:02:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:from:to:cc:subject:date; bh=BQHKgCIbkPCVl9ypsYocZMR5BmCK7gbL7+Yx7/+40dk=; b=A2gTaR6K2+kV3fIKFeBNx1cMwQNvfkivheAzyiXfhWIkqT3iwqM/IGNU/0l/jYQDR5 2LjNe9IhzCWTOmYsqtRg6LQc7XZPd8HemI7AhErMUgNjWkgAd2jyJ/2SQKDxC3Wed72H cUyO9gd2xHHlxocue0hW2ertDKJ4YmuHQMoIZCgTTIPwWwuS6IdBni2KTvEFEsguT53p N+CRbkbgttc6giC999e4hw5IGwHgDJlvbwhLiFkPYmcY9MEzOsoiv0BurPD3FOC8f6eJ 6RycPZ8aWeVbWqxjSTSlj4N2wD45kKHPGAEGqakn9EN/qzm+omIXMD7g1uxf6sRJ6pmK s5QQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:from:to:cc:subject:date; bh=BQHKgCIbkPCVl9ypsYocZMR5BmCK7gbL7+Yx7/+40dk=; b=oUMiYkpH+sBYwNk3/uxXMsVuX7ZrGJ00zgTpSsNlfGN6tEAaMORLXRpx7wDYjlcaa4 ZzGa3pMJ+7RGsnJKqwWrvBu15iJJ3O59flr4DO8uejIIWGQfpwzUdB4w5wJDbgfhzydj jMRVcHw5sH6Cd2sOhOmR3GfYBDWiSWALb+MDJAMQX0dEDbmLKmlSaw87vE0XPqbVEhMD uccJPdOPfjqv9QdJB0xKHTLkM5dRKHk/zzzyYpFe2DZKLXAiQfqTriIjUAvToVp0b3uE TLiaBoONqiaHW54DF0eHhQ9otP4yZXY+pGTFO7rte5/5WgDYN/gYfYdOn4Osdyo8G1Ie VyoA== X-Gm-Message-State: AIkVDXK8wFo9MmRExrzowpy+3IZDziI3+q0TTjn/PRwHBp2hS8fzWbkQhxFB2Lmf8IN7zQ== X-Received: by 10.223.177.195 with SMTP id r3mr11346987wra.122.1484276573951; Thu, 12 Jan 2017 19:02:53 -0800 (PST) Received: from localhost.localdomain.localdomain ([104.192.110.250]) by smtp.gmail.com with ESMTPSA id c81sm713010wmf.22.2017.01.12.19.02.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 12 Jan 2017 19:02:53 -0800 (PST) Message-ID: <5878435d.54b31c0a.39a7b.4e93@mx.google.com> X-Google-Original-Message-ID: <1484276540-88651-1-git-send-email-Qiang(liqiang6-s@360.cn)> From: Li Qiang X-Google-Original-From: Li Qiang(liqiang6-s@360.cn) To: guangrong.xiao@linux.intel.com, qemu-devel@nongnu.org Date: Thu, 12 Jan 2017 19:02:20 -0800 X-Mailer: git-send-email 1.8.3.1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:400c:c09::241 Subject: [Qemu-devel] [PATCH] nvdimm: allow read/write zero-size namespace label 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: Li Qiang Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Li Qiang The spec doesn't say the namespace label can't be zero when read/write it. As this is no harmful, just allow it. Signed-off-by: Li Qiang --- hw/mem/nvdimm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/mem/nvdimm.c b/hw/mem/nvdimm.c index db896b0..4042097 100644 --- a/hw/mem/nvdimm.c +++ b/hw/mem/nvdimm.c @@ -114,7 +114,7 @@ static void nvdimm_realize(PCDIMMDevice *dimm, Error **errp) static void nvdimm_validate_rw_label_data(NVDIMMDevice *nvdimm, uint64_t size, uint64_t offset) { - assert((nvdimm->label_size >= size + offset) && (offset + size > offset)); + assert((nvdimm->label_size >= size + offset) && (offset + size >= offset)); } static void nvdimm_read_label_data(NVDIMMDevice *nvdimm, void *buf,