From owner-freebsd-xen@freebsd.org Thu May 24 12:23:51 2018 Return-Path: Delivered-To: freebsd-xen@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8C024EEEA81 for ; Thu, 24 May 2018 12:23:51 +0000 (UTC) (envelope-from pratiy0100@gmail.com) Received: from mail-wm0-f68.google.com (mail-wm0-f68.google.com [74.125.82.68]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 119A1685C1 for ; Thu, 24 May 2018 12:23:50 +0000 (UTC) (envelope-from pratiy0100@gmail.com) Received: by mail-wm0-f68.google.com with SMTP id f8-v6so4696778wmc.4 for ; Thu, 24 May 2018 05:23:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=5xL2QRWoja2EENjs6FRYcZ7cV7ZSyNzwT+mj4nsTPJA=; b=maIzcUhvtDJeM7IKs5N6xEGB2MMkLxkNhv3j9NmZoPWyWq3v9pWJyDcKjO2BKhQ7Sa R8G/kP1V4Jgjxym4SgOUheXZufEaMpXge3Lv+qYLx1qd+fh+NxgL8MItijTa4ulk5nrl uy7eKyEd8y6qgQdyE2UqaLS8r9LQOsTDMXLaaJs/bz/tftIeo9W+A9END53JCZ687Z0f Q6yVP3ODoZPHBBnL/Qq31kqtQEXUSygXgrQkH0081pW75cEMOsHBUOikGXuhDep7jMrr k7N9spwCk3q8GQNpRKcfPg+WrxKsL2VxHyryUMMgDtncqcOC1bMLCJQhTS+tME9/YRG0 b/NQ== X-Gm-Message-State: ALKqPwd5rMCWuY9nw7UzpDwRALQf4LY1dhqHys6fWAer2jPUU7FZ2Zr1 hT84j1JO4facV/QjyyugSD7wDe/Y X-Google-Smtp-Source: AB8JxZrwGA/ne3O8SkeT3Ailva/RAsYaN6m8OmoENm/nSnET+oLoUDU+L+V/8QiekjMVAB/JQlAKNA== X-Received: by 2002:a50:d649:: with SMTP id c9-v6mr3160352edj.16.1527164623710; Thu, 24 May 2018 05:23:43 -0700 (PDT) Received: from mail-wm0-f54.google.com (mail-wm0-f54.google.com. [74.125.82.54]) by smtp.gmail.com with ESMTPSA id m31-v6sm11713779edc.94.2018.05.24.05.23.43 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 24 May 2018 05:23:43 -0700 (PDT) Received: by mail-wm0-f54.google.com with SMTP id f6-v6so4543749wmc.4 for ; Thu, 24 May 2018 05:23:43 -0700 (PDT) X-Received: by 2002:a50:ad69:: with SMTP id z38-v6mr12008469edc.306.1527164623447; Thu, 24 May 2018 05:23:43 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a50:aa21:0:0:0:0:0 with HTTP; Thu, 24 May 2018 05:23:02 -0700 (PDT) From: Pratyush Yadav Date: Thu, 24 May 2018 17:53:02 +0530 X-Gmail-Original-Message-ID: Message-ID: Subject: Leftover code in gnttab.h? To: FreeBSD-Xen Content-Type: text/plain; charset="UTF-8" X-BeenThere: freebsd-xen@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: Discussion of the freebsd port to xen - implementation and usage List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2018 12:23:51 -0000 Hi everyone, I was reading the Xen grant table code and I noticed that some code is wrapped in an #if 0. You can see it in sys/xen/gnttab.h:138. I have also attached the "commented out" part down below. Is it useful? Is it all right if I submit a patch that removes it? Regards, Pratyush Yadav #if 0 #include static inline void gnttab_set_map_op(struct gnttab_map_grant_ref *map, vm_paddr_t addr, uint32_t flags, grant_ref_t ref, domid_t domid) { if (flags & GNTMAP_contains_pte) map->host_addr = addr; else map->host_addr = vtophys(addr); map->flags = flags; map->ref = ref; map->dom = domid; } static inline void gnttab_set_unmap_op(struct gnttab_unmap_grant_ref *unmap, vm_paddr_t addr, uint32_t flags, grant_handle_t handle) { if (flags & GNTMAP_contains_pte) unmap->host_addr = addr; else unmap->host_addr = vtophys(addr); unmap->handle = handle; unmap->dev_bus_addr = 0; } static inline void gnttab_set_replace_op(struct gnttab_unmap_and_replace *unmap, vm_paddr_t addr, vm_paddr_t new_addr, grant_handle_t handle) { unmap->host_addr = vtophys(addr); unmap->new_addr = vtophys(new_addr); unmap->handle = handle; } #endif