Replace all tabs with proper whitespace

This change removes all tabs and replaces them with proper whitespaces
for everywhere that the previous clang-format could not fix. This is
done manually without any automatic tools.

Also replaces the LICENSE file to [1] which has a better formatting.

[1] - https://www.gnu.org/licenses/old-licenses/gpl-2.0.txt

BUG=chromium:886953
TEST=repo upload passes
TEST=CQ passes

Change-Id: I329d332e8bf40ba757df5bd86e1cc1192d71bbb3
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/dm-verity/+/2353061
Tested-by: Amin Hassani <ahassani@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Jorge Lucangeli Obes <jorgelo@chromium.org>
diff --git a/LICENSE b/LICENSE
index 10828e0..d159169 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,13 +1,12 @@
+                    GNU GENERAL PUBLIC LICENSE
+                       Version 2, June 1991
 
-		    GNU GENERAL PUBLIC LICENSE
-		       Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
-                       51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  Everyone is permitted to copy and distribute verbatim copies
  of this license document, but changing it is not allowed.
 
-			    Preamble
+                            Preamble
 
   The licenses for most software are designed to take away your
 freedom to share and change it.  By contrast, the GNU General Public
@@ -16,7 +15,7 @@
 General Public License applies to most of the Free Software
 Foundation's software and to any other program whose authors commit to
 using it.  (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.)  You can apply it to
+the GNU Lesser General Public License instead.)  You can apply it to
 your programs, too.
 
   When we speak of free software, we are referring to freedom, not
@@ -56,8 +55,8 @@
 
   The precise terms and conditions for copying, distribution and
 modification follow.
-
-		    GNU GENERAL PUBLIC LICENSE
+
+                    GNU GENERAL PUBLIC LICENSE
    TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
 
   0. This License applies to any program or other work which contains
@@ -111,7 +110,7 @@
     License.  (Exception: if the Program itself is interactive but
     does not normally print such an announcement, your work based on
     the Program is not required to print an announcement.)
-
+
 These requirements apply to the modified work as a whole.  If
 identifiable sections of that work are not derived from the Program,
 and can be reasonably considered independent and separate works in
@@ -169,7 +168,7 @@
 access to copy the source code from the same place counts as
 distribution of the source code, even though third parties are not
 compelled to copy the source along with the object code.
-
+
   4. You may not copy, modify, sublicense, or distribute the Program
 except as expressly provided under this License.  Any attempt
 otherwise to copy, modify, sublicense or distribute the Program is
@@ -226,7 +225,7 @@
 
 This section is intended to make thoroughly clear what is believed to
 be a consequence of the rest of this License.
-
+
   8. If the distribution and/or use of the Program is restricted in
 certain countries either by patents or by copyrighted interfaces, the
 original copyright holder who places the Program under this License
@@ -256,7 +255,7 @@
 of preserving the free status of all derivatives of our free software and
 of promoting the sharing and reuse of software generally.
 
-			    NO WARRANTY
+                            NO WARRANTY
 
   11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
 FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
@@ -278,9 +277,9 @@
 PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
 POSSIBILITY OF SUCH DAMAGES.
 
-		     END OF TERMS AND CONDITIONS
-
-	    How to Apply These Terms to Your New Programs
+                     END OF TERMS AND CONDITIONS
+
+            How to Apply These Terms to Your New Programs
 
   If you develop a new program, and you want it to be of the greatest
 possible use to the public, the best way to achieve this is to make it
@@ -304,10 +303,9 @@
     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 St, Fifth Floor, Boston, MA  02110-1301  USA
-
+    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.
 
 Also add information on how to contact you by electronic and paper mail.
 
@@ -337,5 +335,5 @@
 This General Public License does not permit incorporating your program into
 proprietary programs.  If your program is a subroutine library, you may
 consider it more useful to permit linking proprietary applications with the
-library.  If this is what you want to do, use the GNU Library General
+library.  If this is what you want to do, use the GNU Lesser General
 Public License instead of this License.
diff --git a/dm-bht-userspace.c b/dm-bht-userspace.c
index bb0e74a..6cad109 100644
--- a/dm-bht-userspace.c
+++ b/dm-bht-userspace.c
@@ -65,7 +65,7 @@
 
 /**
  * dm_bht_compute - computes and updates all non-block-level hashes in a tree
- * @bht:	pointer to a dm_bht_create()d bht
+ * @bht: pointer to a dm_bht_create()d bht
  *
  * Returns 0 on success, >0 when data is pending, and <0 when a IO or other
  * error has occurred.
@@ -114,9 +114,9 @@
 
 /**
  * dm_bht_store_block - sets a given block's hash in the tree
- * @bht:	pointer to a dm_bht_create()d bht
- * @block:	numeric index of the block in the tree
- * @block_data:	array of u8s containing the block of data to hash
+ * @bht: pointer to a dm_bht_create()d bht
+ * @block: numeric index of the block in the tree
+ * @block_data: array of u8s containing the block of data to hash
  *
  * Returns 0 on success.
  *
diff --git a/dm-bht.c b/dm-bht.c
index 7d339e0..b604c68 100644
--- a/dm-bht.c
+++ b/dm-bht.c
@@ -58,8 +58,8 @@
 
 /**
  * dm_bht_bin_to_hex - converts a binary stream to human-readable hex
- * @binary:	a byte array of length @binary_len
- * @hex:	a byte array of length @binary_len * 2 + 1
+ * @binary: a byte array of length @binary_len
+ * @hex: a byte array of length @binary_len * 2 + 1
  */
 static void dm_bht_bin_to_hex(u8* binary, u8* hex, unsigned int binary_len) {
   while (binary_len-- > 0) {
@@ -71,8 +71,8 @@
 
 /**
  * dm_bht_hex_to_bin - converts a hex stream to binary
- * @binary:	a byte array of length @binary_len
- * @hex:	a byte array of length @binary_len * 2 + 1
+ * @binary: a byte array of length @binary_len
+ * @hex: a byte array of length @binary_len * 2 + 1
  */
 static void dm_bht_hex_to_bin(u8* binary,
                               const u8* hex,
@@ -141,10 +141,10 @@
 
 /**
  * dm_bht_create - prepares @bht for us
- * @bht:	pointer to a dm_bht_create()d bht
- * @depth:	tree depth without the root; including block hashes
+ * @bht: pointer to a dm_bht_create()d bht
+ * @depth: tree depth without the root; including block hashes
  * @block_count:the number of block hashes / tree leaves
- * @alg_name:	crypto hash algorithm name
+ * @alg_name: crypto hash algorithm name
  *
  * Returns 0 on success.
  *
@@ -335,8 +335,8 @@
 
 /**
  * dm_bht_read_completed
- * @entry:	pointer to the entry that's been loaded
- * @status:	I/O status. Non-zero is failure.
+ * @entry: pointer to the entry that's been loaded
+ * @status: I/O status. Non-zero is failure.
  * MUST always be called after a read_cb completes.
  */
 void dm_bht_read_completed(struct dm_bht_entry* entry, int status) {
@@ -411,10 +411,10 @@
 
 /**
  * dm_bht_zeroread_callback - read callback which always returns 0s
- * @ctx:	ignored
- * @start:	ignored
- * @data:	buffer to write 0s to
- * @count:	number of sectors worth of data to write
+ * @ctx: ignored
+ * @start: ignored
+ * @data: buffer to write 0s to
+ * @count: number of sectors worth of data to write
  * @complete_ctx: opaque context for @completed
  * @completed: callback to confirm end of data read
  *
@@ -436,8 +436,8 @@
 /**
  * dm_bht_is_populated - check that entries from disk needed to verify a given
  *                       block are all ready
- * @bht:	pointer to a dm_bht_create()d bht
- * @block:	specific block data is expected from
+ * @bht: pointer to a dm_bht_create()d bht
+ * @block: specific block data is expected from
  *
  * Callers may wish to call dm_bht_is_populated() when checking an io
  * for which entries were already pending.
@@ -456,9 +456,9 @@
 
 /**
  * dm_bht_populate - reads entries from disk needed to verify a given block
- * @bht:	pointer to a dm_bht_create()d bht
- * @ctx:        context used for all read_cb calls on this request
- * @block:	specific block data is expected from
+ * @bht: pointer to a dm_bht_create()d bht
+ * @ctx: context used for all read_cb calls on this request
+ * @block: specific block data is expected from
  *
  * Returns negative value on error. Returns 0 on success.
  */
@@ -517,10 +517,10 @@
 
 /**
  * dm_bht_verify_block - checks that all nodes in the path for @block are valid
- * @bht:	pointer to a dm_bht_create()d bht
- * @block:	specific block data is expected from
- * @buffer:	page holding the block data
- * @offset:	offset into the page
+ * @bht: pointer to a dm_bht_create()d bht
+ * @block: specific block data is expected from
+ * @buffer: page holding the block data
+ * @offset: offset into the page
  *
  * Returns 0 on success, 1 on missing data, and a negative error
  * code on verification failure. All supporting functions called
@@ -537,7 +537,7 @@
 
 /**
  * dm_bht_destroy - cleans up all memory used by @bht
- * @bht:	pointer to a dm_bht_create()d bht
+ * @bht: pointer to a dm_bht_create()d bht
  *
  * Returns 0 on success. Does not free @bht itself.
  */
@@ -580,7 +580,7 @@
 
 /**
  * dm_bht_sectors - return the sectors required on disk
- * @bht:	pointer to a dm_bht_create()d bht
+ * @bht: pointer to a dm_bht_create()d bht
  */
 sector_t dm_bht_sectors(const struct dm_bht* bht) {
   return bht->sectors;
@@ -588,8 +588,8 @@
 
 /**
  * dm_bht_set_read_cb - set read callback
- * @bht:	pointer to a dm_bht_create()d bht
- * @read_cb:	callback function used for all read requests by @bht
+ * @bht: pointer to a dm_bht_create()d bht
+ * @read_cb: callback function used for all read requests by @bht
  */
 void dm_bht_set_read_cb(struct dm_bht* bht, dm_bht_callback read_cb) {
   bht->read_cb = read_cb;
@@ -597,8 +597,8 @@
 
 /**
  * dm_bht_set_root_hexdigest - sets an unverified root digest hash from hex
- * @bht:	pointer to a dm_bht_create()d bht
- * @hexdigest:	array of u8s containing the new digest in binary
+ * @bht: pointer to a dm_bht_create()d bht
+ * @hexdigest: array of u8s containing the new digest in binary
  * Returns non-zero on error.  hexdigest should be NUL terminated.
  */
 int dm_bht_set_root_hexdigest(struct dm_bht* bht, const u8* hexdigest) {
@@ -617,9 +617,9 @@
 
 /**
  * dm_bht_root_hexdigest - returns root digest in hex
- * @bht:	pointer to a dm_bht_create()d bht
- * @hexdigest:	u8 array of size @available
- * @available:	must be bht->digest_size * 2 + 1
+ * @bht: pointer to a dm_bht_create()d bht
+ * @hexdigest: u8 array of size @available
+ * @available: must be bht->digest_size * 2 + 1
  */
 int dm_bht_root_hexdigest(struct dm_bht* bht, u8* hexdigest, int available) {
   if (available < 0 || ((unsigned int)available) < bht->digest_size * 2 + 1) {
@@ -632,8 +632,8 @@
 
 /**
  * dm_bht_set_salt - sets the salt used, in hex
- * @bht:      pointer to a dm_bht_create()d bht
- * @hexsalt:  salt string, as hex; will be zero-padded or truncated to
+ * @bht: pointer to a dm_bht_create()d bht
+ * @hexsalt: salt string, as hex; will be zero-padded or truncated to
  *            DM_BHT_SALT_SIZE * 2 hex digits.
  */
 void dm_bht_set_salt(struct dm_bht* bht, const char* hexsalt) {
@@ -645,8 +645,8 @@
 
 /**
  * dm_bht_salt - returns the salt used, in hex
- * @bht:      pointer to a dm_bht_create()d bht
- * @hexsalt:  buffer to put salt into, of length DM_BHT_SALT_SIZE * 2 + 1.
+ * @bht: pointer to a dm_bht_create()d bht
+ * @hexsalt: buffer to put salt into, of length DM_BHT_SALT_SIZE * 2 + 1.
  */
 int dm_bht_salt(struct dm_bht* bht, char* hexsalt) {
   if (!bht->have_salt)