docs: Fix spelling mistakes

Change-Id: I8a68156d785a260fa334766337d4626ff28aec6a
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/39920
Pigweed-Auto-Submit: Ali Zhang <alizhang@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
Reviewed-by: Keir Mierle <keir@google.com>
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 2571c60..d9e325f 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -29,7 +29,7 @@
  1. Address any reviewer feedback by amending the commit (`git commit --amend`).
  1. Submit change to CI builders to merge. If you are not part of Pigweed's
     core team, you can ask the reviewer to add the `+2 CQ` vote, which will
-    trigger a rebase asd submit once the builders pass.
+    trigger a rebase and submit once the builders pass.
 
 ## Contributor License Agreement
 
diff --git a/docs/build_system.rst b/docs/build_system.rst
index 0b4c395..59c638b 100644
--- a/docs/build_system.rst
+++ b/docs/build_system.rst
@@ -391,7 +391,7 @@
 
 Module variables
 ----------------
-As Pigweed is inteded to be a subcomponent of a larger project, it cannot assume
+As Pigweed is intended to be a subcomponent of a larger project, it cannot assume
 where it or its modules is located. Therefore, Pigweed's upstream BUILD.gn files
 do not use absolute paths; instead, variables are defined pointing to each of
 Pigweed's modules, set relative to a project-specific ``dir_pigweed``.
@@ -409,7 +409,7 @@
 
 GN target type wrappers
 -----------------------
-To faciliate injecting global configuration options, Pigweed defines wrappers
+To facilitate injecting global configuration options, Pigweed defines wrappers
 around builtin GN target types such as ``source_set`` and ``executable``. These
 are defined within ``$dir_pw_build/target_types.gni``.
 
diff --git a/docs/embedded_cpp_guide.rst b/docs/embedded_cpp_guide.rst
index 8b8ca0a..4417d06 100644
--- a/docs/embedded_cpp_guide.rst
+++ b/docs/embedded_cpp_guide.rst
@@ -73,7 +73,7 @@
       return min;
     }
     if (value > max) {
-      return min;
+      return max;
     }
     return value;
   }
diff --git a/docs/module_structure.rst b/docs/module_structure.rst
index 7334b53..17d3a07 100644
--- a/docs/module_structure.rst
+++ b/docs/module_structure.rst
@@ -375,7 +375,7 @@
 .. caution::
 
   Modules should only use facades when necessary. Facades are permanently locked
-  to a particular implementation at compile time. Multpile backends cannot be
+  to a particular implementation at compile time. Multiple backends cannot be
   used in one build, and runtime dependency injection is not possible, which
   makes testing difficult. Where appropriate, modules should use other
   mechanisms, such as virtual interfaces, callbacks, or templates, in place of
diff --git a/docs/style_guide.rst b/docs/style_guide.rst
index 3d04581..e05bde9 100644
--- a/docs/style_guide.rst
+++ b/docs/style_guide.rst
@@ -163,7 +163,7 @@
 
 Comments
 ========
-Prefer C++-style (``//``) comments over C-style commments (``/* */``). C-style
+Prefer C++-style (``//``) comments over C-style comments (``/* */``). C-style
 comments should only be used for inline comments.
 
 .. code-block:: cpp
@@ -552,11 +552,11 @@
 
 Each Pigweed source module will require a build file named BUILD.gn which
 encapsulates the build targets and specifies their sources and dependencies.
-The format of this file is simlar in structure to the
+The format of this file is similar in structure to the
 `Bazel/Blaze format <https://docs.bazel.build/versions/3.2.0/build-ref.html>`_
 (Googlers may also review `go/build-style <go/build-style>`_), but with
 nomenclature specific to Pigweed. For each target specified within the build
-file there are a list of depdency fields. Those fields, in their expected
+file there are a list of dependency fields. Those fields, in their expected
 order, are:
 
   * ``<public_config>`` -- external build configuration
diff --git a/docs/targets.rst b/docs/targets.rst
index 21f4ccc..a72ae4a 100644
--- a/docs/targets.rst
+++ b/docs/targets.rst
@@ -47,7 +47,7 @@
 Toolchain target variables
 --------------------------
 The core of a toolchain is defining the tools it uses. This is done by setting
-the variables ``ar``, ``cc``, and ``cxx`` to the appropirate compilers. Pigweed
+the variables ``ar``, ``cc``, and ``cxx`` to the appropriate compilers. Pigweed
 provides many commonly used compiler configurations in the ``pw_toolchain``
 module.