libftdi-git Archives

Subject: A library to talk to FTDI chips branch, master, updated. v1.5-3-g6dd1812

From: libftdi-git@xxxxxxxxxxxxxxxxxxxxxxx
To: libftdi-git@xxxxxxxxxxxxxxxxxxxxxxx
Date: Mon, 24 Aug 2020 19:25:33 +0200 (CEST)
The branch, master has been updated
       via  6dd18122a81e6030dd239391df6ffde8cb8c59c7 (commit)
      from  7c5aa3b8c0fe0862886c7202cc1e2e44434ea4de (commit)


- Log -----------------------------------------------------------------
commit 6dd18122a81e6030dd239391df6ffde8cb8c59c7
Author: Uwe Bonnes <bon@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
Date:   Fri Jul 31 11:00:50 2020 +0200

    Fix GCC fall-through warnings.
    
    When compiling ftdi.c in the context of blackmagic debug, more enabled
    warnings and -Werror made me to add appended fixes.
    
    Fixing the signedness of baudrate would probably be more logically by
    making all baudrate and clk unsigned, but would need more code changes.
    I decided to make clk signed as a fix with minimal
    impact. The FTDI chips are far away from 2 GHz clock rate...

-----------------------------------------------------------------------

Summary of changes:
 src/ftdi.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/src/ftdi.c b/src/ftdi.c
index f5b7018..03d7b07 100644
--- a/src/ftdi.c
+++ b/src/ftdi.c
@@ -1328,7 +1328,7 @@ static int ftdi_to_clkbits_AM(int baudrate, unsigned long 
*encoded_divisor)
    AM Type chips have only four fractional subdivisors at value[15:14]
    for subdivisors 0, 0.5, 0.25, 0.125
 */
-static int ftdi_to_clkbits(int baudrate, unsigned int clk, int clk_div, 
unsigned long *encoded_divisor)
+static int ftdi_to_clkbits(int baudrate, int clk, int clk_div, unsigned long 
*encoded_divisor)
 {
     static const char frac_code[8] = {0, 3, 2, 4, 1, 5, 6, 7};
     int best_baud = 0;
@@ -3044,10 +3044,13 @@ int ftdi_eeprom_build(struct ftdi_context *ftdi)
         case TYPE_2232H:
         case TYPE_4232H:
             i += 2;
+                       /* Fall through*/
         case TYPE_R:
             i += 2;
+                       /* Fall through*/
         case TYPE_2232C:
             i += 2;
+                       /* Fall through*/
         case TYPE_AM:
         case TYPE_BM:
             i += 0x94;
@@ -3438,15 +3441,20 @@ int ftdi_eeprom_build(struct ftdi_context *ftdi)
     {
         case TYPE_230X:
             free_start += 2;
+                       /* Fall through*/
         case TYPE_232H:
             free_start += 6;
+                       /* Fall through*/
         case TYPE_2232H:
         case TYPE_4232H:
             free_start += 2;
+                       /* Fall through*/
         case TYPE_R:
             free_start += 2;
+                       /* Fall through*/
         case TYPE_2232C:
             free_start++;
+                       /* Fall through*/
         case TYPE_AM:
         case TYPE_BM:
             free_start += 0x14;


hooks/post-receive
-- 
A library to talk to FTDI chips

--
libftdi-git - see http://www.intra2net.com/en/developer/libftdi for details.
To unsubscribe send a mail to libftdi-git+unsubscribe@xxxxxxxxxxxxxxxxxxxxxxx   

Current Thread
  • A library to talk to FTDI chips branch, master, updated. v1.5-3-g6dd1812, libftdi-git <=