From patchwork Fri Apr 29 14:21:17 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Roger_Pau_Monn=C3=A9?= X-Patchwork-Id: 8983271 Return-Path: X-Original-To: patchwork-xen-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 0E60A9F54E for ; Fri, 29 Apr 2016 14:24:22 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CC837201CD for ; Fri, 29 Apr 2016 14:24:20 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 986B1201C8 for ; Fri, 29 Apr 2016 14:24:19 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aw9IX-0005qV-HK; Fri, 29 Apr 2016 14:21:37 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aw9IW-0005qC-De for xen-devel@lists.xenproject.org; Fri, 29 Apr 2016 14:21:36 +0000 Received: from [85.158.139.211] by server-14.bemta-5.messagelabs.com id 4E/AF-30904-FED63275; Fri, 29 Apr 2016 14:21:35 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrGIsWRWlGSWpSXmKPExsXitHRDpO77XOV wgwmLeC2+b5nM5MDocfjDFZYAxijWzLyk/IoE1owzEz+xFvx2qFi5/xNLA+MHwy5GTg4JAX+J vUsmsYLYbAI6Ehfn7mTrYuTgEBFQkbi916CLkYuDWeAuk8Tvw68YQWqEBVwkHv99ywJiswioS uzffxKslxco3tawnglipq7Eyd2b2EFsTgFXidUr3rGDzBQCqtm71hmiXFDi5MwnYGOYBTQlWr f/Zoew5SWat85mBrGFBBQl+uc9ADtHQoBb4m+3/QRG/llIumch6Z6FpHsBI/MqRvXi1KKy1CJ dI72kosz0jJLcxMwcXUMDU73c1OLixPTUnMSkYr3k/NxNjMDwYwCCHYzf/zgdYpTkYFIS5b2q qxwuxJeUn1KZkVicEV9UmpNafIhRhoNDSYL3Wg5QTrAoNT21Ii0zBxgJMGkJDh4lEd4LIGne4 oLE3OLMdIjUKUZFKXHeLyAJAZBERmkeXBss+i4xykoJ8zICHSLEU5BalJtZgir/ilGcg1FJmP cDyBSezLwSuOmvgBYzAS0W2KQIsrgkESEl1cBoPfnWHaWzuz5dm/coa81v+19aJsvX+eilvfl x+MnNhbPEZ0QU/+n4fcdv4t7yxu1Pvm5Z5fHg6TNbye4J/JVZ5dOKvq4UqNwwUYRhW0cMa+fH 21FGNx+e+/vFTd1S2/lT2+a1l+Z7HNtwd9VJhveuezl/vstxeTpx7xz2yOm1tUGlvJvyWVazu SqxFGckGmoxFxUnAgCBuI/6uQIAAA== X-Env-Sender: prvs=9202e7170=roger.pau@citrix.com X-Msg-Ref: server-12.tower-206.messagelabs.com!1461939691!780758!2 X-Originating-IP: [66.165.176.89] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAyMDMwMDc=\n, received_headers: No Received headers X-StarScan-Received: X-StarScan-Version: 8.34; banners=-,-,- X-VirusChecked: Checked Received: (qmail 1705 invoked from network); 29 Apr 2016 14:21:34 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-12.tower-206.messagelabs.com with RC4-SHA encrypted SMTP; 29 Apr 2016 14:21:34 -0000 X-IronPort-AV: E=Sophos;i="5.24,551,1454976000"; d="scan'208";a="350725889" From: Roger Pau Monne To: Date: Fri, 29 Apr 2016 16:21:17 +0200 Message-ID: <1461939680-32574-2-git-send-email-roger.pau@citrix.com> X-Mailer: git-send-email 2.6.4 (Apple Git-63) In-Reply-To: <1461939680-32574-1-git-send-email-roger.pau@citrix.com> References: <1461939680-32574-1-git-send-email-roger.pau@citrix.com> MIME-Version: 1.0 X-DLP: MIA1 Cc: Stefano Stabellini , Wei Liu , George Dunlap , Andrew Cooper , Tim Deegan , Julien Grall , Jan Beulich , Ian Jackson , Roger Pau Monne Subject: [Xen-devel] [PATCH for-4.7 1/4] xen: remove usage of ENODATA error code X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP According to the POSIX standard for error codes [0], ENODATA is both obsolescent (so it may be removed in the future) and optional. Replace it's usage with ENOENT, which seems like the closest match. Both FreeBSD and OpenBSD don't have this error code in the native errno.h headers. [0] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/errno.h.html Signed-off-by: Roger Pau Monné --- Cc: Ian Jackson Cc: Wei Liu Cc: Jan Beulich Cc: Andrew Cooper Cc: Tim Deegan Cc: George Dunlap Cc: Stefano Stabellini Cc: Julien Grall --- tools/libxl/libxl.c | 2 +- xen/arch/x86/hvm/hvm.c | 8 ++++---- xen/arch/x86/microcode_amd.c | 4 ++-- xen/arch/x86/mm/shadow/common.c | 2 +- xen/common/device_tree.c | 2 +- xen/common/domctl.c | 2 +- xen/common/version.c | 10 +++++----- xen/drivers/acpi/pmstat.c | 2 +- xen/drivers/acpi/tables.c | 2 +- xen/include/public/errno.h | 1 - 10 files changed, 17 insertions(+), 18 deletions(-) diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c index c39d745..0dcc06f 100644 --- a/tools/libxl/libxl.c +++ b/tools/libxl/libxl.c @@ -5361,7 +5361,7 @@ static const int libxl__xc_version_wrap(libxl__gc *gc, libxl_version_info *info, r = xc_version(CTX->xch, XENVER_build_id, build); switch (r) { case -EPERM: - case -ENODATA: + case -ENOENT: case 0: info->build_id = libxl__strdup(NOGC, ""); break; diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c index 8cb6e9e..980b4a1 100644 --- a/xen/arch/x86/hvm/hvm.c +++ b/xen/arch/x86/hvm/hvm.c @@ -1274,14 +1274,14 @@ static int hvm_load_cpu_xsave_states(struct domain *d, hvm_domain_context_t *h) printk(XENLOG_G_WARNING "HVM%d.%d restore: not enough data left to read xsave descriptor\n", d->domain_id, vcpuid); - return -ENODATA; + return -ENOENT; } if ( desc->length + sizeof (*desc) > h->size - h->cur) { printk(XENLOG_G_WARNING "HVM%d.%d restore: not enough data left to read %u xsave bytes\n", d->domain_id, vcpuid, desc->length); - return -ENODATA; + return -ENOENT; } if ( desc->length < offsetof(struct hvm_hw_cpu_xsave, save_area) + XSTATE_AREA_MIN_SIZE ) @@ -1402,14 +1402,14 @@ static int hvm_load_cpu_msrs(struct domain *d, hvm_domain_context_t *h) printk(XENLOG_G_WARNING "HVM%d.%d restore: not enough data left to read MSR descriptor\n", d->domain_id, vcpuid); - return -ENODATA; + return -ENOENT; } if ( desc->length + sizeof (*desc) > h->size - h->cur) { printk(XENLOG_G_WARNING "HVM%d.%d restore: not enough data left to read %u MSR bytes\n", d->domain_id, vcpuid, desc->length); - return -ENODATA; + return -ENOENT; } if ( desc->length < HVM_CPU_MSR_SIZE(1) ) { diff --git a/xen/arch/x86/microcode_amd.c b/xen/arch/x86/microcode_amd.c index a61c926..ca1a026 100644 --- a/xen/arch/x86/microcode_amd.c +++ b/xen/arch/x86/microcode_amd.c @@ -342,7 +342,7 @@ static int container_fast_forward(const void *data, size_t size_left, size_t *of *offset += size; if ( !size_left ) - return -ENODATA; + return -ENOENT; } return 0; @@ -454,7 +454,7 @@ static int cpu_request_microcode(unsigned int cpu, const void *buf, break; error = container_fast_forward(buf, bufsize - offset, &offset); - if ( error == -ENODATA ) + if ( error == -ENOENT ) { ASSERT(offset == bufsize); break; diff --git a/xen/arch/x86/mm/shadow/common.c b/xen/arch/x86/mm/shadow/common.c index 4e06c13..6ce76e2 100644 --- a/xen/arch/x86/mm/shadow/common.c +++ b/xen/arch/x86/mm/shadow/common.c @@ -3729,7 +3729,7 @@ int shadow_track_dirty_vram(struct domain *d, dirty_vram->last_dirty = NOW(); /* Tell the caller that this time we could not track dirty bits. */ - rc = -ENODATA; + rc = -ENOENT; } else if (dirty_vram->last_dirty == -1) /* still completely clean, just copy our empty bitmap */ diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c index 0ed86a7..9d1896e 100644 --- a/xen/common/device_tree.c +++ b/xen/common/device_tree.c @@ -204,7 +204,7 @@ int dt_property_read_string(const struct dt_device_node *np, if ( !pp ) return -EINVAL; if ( !pp->value ) - return -ENODATA; + return -ENOENT; if ( strnlen(pp->value, pp->length) >= pp->length ) return -EILSEQ; diff --git a/xen/common/domctl.c b/xen/common/domctl.c index e43904e..d07114a 100644 --- a/xen/common/domctl.c +++ b/xen/common/domctl.c @@ -901,7 +901,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl) v == current ) /* no vcpu_pause() */ goto getvcpucontext_out; - ret = -ENODATA; + ret = -ENOENT; if ( !v->is_initialised ) goto getvcpucontext_out; diff --git a/xen/common/version.c b/xen/common/version.c index 0f96849..1bffb3e 100644 --- a/xen/common/version.c +++ b/xen/common/version.c @@ -74,7 +74,7 @@ static unsigned int build_id_len __read_mostly; int xen_build_id(const void **p, unsigned int *len) { if ( !build_id_len ) - return -ENODATA; + return -ENOENT; *len = build_id_len; *p = build_id_p; @@ -91,7 +91,7 @@ int xen_build_id_check(const Elf_Note *n, unsigned int n_sz, { /* Check if we really have a build-id. */ if ( NT_GNU_BUILD_ID != n->type ) - return -ENODATA; + return -ENOENT; if ( n_sz <= sizeof(*n) ) return -EINVAL; @@ -107,7 +107,7 @@ int xen_build_id_check(const Elf_Note *n, unsigned int n_sz, /* Sanity check, name should be "GNU" for ld-generated build-id. */ if ( strncmp(ELFNOTE_NAME(n), "GNU", n->namesz) != 0 ) - return -ENODATA; + return -ENOENT; if ( len ) *len = n->descsz; @@ -124,11 +124,11 @@ static int __init xen_build_init(void) /* --build-id invoked with wrong parameters. */ if ( __note_gnu_build_id_end <= &n[0] ) - return -ENODATA; + return -ENOENT; /* Check for full Note header. */ if ( &n[1] > __note_gnu_build_id_end ) - return -ENODATA;; + return -ENOENT; sz = (void *)__note_gnu_build_id_end - (void *)n; diff --git a/xen/drivers/acpi/pmstat.c b/xen/drivers/acpi/pmstat.c index 892260d..7ed59b0 100644 --- a/xen/drivers/acpi/pmstat.c +++ b/xen/drivers/acpi/pmstat.c @@ -95,7 +95,7 @@ int do_get_pm_info(struct xen_sysctl_get_pmstat *op) if ( !pxpt || !pxpt->u.pt || !pxpt->u.trans_pt ) { spin_unlock(cpufreq_statistic_lock); - return -ENODATA; + return -ENOENT; } pxpt->u.usable = pmpt->perf.state_count - pmpt->perf.platform_limit; diff --git a/xen/drivers/acpi/tables.c b/xen/drivers/acpi/tables.c index dd2031f..685c2cd 100644 --- a/xen/drivers/acpi/tables.c +++ b/xen/drivers/acpi/tables.c @@ -319,7 +319,7 @@ acpi_parse_entries(char *id, unsigned long table_size, if (entry->length < sizeof(*entry)) { printk(KERN_ERR PREFIX "[%4.4s:%#x] Invalid length\n", id, entry_id); - return -ENODATA; + return -ENOENT; } if (entry->type == entry_id diff --git a/xen/include/public/errno.h b/xen/include/public/errno.h index ebb853a..070f834 100644 --- a/xen/include/public/errno.h +++ b/xen/include/public/errno.h @@ -93,7 +93,6 @@ XEN_ERRNO(ENAMETOOLONG, 36) /* File name too long */ XEN_ERRNO(ENOLCK, 37) /* No record locks available */ XEN_ERRNO(ENOTEMPTY, 39) /* Directory not empty */ XEN_ERRNO(ENOSYS, 38) /* Function not implemented */ -XEN_ERRNO(ENODATA, 61) /* No data available */ XEN_ERRNO(ETIME, 62) /* Timer expired */ XEN_ERRNO(EBADMSG, 74) /* Not a data message */ XEN_ERRNO(EOVERFLOW, 75) /* Value too large for defined data type */