[coreboot-gerrit] Change in coreboot[master]: payloads/libpayload: Add whitespace around '=='

Elyes HAOUAS (Code Review) gerrit at coreboot.org
Thu Apr 26 10:13:10 CEST 2018


Elyes HAOUAS has uploaded this change for review. ( https://review.coreboot.org/25856


Change subject: payloads/libpayload: Add whitespace around '=='
......................................................................

payloads/libpayload: Add whitespace around '=='

Change-Id: Ie1da925aceb01c2d21b472bf171000803004578f
Signed-off-by: Elyes HAOUAS <ehaouas at noos.fr>
---
M payloads/libpayload/curses/form/fld_attr.c
M payloads/libpayload/curses/form/frm_driver.c
M payloads/libpayload/curses/menu/m_attribs.c
M payloads/libpayload/curses/menu/m_driver.c
M payloads/libpayload/curses/pdcurses-backend/pdckbd.c
M payloads/libpayload/drivers/usb/ehci.c
M payloads/libpayload/drivers/usb/ohci.c
M payloads/libpayload/liblz4/lz4.c.inc
8 files changed, 22 insertions(+), 22 deletions(-)



  git pull ssh://review.coreboot.org:29418/coreboot refs/changes/56/25856/1

diff --git a/payloads/libpayload/curses/form/fld_attr.c b/payloads/libpayload/curses/form/fld_attr.c
index 0112f00..2ba0786 100644
--- a/payloads/libpayload/curses/form/fld_attr.c
+++ b/payloads/libpayload/curses/form/fld_attr.c
@@ -43,7 +43,7 @@
 {\
    int res = E_BAD_ARGUMENT;\
    T((T_CALLED("set_field_" #name "(%p,%s)"), field, _traceattr(attr)));\
-   if ( attr==A_NORMAL || ((attr & A_ATTRIBUTES)==attr) )\
+   if ( attr == A_NORMAL || ((attr & A_ATTRIBUTES)==attr) )\
      {\
        Normalize_Field( field );\
        if (field != 0) \
diff --git a/payloads/libpayload/curses/form/frm_driver.c b/payloads/libpayload/curses/form/frm_driver.c
index e0892bf..e058d19 100644
--- a/payloads/libpayload/curses/form/frm_driver.c
+++ b/payloads/libpayload/curses/form/frm_driver.c
@@ -200,7 +200,7 @@
 /* Logic to determine whether or not we are on the first position in the
    current field */
 #define First_Position_In_Current_Field(form) \
-  (((form)->currow==0) && ((form)->curcol==0))
+  (((form)->currow == 0) && ((form)->curcol == 0))
 
 #define Minimum(a,b) (((a)<=(b)) ? (a) : (b))
 #define Maximum(a,b) (((a)>=(b)) ? (a) : (b))
@@ -2586,7 +2586,7 @@
 	{
 	  if (Last_Row && !Field_Grown(field, 1))
 	    {
-	      /* N.B.: due to the logic in the 'if', LastRow==TRUE
+	      /* N.B.: due to the logic in the 'if', LastRow == TRUE
 	         means here that the field is growable and not
 	         a single-line field */
 	      returnCode(E_SYSTEM_ERROR);
diff --git a/payloads/libpayload/curses/menu/m_attribs.c b/payloads/libpayload/curses/menu/m_attribs.c
index 1ea5c7a..9e4398f 100644
--- a/payloads/libpayload/curses/menu/m_attribs.c
+++ b/payloads/libpayload/curses/menu/m_attribs.c
@@ -52,7 +52,7 @@
 NCURSES_IMPEXP int NCURSES_API set_menu_ ## name (MENU* menu, chtype attr) \
 {\
   T((T_CALLED("set_menu_" #name "(%p,%s)"), menu, _traceattr(attr))); \
-   if (!(attr==A_NORMAL || (attr & A_ATTRIBUTES)==attr))\
+   if (!(attr == A_NORMAL || (attr & A_ATTRIBUTES)==attr))\
       RETURN(E_BAD_ARGUMENT);\
    if (menu && ( menu -> name != attr))\
      {\
diff --git a/payloads/libpayload/curses/menu/m_driver.c b/payloads/libpayload/curses/menu/m_driver.c
index deeff47..b2a7145 100644
--- a/payloads/libpayload/curses/menu/m_driver.c
+++ b/payloads/libpayload/curses/menu/m_driver.c
@@ -180,7 +180,7 @@
          or PREV_PATTERN scan this means, that there was no additional match.
          If we searched with an expanded new pattern, we should never reach
          this point, because if the expanded pattern matches also the actual
-         item we will find it in the first attempt (passed==FALSE) and we
+         item we will find it in the first attempt (passed == FALSE) and we
          will never cycle through the whole item array.
        */
       assert(ch == 0 || ch == BS);
diff --git a/payloads/libpayload/curses/pdcurses-backend/pdckbd.c b/payloads/libpayload/curses/pdcurses-backend/pdckbd.c
index c872262..6b5b7ea 100644
--- a/payloads/libpayload/curses/pdcurses-backend/pdckbd.c
+++ b/payloads/libpayload/curses/pdcurses-backend/pdckbd.c
@@ -149,14 +149,14 @@
 
 #if IS_ENABLED(CONFIG_LP_PC_KEYBOARD)
     if ((curses_flags & F_ENABLE_CONSOLE) &&
-        keyboard_havechar() && (c==0)) {
+        keyboard_havechar() && (c == 0)) {
         c = keyboard_getchar();
     }
 #endif
 
 #if IS_ENABLED(CONFIG_LP_SERIAL_CONSOLE)
     if ((curses_flags & F_ENABLE_SERIAL) &&
-        serial_havechar() && (c==0)) {
+        serial_havechar() && (c == 0)) {
         c = cook_serial(serial_getchar());
     }
 #endif
diff --git a/payloads/libpayload/drivers/usb/ehci.c b/payloads/libpayload/drivers/usb/ehci.c
index 4636e7c..2df74ad 100644
--- a/payloads/libpayload/drivers/usb/ehci.c
+++ b/payloads/libpayload/drivers/usb/ehci.c
@@ -351,7 +351,7 @@
 	u8 *end = src + size;
 	int remaining = size;
 	int endp = ep->endpoint & 0xf;
-	int pid = (ep->direction==IN)?EHCI_IN:EHCI_OUT;
+	int pid = (ep->direction == IN)?EHCI_IN:EHCI_OUT;
 
 	int hubaddr = 0, hubport = 0;
 	if (ep->dev->speed < 2) {
diff --git a/payloads/libpayload/drivers/usb/ohci.c b/payloads/libpayload/drivers/usb/ohci.c
index 1d7d830..0dfda17 100644
--- a/payloads/libpayload/drivers/usb/ohci.c
+++ b/payloads/libpayload/drivers/usb/ohci.c
@@ -373,7 +373,7 @@
 	int first_page = (unsigned long)data / 4096;
 	int last_page = (unsigned long)(data+dalen-1)/4096;
 	if (last_page < first_page) last_page = first_page;
-	int pages = (dalen==0)?0:(last_page - first_page + 1);
+	int pages = (dalen == 0)?0:(last_page - first_page + 1);
 
 	/* First TD. */
 	td_t *const first_td = (td_t *)dma_memalign(sizeof(td_t), sizeof(td_t));
@@ -467,7 +467,7 @@
 	OHCI_INST(dev->controller)->opreg->HcCommandStatus = ControlListFilled;
 
 	int result = wait_for_ed(dev, head,
-			(dalen==0)?0:(last_page - first_page + 1));
+			(dalen == 0)?0:(last_page - first_page + 1));
 	/* Wait some frames before and one after disabling list access. */
 	mdelay(4);
 	OHCI_INST(dev->controller)->opreg->HcControl &= ~ControlListEnable;
@@ -509,7 +509,7 @@
 	int first_page = (unsigned long)data / 4096;
 	int last_page = (unsigned long)(data+dalen-1)/4096;
 	if (last_page < first_page) last_page = first_page;
-	int pages = (dalen==0)?0:(last_page - first_page + 1);
+	int pages = (dalen == 0)?0:(last_page - first_page + 1);
 	int td_count = (pages+1)/2;
 
 	if (finalize && ((dalen % ep->maxpacketsize) == 0)) {
@@ -571,7 +571,7 @@
 	memset((void*)head, 0, sizeof(*head));
 	head->config = (ep->dev->address << ED_FUNC_SHIFT) |
 		((ep->endpoint & 0xf) << ED_EP_SHIFT) |
-		(((ep->direction==IN)?OHCI_IN:OHCI_OUT) << ED_DIR_SHIFT) |
+		(((ep->direction == IN)?OHCI_IN:OHCI_OUT) << ED_DIR_SHIFT) |
 		(ep->dev->speed?ED_LOWSPEED:0) |
 		(ep->maxpacketsize << ED_MPS_SHIFT);
 	head->tail_pointer = virt_to_phys(cur);
@@ -588,7 +588,7 @@
 	OHCI_INST(ep->dev->controller)->opreg->HcCommandStatus = BulkListFilled;
 
 	int result = wait_for_ed(ep->dev, head,
-			(dalen==0)?0:(last_page - first_page + 1));
+			(dalen == 0)?0:(last_page - first_page + 1));
 	/* Wait some frames before and one after disabling list access. */
 	mdelay(4);
 	OHCI_INST(ep->dev->controller)->opreg->HcControl &= ~BulkListEnable;
diff --git a/payloads/libpayload/liblz4/lz4.c.inc b/payloads/libpayload/liblz4/lz4.c.inc
index baa9110..5ecc790 100644
--- a/payloads/libpayload/liblz4/lz4.c.inc
+++ b/payloads/libpayload/liblz4/lz4.c.inc
@@ -99,14 +99,14 @@
                  const char* const source,
                  char* const dest,
                  int inputSize,
-                 int outputSize,         /* If endOnInput==endOnInputSize, this value is the max size of Output Buffer. */
+                 int outputSize,         /* If endOnInput == endOnInputSize, this value is the max size of Output Buffer. */
 
                  int endOnInput,         /* endOnOutputSize, endOnInputSize */
                  int partialDecoding,    /* full, partial */
-                 int targetOutputSize,   /* only used if partialDecoding==partial */
+                 int targetOutputSize,   /* only used if partialDecoding == partial */
                  int dict,               /* noDict, withPrefix64k, usingExtDict */
                  const BYTE* const lowPrefix,  /* == dest if dict == noDict */
-                 const BYTE* const dictStart,  /* only if dict==usingExtDict */
+                 const BYTE* const dictStart,  /* only if dict == usingExtDict */
                  const size_t dictSize         /* note : = 0 if noDict */
                  )
 {
@@ -124,15 +124,15 @@
     const unsigned dec32table[] = {4, 1, 2, 1, 4, 4, 4, 4};
     const int dec64table[] = {0, 0, 0, -1, 0, 1, 2, 3};
 
-    const int safeDecode = (endOnInput==endOnInputSize);
+    const int safeDecode = (endOnInput == endOnInputSize);
     const int checkOffset = ((safeDecode) && (dictSize < (int)(64 KB)));
     const int inPlaceDecode = ((ip >= op) && (ip < oend));
 
 
     /* Special cases */
     if ((partialDecoding) && (oexit> oend-MFLIMIT)) oexit = oend-MFLIMIT;                         /* targetOutputSize too high => decode everything */
-    if ((endOnInput) && (unlikely(outputSize==0))) return ((inputSize==1) && (*ip==0)) ? 0 : -1;  /* Empty output buffer */
-    if ((!endOnInput) && (unlikely(outputSize==0))) return (*ip==0?1:-1);
+    if ((endOnInput) && (unlikely(outputSize == 0))) return ((inputSize == 1) && (*ip == 0)) ? 0 : -1;  /* Empty output buffer */
+    if ((!endOnInput) && (unlikely(outputSize == 0))) return (*ip == 0?1:-1);
 
 
     /* Main Loop */
@@ -155,7 +155,7 @@
                 s = *ip++;
                 length += s;
             }
-            while ( likely(endOnInput ? ip<iend-RUN_MASK : 1) && (s==255) );
+            while ( likely(endOnInput ? ip<iend-RUN_MASK : 1) && (s == 255) );
             if ((safeDecode) && unlikely((size_t)(op+length)<(size_t)(op))) goto _output_error;   /* overflow detection */
             if ((safeDecode) && unlikely((size_t)(ip+length)<(size_t)(ip))) goto _output_error;   /* overflow detection */
         }
@@ -198,13 +198,13 @@
                 if ((endOnInput) && (ip > iend-LASTLITERALS)) goto _output_error;
                 s = *ip++;
                 length += s;
-            } while (s==255);
+            } while (s == 255);
             if ((safeDecode) && unlikely((size_t)(op+length)<(size_t)op)) goto _output_error;   /* overflow detection */
         }
         length += MINMATCH;
 
         /* check external dictionary */
-        if ((dict==usingExtDict) && (match < lowPrefix))
+        if ((dict == usingExtDict) && (match < lowPrefix))
         {
             if (unlikely(op+length > oend-LASTLITERALS)) goto _output_error;   /* doesn't respect parsing restriction */
 

-- 
To view, visit https://review.coreboot.org/25856
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie1da925aceb01c2d21b472bf171000803004578f
Gerrit-Change-Number: 25856
Gerrit-PatchSet: 1
Gerrit-Owner: Elyes HAOUAS <ehaouas at noos.fr>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20180426/c4f08293/attachment-0001.html>


More information about the coreboot-gerrit mailing list