license: Replace Apache boilerplate with SPDX tag

Replace the existing Apache 2.0 boilerplate header with an SPDX tag
throughout the zephyr code tree. This patch was generated via a
script run over the master branch.

Also updated doc/porting/application.rst that had a dependency on
line numbers in a literal include.

Manually updated subsys/logging/sys_log.c that had a malformed
header in the original file.  Also cleanup several cases that already
had a SPDX tag and we either got a duplicate or missed updating.

Jira: ZEP-1457

Change-Id: I6131a1d4ee0e58f5b938300c2d2fc77d2e69572c
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
diff --git a/misc/Kconfig b/misc/Kconfig
index 20b22ec..7e17781 100644
--- a/misc/Kconfig
+++ b/misc/Kconfig
@@ -3,17 +3,7 @@
 #
 # Copyright (c) 2014-2015 Wind River Systems, Inc.
 #
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
+# SPDX-License-Identifier: Apache-2.0
 #
 
 menu "Compile and Link Features"
diff --git a/misc/cpp_ctors.c b/misc/cpp_ctors.c
index 8ec409a..5912ce9 100644
--- a/misc/cpp_ctors.c
+++ b/misc/cpp_ctors.c
@@ -1,17 +1,7 @@
 /*
  * Copyright (c) 2012-2014 Wind River Systems, Inc.
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * SPDX-License-Identifier: Apache-2.0
  */
 
 /**
diff --git a/misc/cpp_dtors.c b/misc/cpp_dtors.c
index f38fb43..2e6f462 100644
--- a/misc/cpp_dtors.c
+++ b/misc/cpp_dtors.c
@@ -1,17 +1,7 @@
 /*
  * Copyright (c) 2016 Wind River Systems, Inc.
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * SPDX-License-Identifier: Apache-2.0
  */
 
 /*
diff --git a/misc/cpp_init_array.c b/misc/cpp_init_array.c
index d1848e7..12f8d4d 100644
--- a/misc/cpp_init_array.c
+++ b/misc/cpp_init_array.c
@@ -1,17 +1,7 @@
 /*
  * Copyright (c) 2015 Wind River Systems, Inc.
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * SPDX-License-Identifier: Apache-2.0
  */
 
 /*
diff --git a/misc/cpp_virtual.c b/misc/cpp_virtual.c
index 7d3b502..050f8df 100644
--- a/misc/cpp_virtual.c
+++ b/misc/cpp_virtual.c
@@ -1,17 +1,7 @@
 /*
  * Copyright (c) 2015 Wind River Systems, Inc.
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * SPDX-License-Identifier: Apache-2.0
  */
 
 /*
diff --git a/misc/cpp_vtable.cpp b/misc/cpp_vtable.cpp
index cf9ef35..b8e0390 100644
--- a/misc/cpp_vtable.cpp
+++ b/misc/cpp_vtable.cpp
@@ -1,17 +1,7 @@
 /*
  * Copyright (c) 2015 Wind River Systems, Inc.
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * SPDX-License-Identifier: Apache-2.0
  */
 
 /*
diff --git a/misc/printk.c b/misc/printk.c
index 5047fe2..ff66f88 100644
--- a/misc/printk.c
+++ b/misc/printk.c
@@ -1,17 +1,7 @@
 /*
  * Copyright (c) 2010, 2013-2014 Wind River Systems, Inc.
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * SPDX-License-Identifier: Apache-2.0
  */
 
 /**
diff --git a/misc/reboot.c b/misc/reboot.c
index 85c0835..864aa0d 100644
--- a/misc/reboot.c
+++ b/misc/reboot.c
@@ -1,17 +1,7 @@
 /*
  * Copyright (c) 2015 Wind River Systems, Inc.
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * SPDX-License-Identifier: Apache-2.0
  */
 
 /**
diff --git a/misc/ring_buffer.c b/misc/ring_buffer.c
index 21cdab6..395ddd4 100644
--- a/misc/ring_buffer.c
+++ b/misc/ring_buffer.c
@@ -3,17 +3,7 @@
 /*
  * Copyright (c) 2015 Intel Corporation
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * SPDX-License-Identifier: Apache-2.0
  */
 
 #include <misc/ring_buffer.h>