1. Apr 25, 2020
  2. Apr 24, 2020
  3. Apr 23, 2020
  4. Apr 22, 2020
  5. Apr 21, 2020
  6. Apr 20, 2020
    • Damian Wrobel's avatar
      Fix -Wstringop-truncation warnings · 63e8e8f6
      Damian Wrobel authored
      
      
      Fixes the following warnings:
      In function 'strncpy',
          inlined from 'spi_boards_scan' at spi_boards.c:203:9:
      /usr/include/bits/string_fortified.h:106:10: warning: '__builtin_strncpy'
      output truncated before terminating nul copying 4 bytes
      from a string of the same length [-Wstringop-truncation]
        106 |   return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
      
      In file included from /usr/include/string.h:495,
                       from pci_boards.c:34:
      In function ‘strncpy’,
          inlined from ‘pci_boards_scan’ at pci_boards.c:1281:21:
      /usr/include/bits/string_fortified.h:106:10: warning: ‘__builtin_strncpy’
      output truncated before terminating nul copying 4 bytes from a string of
      the same length [-Wstringop-truncation]
        106 |   return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
            |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      In function ‘strncpy’,
          inlined from ‘pci_boards_scan’ at pci_boards.c:1240:21:
      /usr/include/bits/string_fortified.h:106:10: warning: ‘__builtin_strncpy’
      output truncated before terminating nul copying 4 bytes from a string of
      the same length [-Wstringop-truncation]
        106 |   return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
            |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      In function ‘strncpy’,
          inlined from ‘pci_boards_scan’ at pci_boards.c:1205:21:
      /usr/include/bits/string_fortified.h:106:10: warning: ‘__builtin_strncpy’
      output truncated before terminating nul copying 4 bytes from a string of
      the same length [-Wstringop-truncation]
        106 |   return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
            |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      In function ‘strncpy’,
          inlined from ‘pci_boards_scan’ at pci_boards.c:1177:21:
      /usr/include/bits/string_fortified.h:106:10: warning: ‘__builtin_strncpy’
      output truncated before terminating nul copying 4 bytes from a string of
      the same length [-Wstringop-truncation]
        106 |   return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
            |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      In function ‘strncpy’,
          inlined from ‘pci_boards_scan’ at pci_boards.c:1144:21:
      /usr/include/bits/string_fortified.h:106:10: warning: ‘__builtin_strncpy’
      output truncated before terminating nul copying 4 bytes from a string of
      the same length [-Wstringop-truncation]
        106 |   return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
            |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      In function ‘strncpy’,
          inlined from ‘pci_boards_scan’ at pci_boards.c:1117:21:
      /usr/include/bits/string_fortified.h:106:10: warning: ‘__builtin_strncpy’
      output truncated before terminating nul copying 4 bytes from a string of
      the same length [-Wstringop-truncation]
        106 |   return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
            |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      In function ‘strncpy’,
          inlined from ‘pci_boards_scan’ at pci_boards.c:1089:21:
      /usr/include/bits/string_fortified.h:106:10: warning: ‘__builtin_strncpy’
      output truncated before terminating nul copying 4 bytes from a string of
      the same length [-Wstringop-truncation]
        106 |   return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
            |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      In function ‘strncpy’,
          inlined from ‘pci_boards_scan’ at pci_boards.c:1056:21:
      /usr/include/bits/string_fortified.h:106:10: warning: ‘__builtin_strncpy’
      output truncated before terminating nul copying 4 bytes from a string of
      the same length [-Wstringop-truncation]
        106 |   return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
            |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      In function ‘strncpy’,
          inlined from ‘pci_boards_scan’ at pci_boards.c:1026:21:
      /usr/include/bits/string_fortified.h:106:10: warning: ‘__builtin_strncpy’
      output truncated before terminating nul copying 4 bytes from a string of
      the same length [-Wstringop-truncation]
        106 |   return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
            |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      In function ‘strncpy’,
          inlined from ‘pci_boards_scan’ at pci_boards.c:995:17:
      /usr/include/bits/string_fortified.h:106:10: warning: ‘__builtin_strncpy’
      output truncated before terminating nul copying 4 bytes from a string of
      the same length [-Wstringop-truncation]
        106 |   return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
            |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      In function ‘strncpy’,
          inlined from ‘pci_boards_scan’ at pci_boards.c:967:17:
      /usr/include/bits/string_fortified.h:106:10: warning: ‘__builtin_strncpy’
      output truncated before terminating nul copying 4 bytes from a string of
      the same length [-Wstringop-truncation]
        106 |   return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
            |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      In function ‘strncpy’,
          inlined from ‘pci_boards_scan’ at pci_boards.c:940:17:
      /usr/include/bits/string_fortified.h:106:10: warning: ‘__builtin_strncpy’
      output truncated before terminating nul copying 4 bytes from a string of
      the same length [-Wstringop-truncation]
        106 |   return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
            |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      In function ‘strncpy’,
          inlined from ‘pci_boards_scan’ at pci_boards.c:912:17:
      /usr/include/bits/string_fortified.h:106:10: warning: ‘__builtin_strncpy’
      output truncated before terminating nul copying 4 bytes from a string of
      the same length [-Wstringop-truncation]
        106 |   return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
            |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      In function ‘strncpy’,
          inlined from ‘pci_boards_scan’ at pci_boards.c:885:17:
      /usr/include/bits/string_fortified.h:106:10: warning: ‘__builtin_strncpy’
      output truncated before terminating nul copying 4 bytes from a string of
      the same length [-Wstringop-truncation]
        106 |   return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
            |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      In function ‘strncpy’,
          inlined from ‘pci_boards_scan’ at pci_boards.c:851:17:
      /usr/include/bits/string_fortified.h:106:10: warning: ‘__builtin_strncpy’
      output truncated before terminating nul copying 14 bytes from a string of
      the same length [-Wstringop-truncation]
        106 |   return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
            |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      
      In file included from /usr/include/string.h:495,
                       from usb_boards.c:21:
      In function ‘strncpy’,
          inlined from ‘usb_boards_scan’ at usb_boards.c:188:9:
      /usr/include/bits/string_fortified.h:106:10: warning: ‘__builtin_strncpy’
      output truncated before terminating nul copying 4 bytes from a string of
      the same length [-Wstringop-truncation]
        106 |   return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
            |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      In function ‘strncpy’,
          inlined from ‘usb_boards_scan’ at usb_boards.c:147:13:
      /usr/include/bits/string_fortified.h:106:10: warning: ‘__builtin_strncpy’
      output truncated before terminating nul copying 4 bytes from a string of
      the same length [-Wstringop-truncation]
        106 |   return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
            |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      
      In function ‘strncpy’,
          inlined from ‘eth_scan_one_addr’ at eth_boards.c:329:13,
          inlined from ‘eth_scan_one_addr.isra.0’ at eth_boards.c:136:12:
      /usr/include/bits/string_fortified.h:106:10: warning: ‘__builtin_strncpy’ output
      may be truncated copying 16 bytes from a string of length 19 [-Wstringop-truncation]
        106 |   return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
            |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      In function ‘strncpy’,
          inlined from ‘eth_scan_one_addr’ at eth_boards.c:306:13,
          inlined from ‘eth_scan_one_addr.isra.0’ at eth_boards.c:136:12:
      /usr/include/bits/string_fortified.h:106:10: warning: ‘__builtin_strncpy’ output
      may be truncated copying 16 bytes from a string of length 19 [-Wstringop-truncation]
        106 |   return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
            |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      In function ‘strncpy’,
          inlined from ‘eth_scan_one_addr’ at eth_boards.c:283:13,
          inlined from ‘eth_scan_one_addr.isra.0’ at eth_boards.c:136:12:
      /usr/include/bits/string_fortified.h:106:10: warning: ‘__builtin_strncpy’ output
      may be truncated copying 16 bytes from a string of length 19 [-Wstringop-truncation]
        106 |   return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
            |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      In function ‘strncpy’,
          inlined from ‘eth_scan_one_addr’ at eth_boards.c:259:13,
          inlined from ‘eth_scan_one_addr.isra.0’ at eth_boards.c:136:12:
      /usr/include/bits/string_fortified.h:106:10: warning: ‘__builtin_strncpy’ output
      may be truncated copying 16 bytes from a string of length 19 [-Wstringop-truncation]
        106 |   return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
            |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      In function ‘strncpy’,
          inlined from ‘eth_scan_one_addr’ at eth_boards.c:235:13,
          inlined from ‘eth_scan_one_addr.isra.0’ at eth_boards.c:136:12:
      /usr/include/bits/string_fortified.h:106:10: warning: ‘__builtin_strncpy’ output
      may be truncated copying 16 bytes from a string of length 19 [-Wstringop-truncation]
        106 |   return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
            |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      In function ‘strncpy’,
          inlined from ‘eth_scan_one_addr’ at eth_boards.c:211:13,
          inlined from ‘eth_scan_one_addr.isra.0’ at eth_boards.c:136:12:
      /usr/include/bits/string_fortified.h:106:10: warning: ‘__builtin_strncpy’ output
      may be truncated copying 16 bytes from a string of length 19 [-Wstringop-truncation]
        106 |   return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
            |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      In function ‘strncpy’,
          inlined from ‘eth_scan_one_addr’ at eth_boards.c:186:13,
          inlined from ‘eth_scan_one_addr.isra.0’ at eth_boards.c:136:12:
      /usr/include/bits/string_fortified.h:106:10: warning: ‘__builtin_strncpy’ output
      may be truncated copying 16 bytes from a string of length 19 [-Wstringop-truncation]
        106 |   return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
            |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      In function ‘strncpy’,
          inlined from ‘eth_scan_one_addr’ at eth_boards.c:161:13,
          inlined from ‘eth_scan_one_addr.isra.0’ at eth_boards.c:136:12:
      /usr/include/bits/string_fortified.h:106:10: warning: ‘__builtin_strncpy’ output
      may be truncated copying 16 bytes from a string of length 19 [-Wstringop-truncation]
        106 |   return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
            |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      
      Signed-off-by: default avatarDamian Wrobel <dwrobel@ertelnet.rybnik.pl>
      63e8e8f6
    • Damian Wrobel's avatar
      Fix linking errors · 889ab134
      Damian Wrobel authored
      
      
      Fixes the following linking errors on gcc 10:
      /usr/bin/ld: libanyio.a(spi_boards.o):spi_boards.c:41:
       multiple definition of `sd';
       libanyio.a(eth_boards.o):eth_boards.c:49: first defined here
      /usr/bin/ld: libanyio.a(serial_boards.o):serial_boards.c:38:
       multiple definition of `sd';
       libanyio.a(eth_boards.o):eth_boards.c:49: first defined here
      /usr/bin/ld: libanyio.a(lbp.o):mesaflash/lbp.c:31:
       multiple definition of `sd';
       libanyio.a(eth_boards.o):eth_boards.c:49: first defined here
      
      Signed-off-by: default avatarDamian Wrobel <dwrobel@ertelnet.rybnik.pl>
      889ab134
    • Damian Wrobel's avatar
      Fix compilation errors · 803a5695
      Damian Wrobel authored
      
      
      Fixes the following compilation errors:
      examples/pci_encoder_read.c:33:19: error: unknown type name ‘useconds_t’; did you mean ‘suseconds_t’?
         33 | extern int usleep(useconds_t usec); // static global access variable conflicts with POSIX function in unistd.h
            |                   ^~~~~~~~~~
            |                   suseconds_t
      examples/pci_encoder_read.c: In function ‘main’:
      examples/pci_encoder_read.c:171:9: warning: implicit declaration of function ‘usleep’ [-Wimplicit-function-declaration]
        171 |         usleep(delay*1000);             // wait delay ms
            |         ^~~~~~
      
      examples/pci_encoder_read.c:40:23: error: ‘access’ redeclared as different kind of symbol
         40 | static board_access_t access;
            |                       ^~~~~~
      In file included from examples/pci_encoder_read.c:29:
      /usr/include/unistd.h:287:12: note: previous declaration of ‘access’ was here
        287 | extern int access (const char *__name, int __type) __THROW __nonnull ((1));
            |            ^~~~~~
      
      examples/pci_analog_write.c:33:19: error: unknown type name ‘useconds_t’; did you mean ‘suseconds_t’?
         33 | extern int usleep(useconds_t usec); // static global access variable conflicts with POSIX function in unistd.h
            |                   ^~~~~~~~~~
            |                   suseconds_t
      
      examples/pci_analog_write.c:40:23: error: ‘access’ redeclared as different kind of symbol
         40 | static board_access_t access;
            |                       ^~~~~~
      In file included from examples/pci_analog_write.c:29:
      /usr/include/unistd.h:287:12: note: previous declaration of ‘access’ was here
        287 | extern int access (const char *__name, int __type) __THROW __nonnull ((1));
            |            ^~~~~~
      
      Signed-off-by: default avatarDamian Wrobel <dwrobel@ertelnet.rybnik.pl>
      803a5695
    • Damian Wrobel's avatar
      Fix -Wformat warning · 260be11c
      Damian Wrobel authored
      
      
      Fixes:
       pi_boards.c:190:56: warning: format '%x' expects argument of type
       'unsigned int', but argument 4 has type 'long unsigned int' [-Wformat=]
         190 |         fprintf(stderr, "Unexpected cookie at %04x..%04x:\n%08x %08x %08x\n",
             |                                                     ~~~^
             |                                                        |
             |                                                        unsigned int
             |                                                     %04lx
      
      Signed-off-by: default avatarDamian Wrobel <dwrobel@ertelnet.rybnik.pl>
      260be11c
    • Damian Wrobel's avatar
      Fix misleading indentation warnings · 9d6374af
      Damian Wrobel authored
      
      
      Fixes the following warnings:
      
       lbp.c: In function 'lbp_send':
       lbp.c:43:5: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
          43 |     if (LBP_SENDRECV_DEBUG)
             |     ^~
       lbp.c:45:2: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
          45 |  return send;
             |  ^~~~~~
       lbp.c: In function 'lbp_recv':
       lbp.c:55:5: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
          55 |     if (LBP_SENDRECV_DEBUG)
             |     ^~
       lbp.c:57:2: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
          57 |  return recv;
             |  ^~~~~~
      
      Signed-off-by: default avatarDamian Wrobel <dwrobel@ertelnet.rybnik.pl>
      9d6374af
    • Damian Wrobel's avatar
      Make packaging easier · 454e45a0
      Damian Wrobel authored
      
      
      Improves a few things to make it easier to package mesaflash
      e.g. as an rpm package:
      
       - Allows to honor CFLAGS passed from command line,
       - Do not need to run make install from 'root' user,
       - Do not hardcode include directory,
       - Use pkg-config to determine compiler options for using libcpi.
      
      As this change is fully backward compatible in order to use new
      features it is needed to set the followings variables:
        - CFLAGS - usually done by linux distribution,
        - DEBUG - set to empty as CFLAGS should contain everything needed,
        - OWNERSHIP - set to empty - (e.g. rpm will set it correctly for you).
      
      Example:
       $ CFLAGS="distribution specific list of options" DEBUG="" OWNERSHIP="" make
      
      Signed-off-by: default avatarDamian Wrobel <dwrobel@ertelnet.rybnik.pl>
      454e45a0
    • Damian Wrobel's avatar
      Add GPL license text file · fee7da3c
      Damian Wrobel authored
      Add missing license text file which is needed to package mesaflash
      for Fedora linux distribution.
      
      The following command was used to obtain the license text file:
       $ wget -O COPYING https://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
      
      
      
      Signed-off-by: default avatarDamian Wrobel <dwrobel@ertelnet.rybnik.pl>
      fee7da3c
  7. Apr 15, 2020
  8. Sep 15, 2019
  9. Jun 10, 2018