diff mbox

[1/3] xmalloc: correct _xmalloc_array() indentation

Message ID 591D79F1020000780015ABFD@prv-mh.provo.novell.com (mailing list archive)
State New, archived
Headers show

Commit Message

Jan Beulich May 18, 2017, 8:39 a.m. UTC
It's been wrongly indented using tabs till now, and the stray blank
ahead of the final return statement gets in the way of using .i files
for detailed analysis of other compiler issues
(-Wmisleading-indentation kickin in due to the tab->space
transformation done in the course of pre-processing).

Also add missing spaces inside the if() at once, including the similar
case in _xzalloc_array().

Signed-off-by: Jan Beulich <jbeulich@suse.com>
xmalloc: correct _xmalloc_array() indentation

It's been wrongly indented using tabs till now, and the stray blank
ahead of the final return statement gets in the way of using .i files
for detailed analysis of other compiler issues
(-Wmisleading-indentation kickin in due to the tab->space
transformation done in the course of pre-processing).

Also add missing spaces inside the if() at once, including the similar
case in _xzalloc_array().

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/include/xen/xmalloc.h
+++ b/xen/include/xen/xmalloc.h
@@ -33,17 +33,17 @@ extern void *_xzalloc(unsigned long size
 static inline void *_xmalloc_array(
     unsigned long size, unsigned long align, unsigned long num)
 {
-	/* Check for overflow. */
-	if (size && num > UINT_MAX / size)
-		return NULL;
- 	return _xmalloc(size * num, align);
+    /* Check for overflow. */
+    if ( size && num > UINT_MAX / size )
+        return NULL;
+    return _xmalloc(size * num, align);
 }
 
 static inline void *_xzalloc_array(
     unsigned long size, unsigned long align, unsigned long num)
 {
     /* Check for overflow. */
-    if (size && num > UINT_MAX / size)
+    if ( size && num > UINT_MAX / size )
         return NULL;
     return _xzalloc(size * num, align);
 }

Comments

Wei Liu May 18, 2017, 9:40 a.m. UTC | #1
On Thu, May 18, 2017 at 02:39:45AM -0600, Jan Beulich wrote:
> It's been wrongly indented using tabs till now, and the stray blank
> ahead of the final return statement gets in the way of using .i files
> for detailed analysis of other compiler issues
> (-Wmisleading-indentation kickin in due to the tab->space

kickin -> kicks

> transformation done in the course of pre-processing).
> 
> Also add missing spaces inside the if() at once, including the similar
> case in _xzalloc_array().
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Reviewed-by: Wei Liu <wei.liu2@citrix.com>
Andrew Cooper May 18, 2017, 10:16 a.m. UTC | #2
On 18/05/17 10:40, Wei Liu wrote:
> On Thu, May 18, 2017 at 02:39:45AM -0600, Jan Beulich wrote:
>> It's been wrongly indented using tabs till now, and the stray blank
>> ahead of the final return statement gets in the way of using .i files
>> for detailed analysis of other compiler issues
>> (-Wmisleading-indentation kickin in due to the tab->space
> kickin -> kicks
>
>> transformation done in the course of pre-processing).
>>
>> Also add missing spaces inside the if() at once, including the similar
>> case in _xzalloc_array().
>>
>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> Reviewed-by: Wei Liu <wei.liu2@citrix.com>

Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
diff mbox

Patch

--- a/xen/include/xen/xmalloc.h
+++ b/xen/include/xen/xmalloc.h
@@ -33,17 +33,17 @@  extern void *_xzalloc(unsigned long size
 static inline void *_xmalloc_array(
     unsigned long size, unsigned long align, unsigned long num)
 {
-	/* Check for overflow. */
-	if (size && num > UINT_MAX / size)
-		return NULL;
- 	return _xmalloc(size * num, align);
+    /* Check for overflow. */
+    if ( size && num > UINT_MAX / size )
+        return NULL;
+    return _xmalloc(size * num, align);
 }
 
 static inline void *_xzalloc_array(
     unsigned long size, unsigned long align, unsigned long num)
 {
     /* Check for overflow. */
-    if (size && num > UINT_MAX / size)
+    if ( size && num > UINT_MAX / size )
         return NULL;
     return _xzalloc(size * num, align);
 }