[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v1 Altp2m cleanup 1/3] altp2m cleanup work



On Thu, Jun 23, 2016 at 7:23 PM, Lai, Paul C <paul.c.lai@xxxxxxxxx> wrote:
> I'm opposed to moving HVMOP_cmd_min and HVMOP_cmd_max somewhere else.  That 
> would make reading/understanding of the macros more difficult.  This practice 
> is common.  Also, If min & max are defined elsewhere, it will be more likely 
> to lead to mistakes/bugs.
>
> The use of "_min" and "_max" should be quite clear and is common use in linux 
> code; Yes, I know this is xen code and I see it here too.  If there's a 
> better way, please propose the better.  Maybe you're suggesting the macro 
> names should be all caps:
>   HVMOP_CMD_MIN, HVMOP_CMD_MAX
> ?  I was following the coding style within the file itself.

Jan was suggesting that these should be called HVMOP_altp2m_{max,min}
(or perhaps HVMOP_altp2m_cmd_{max,min}).

But in any case, the most robust thing to do is not to check the
values here at all -- just add a default: clause to the switch()
statement which returns -ENOSYS.

 -George

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.