Re: [Xen-devel] [PATCH v2 1/2] ACPI/table: Always count matched and successfully parsed entries

2015-08-14 Thread Jan Beulich
 On 14.08.15 at 12:50, julien.gr...@citrix.com wrote:
 Hi Shannon,
 
 On 14/08/15 04:36, Shannon Zhao wrote:
 From: Tomasz Nowicki tomasz.nowi...@linaro.org
 
 Ported from Linux commit 4ceacd02f5a1795c5c697e0345ee10beef675290.
 
 acpi_parse_entries() allows to traverse all available table entries (aka
 subtables) by passing max_entries parameter equal to 0, but since its count
 variable is only incremented if max_entries is not 0, the function always
 returns 0 for max_entries equal to 0.  It would be more useful if it 
 returned
 the number of entries matched instead, so make it increment count in that
 case too.
 
 Acked-by: Grant Likely grant.lik...@linaro.org
 Signed-off-by: Tomasz Nowicki tomasz.nowi...@linaro.org
 Signed-off-by: Hanjun Guo hanjun@linaro.org
 Signed-off-by: Rafael J. Wysocki rafael.j.wyso...@intel.com
 Signed-off-by: Shannon Zhao shannon.z...@linaro.org
 
 You may want to add an indentation to show this is the commit message
 from Linux and not Xen.
 
 One of the reason behind that it's Grant acked the patch for Linux and
 not Xen. The patch is nearly the same this time (only the lines change),
 but it may happen that we need to fix a bit.

Which is why I find it generally better to do

S-o-b:
S-o-b:
[Linux commit ...]
S-o-b:

(when no other comments need adding) which implicitly draws a line
between the Linux and Xen tags.

Jan


___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


Re: [Xen-devel] [PATCH v2 1/2] ACPI/table: Always count matched and successfully parsed entries

2015-08-14 Thread Julien Grall
Hi Shannon,

On 14/08/15 04:36, Shannon Zhao wrote:
 From: Tomasz Nowicki tomasz.nowi...@linaro.org
 
 Ported from Linux commit 4ceacd02f5a1795c5c697e0345ee10beef675290.
 
 acpi_parse_entries() allows to traverse all available table entries (aka
 subtables) by passing max_entries parameter equal to 0, but since its count
 variable is only incremented if max_entries is not 0, the function always
 returns 0 for max_entries equal to 0.  It would be more useful if it returned
 the number of entries matched instead, so make it increment count in that
 case too.
 
 Acked-by: Grant Likely grant.lik...@linaro.org
 Signed-off-by: Tomasz Nowicki tomasz.nowi...@linaro.org
 Signed-off-by: Hanjun Guo hanjun@linaro.org
 Signed-off-by: Rafael J. Wysocki rafael.j.wyso...@intel.com
 Signed-off-by: Shannon Zhao shannon.z...@linaro.org

You may want to add an indentation to show this is the commit message
from Linux and not Xen.

One of the reason behind that it's Grant acked the patch for Linux and
not Xen. The patch is nearly the same this time (only the lines change),
but it may happen that we need to fix a bit.

Regards,

-- 
Julien Grall

___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


[Xen-devel] [PATCH v2 1/2] ACPI/table: Always count matched and successfully parsed entries

2015-08-13 Thread Shannon Zhao
From: Tomasz Nowicki tomasz.nowi...@linaro.org

Ported from Linux commit 4ceacd02f5a1795c5c697e0345ee10beef675290.

acpi_parse_entries() allows to traverse all available table entries (aka
subtables) by passing max_entries parameter equal to 0, but since its count
variable is only incremented if max_entries is not 0, the function always
returns 0 for max_entries equal to 0.  It would be more useful if it returned
the number of entries matched instead, so make it increment count in that
case too.

Acked-by: Grant Likely grant.lik...@linaro.org
Signed-off-by: Tomasz Nowicki tomasz.nowi...@linaro.org
Signed-off-by: Hanjun Guo hanjun@linaro.org
Signed-off-by: Rafael J. Wysocki rafael.j.wyso...@intel.com
Signed-off-by: Shannon Zhao shannon.z...@linaro.org
---
 xen/drivers/acpi/tables.c | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/xen/drivers/acpi/tables.c b/xen/drivers/acpi/tables.c
index e57cf2a..1da2127 100644
--- a/xen/drivers/acpi/tables.c
+++ b/xen/drivers/acpi/tables.c
@@ -239,10 +239,13 @@ acpi_table_parse_entries(char *id,
}
 
if (entry-type == entry_id
-(!max_entries || count++  max_entries))
+(!max_entries || count  max_entries)) {
if (handler(entry, table_end))
return -EINVAL;
 
+   count++;
+   }
+
entry = (struct acpi_subtable_header *)
((unsigned long)entry + entry-length);
}
-- 
2.0.4



___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel