ramips: fix USW-Flex reversed switch-port order
[openwrt/staging/mkresin.git] / tools / firmware-utils / src / mkchkimg.c
index 5f2823f154837d3370b065aca1cf40c7dad728d6..b51eca9369810226bd5edeebe0ba77e128441d51 100644 (file)
@@ -1,23 +1,10 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  *     Make CHK Image
  *
  *     This utility creates Netgear .chk files.
  *
  *     Copyright (C) 2008 Dave C. Reeve <Dave.Reeve@dreeve.org>
- *
- *     This program is free software; you can redistribute it and/or modify
- *     it under the terms of the GNU General Public License as published by
- *     the Free Software Foundation; either version 2 of the License, or
- *     (at your option) any later version.
- *
- *     This program is distributed in the hope that it will be useful,
- *     but WITHOUT ANY WARRANTY; without even the implied warranty of
- *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *     GNU General Public License for more details.
- *     
- *     You should have received a copy of the GNU General Public License along
- *     with this program; if not, write to the Free Software Foundation, Inc.,
- *     51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 #include <stdio.h>
 #include <stdlib.h>
@@ -264,13 +251,8 @@ main (int argc, char * argv[])
        hdr->magic = htonl (0x2a23245e);
        hdr->header_len = htonl(header_len);
        hdr->reserved[0] = (unsigned char)(region & 0xff);
-       hdr->reserved[1] = 1;           /* Major */
-       hdr->reserved[2] = 1;           /* Minor */
-       hdr->reserved[3] = 99;          /* Build */
-       hdr->reserved[4] = 0;
-       hdr->reserved[5] = 0;
-       hdr->reserved[6] = 0;
-       hdr->reserved[7] = 0;
+       memset(&hdr->reserved[1], 99, sizeof(hdr->reserved) - 1);
+
        message ("       Board Id: %s", board_id);
        message ("         Region: %s", region == 1 ? "World Wide (WW)" 
                        : (region == 2 ? "North America (NA)" : "Unknown"));