Leftover code in gnttab.h?

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Leftover code in gnttab.h?

Pratyush Yadav-2
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 <xen/features.h>

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
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-xen
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: Leftover code in gnttab.h?

Roger Pau Monné
On Thu, May 24, 2018 at 05:53:02PM +0530, Pratyush Yadav wrote:
> 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?

This are leftovers from when the code was imported from Linux AFAICT.
I guess the original committer thought that those functions would be
implemented, so the prototypes where left in place.

If you give me a patch to remove them I'm happy to commit it.

Roger.
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-xen
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: Leftover code in gnttab.h?

Pratyush Yadav-2
Hi,

On Thu, May 24, 2018 at 7:36 PM, Roger Pau Monné <[hidden email]> wrote:

> On Thu, May 24, 2018 at 05:53:02PM +0530, Pratyush Yadav wrote:
>> 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?
>
> This are leftovers from when the code was imported from Linux AFAICT.
> I guess the original committer thought that those functions would be
> implemented, so the prototypes where left in place.
>
> If you give me a patch to remove them I'm happy to commit it.

How should I send you the patch? Should I send it through
reviews.freebsd.org, GitHub pull request or just paste the patch in
the email?

--
Regards,
Pratyush Yadav
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-xen
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: Leftover code in gnttab.h?

Roger Pau Monné
On Thu, May 24, 2018 at 08:38:30PM +0530, Pratyush Yadav wrote:

> Hi,
>
> On Thu, May 24, 2018 at 7:36 PM, Roger Pau Monné <[hidden email]> wrote:
> > On Thu, May 24, 2018 at 05:53:02PM +0530, Pratyush Yadav wrote:
> >> 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?
> >
> > This are leftovers from when the code was imported from Linux AFAICT.
> > I guess the original committer thought that those functions would be
> > implemented, so the prototypes where left in place.
> >
> > If you give me a patch to remove them I'm happy to commit it.
>
> How should I send you the patch? Should I send it through
> reviews.freebsd.org, GitHub pull request or just paste the patch in
> the email?

Let's use reviews.freebsd.org, so that you can get used to it.

Roger.
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-xen
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: Leftover code in gnttab.h?

Pratyush Yadav-2
On Thu, May 24, 2018 at 8:42 PM, Roger Pau Monné <[hidden email]> wrote:

> On Thu, May 24, 2018 at 08:38:30PM +0530, Pratyush Yadav wrote:
>> Hi,
>>
>> On Thu, May 24, 2018 at 7:36 PM, Roger Pau Monné <[hidden email]> wrote:
>> > On Thu, May 24, 2018 at 05:53:02PM +0530, Pratyush Yadav wrote:
>> >> 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?
>> >
>> > This are leftovers from when the code was imported from Linux AFAICT.
>> > I guess the original committer thought that those functions would be
>> > implemented, so the prototypes where left in place.
>> >
>> > If you give me a patch to remove them I'm happy to commit it.
>>
>> How should I send you the patch? Should I send it through
>> reviews.freebsd.org, GitHub pull request or just paste the patch in
>> the email?
>
> Let's use reviews.freebsd.org, so that you can get used to it.

In case you didn't get the notificaton: https://reviews.freebsd.org/D15553

--
Regards,
Pratyush Yadav
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-xen
To unsubscribe, send any mail to "[hidden email]"