[PATCH] mm/mremap_pages: Fix static key devmap_managed_key updates
by Aneesh Kumar K.V
commit 6f42193fd86e ("memremap: don't use a separate devm action for
devmap_managed_enable_get") changed the static key updates such that we
now call devmap_managed_enable_put() without doing the equivalent
devmap_managed_enable_get().
devmap_managed_enable_get() is only called for MEMORY_DEVICE_PRIVATE and
MEMORY_DEVICE_FS_DAX, But memunmap_pages() get called for other pgmap
types too. This results in the below warning when switching between
system-ram and devdax mode for devdax namespace.
jump label: negative count!
WARNING: CPU: 52 PID: 1335 at kernel/jump_label.c:235 static_key_slow_try_dec+0x88/0xa0
Modules linked in:
....
NIP [c000000000433318] static_key_slow_try_dec+0x88/0xa0
LR [c000000000433314] static_key_slow_try_dec+0x84/0xa0
Call Trace:
[c000000025c1f660] [c000000000433314] static_key_slow_try_dec+0x84/0xa0 (unreliable)
[c000000025c1f6d0] [c000000000433664] __static_key_slow_dec_cpuslocked+0x34/0xd0
[c000000025c1f700] [c0000000004337a4] static_key_slow_dec+0x54/0xf0
[c000000025c1f770] [c00000000059c49c] memunmap_pages+0x36c/0x500
[c000000025c1f820] [c000000000d91d10] devm_action_release+0x30/0x50
[c000000025c1f840] [c000000000d92e34] release_nodes+0x2f4/0x3e0
[c000000025c1f8f0] [c000000000d8b15c] device_release_driver_internal+0x17c/0x280
[c000000025c1f930] [c000000000d883a4] bus_remove_device+0x124/0x210
[c000000025c1f9b0] [c000000000d80ef4] device_del+0x1d4/0x530
[c000000025c1fa70] [c000000000e341e8] unregister_dev_dax+0x48/0xe0
[c000000025c1fae0] [c000000000d91d10] devm_action_release+0x30/0x50
[c000000025c1fb00] [c000000000d92e34] release_nodes+0x2f4/0x3e0
[c000000025c1fbb0] [c000000000d8b15c] device_release_driver_internal+0x17c/0x280
[c000000025c1fbf0] [c000000000d87000] unbind_store+0x130/0x170
[c000000025c1fc30] [c000000000d862a0] drv_attr_store+0x40/0x60
[c000000025c1fc50] [c0000000006d316c] sysfs_kf_write+0x6c/0xb0
[c000000025c1fc90] [c0000000006d2328] kernfs_fop_write+0x118/0x280
[c000000025c1fce0] [c0000000005a79f8] vfs_write+0xe8/0x2a0
[c000000025c1fd30] [c0000000005a7d94] ksys_write+0x84/0x140
[c000000025c1fd80] [c00000000003a430] system_call_exception+0x120/0x270
[c000000025c1fe20] [c00000000000c540] system_call_common+0xf0/0x27c
Cc: Christoph Hellwig <hch(a)infradead.org>
Cc: Dan Williams <dan.j.williams(a)intel.com>
Cc: Sachin Sant <sachinp(a)linux.vnet.ibm.com>
Cc: linux-nvdimm(a)lists.01.org
Cc: Ira Weiny <ira.weiny(a)intel.com>
Cc: Jason Gunthorpe <jgg(a)mellanox.com>
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar(a)linux.ibm.com>
---
mm/memremap.c | 19 +++++++++++++++----
1 file changed, 15 insertions(+), 4 deletions(-)
diff --git a/mm/memremap.c b/mm/memremap.c
index 73a206d0f645..d4402ff3e467 100644
--- a/mm/memremap.c
+++ b/mm/memremap.c
@@ -158,6 +158,16 @@ void memunmap_pages(struct dev_pagemap *pgmap)
{
unsigned long pfn;
int i;
+ bool need_devmap_managed = false;
+
+ switch (pgmap->type) {
+ case MEMORY_DEVICE_PRIVATE:
+ case MEMORY_DEVICE_FS_DAX:
+ need_devmap_managed = true;
+ break;
+ default:
+ break;
+ }
dev_pagemap_kill(pgmap);
for (i = 0; i < pgmap->nr_range; i++)
@@ -169,7 +179,8 @@ void memunmap_pages(struct dev_pagemap *pgmap)
pageunmap_range(pgmap, i);
WARN_ONCE(pgmap->altmap.alloc, "failed to free all reserved pages\n");
- devmap_managed_enable_put();
+ if (need_devmap_managed)
+ devmap_managed_enable_put();
}
EXPORT_SYMBOL_GPL(memunmap_pages);
@@ -307,7 +318,7 @@ void *memremap_pages(struct dev_pagemap *pgmap, int nid)
.pgprot = PAGE_KERNEL,
};
const int nr_range = pgmap->nr_range;
- bool need_devmap_managed = true;
+ bool need_devmap_managed = false;
int error, i;
if (WARN_ONCE(!nr_range, "nr_range must be specified\n"))
@@ -327,6 +338,7 @@ void *memremap_pages(struct dev_pagemap *pgmap, int nid)
WARN(1, "Missing owner\n");
return ERR_PTR(-EINVAL);
}
+ need_devmap_managed = true;
break;
case MEMORY_DEVICE_FS_DAX:
if (!IS_ENABLED(CONFIG_ZONE_DEVICE) ||
@@ -334,13 +346,12 @@ void *memremap_pages(struct dev_pagemap *pgmap, int nid)
WARN(1, "File system DAX not supported\n");
return ERR_PTR(-EINVAL);
}
+ need_devmap_managed = true;
break;
case MEMORY_DEVICE_GENERIC:
- need_devmap_managed = false;
break;
case MEMORY_DEVICE_PCI_P2PDMA:
params.pgprot = pgprot_noncached(params.pgprot);
- need_devmap_managed = false;
break;
default:
WARN(1, "Invalid pgmap type %d\n", pgmap->type);
--
2.26.2
1 year, 9 months
[ndctl PATCH] Rework license identification
by Dan Williams
Convert to the LICENSES/ directory format for COPYING from the Linux
kernel, and switch all remaining files over to SPDX annotations.
Reported-by: Christoph Hellwig <hch(a)infradead.org>
Signed-off-by: Dan Williams <dan.j.williams(a)intel.com>
---
COPYING | 31 +++
Documentation/daxctl/Makefile.am | 12 -
Documentation/ndctl/Makefile.am | 12 -
LICENSES/other/CC0-1.0 | 0
LICENSES/other/MIT | 0
LICENSES/preferred/GPL-2.0 | 0
LICENSES/preferred/LGPL-2.1 | 0
acpi.h | 16 --
ccan/array_size/LICENSE | 1
ccan/array_size/array_size.h | 2
ccan/build_assert/LICENSE | 1
ccan/build_assert/build_assert.h | 2
ccan/check_type/LICENSE | 1
ccan/check_type/check_type.h | 2
ccan/container_of/LICENSE | 1
ccan/container_of/container_of.h | 2
ccan/endian/LICENSE | 1
ccan/endian/endian.h | 2
ccan/list/LICENSE | 1
ccan/list/list.c | 2
ccan/list/list.h | 2
ccan/minmax/LICENSE | 1
ccan/minmax/minmax.h | 2
ccan/short_types/LICENSE | 1
ccan/short_types/short_types.h | 2
ccan/str/LICENSE | 1
ccan/str/debug.c | 2
ccan/str/str.c | 2
ccan/str/str.h | 2
ccan/str/str_debug.h | 2
daxctl/builtin.h | 2
daxctl/daxctl.c | 16 --
daxctl/lib/libdaxctl-private.h | 14 --
daxctl/lib/libdaxctl.c | 14 --
daxctl/libdaxctl.h | 14 --
daxctl/list.c | 14 --
daxctl/migrate.c | 2
ndctl/action.h | 7 -
ndctl/bat.c | 14 --
ndctl/builtin.h | 2
ndctl/bus.c | 2
ndctl/check.c | 14 --
ndctl/create-nfit.c | 14 --
ndctl/dimm.c | 14 --
ndctl/firmware-update.h | 2
ndctl/inject-error.c | 14 --
ndctl/inject-smart.c | 2
ndctl/lib/ars.c | 14 --
ndctl/lib/dimm.c | 14 --
ndctl/lib/firmware.c | 2
ndctl/lib/hpe1.c | 16 --
ndctl/lib/hpe1.h | 15 --
ndctl/lib/inject.c | 14 --
ndctl/lib/intel.c | 14 --
ndctl/lib/intel.h | 2
ndctl/lib/libndctl.c | 14 --
ndctl/lib/msft.c | 18 --
ndctl/lib/msft.h | 18 --
ndctl/lib/nfit.c | 14 --
ndctl/lib/papr.h | 2
ndctl/lib/papr_pdsm.h | 2
ndctl/lib/private.h | 14 --
ndctl/lib/smart.c | 14 --
ndctl/libndctl-nfit.h | 18 --
ndctl/libndctl.h | 14 --
ndctl/list.c | 14 --
ndctl/monitor.c | 4
ndctl/namespace.c | 14 --
ndctl/namespace.h | 14 --
ndctl/ndctl.c | 15 --
ndctl/ndctl.h | 14 --
ndctl/region.c | 14 --
ndctl/test.c | 14 --
ndctl/util/json-smart.c | 14 --
test.h | 14 --
test/ack-shutdown-count-set.c | 4
test/blk-exhaust.sh | 12 -
test/blk_namespaces.c | 16 --
test/btt-check.sh | 12 -
test/btt-errors.sh | 12 -
test/btt-pad-compat.sh | 12 -
test/clear.sh | 12 -
test/core.c | 14 --
test/create.sh | 12 -
test/dax-dev.c | 14 --
test/dax-errors.c | 14 --
test/dax-pmd.c | 14 --
test/dax-poison.c | 4
test/dax.sh | 12 -
test/daxdev-errors.c | 14 --
test/daxdev-errors.sh | 12 -
test/device-dax-fio.sh | 12 -
test/device-dax.c | 14 --
test/dpa-alloc.c | 14 --
test/dsm-fail.c | 14 --
test/inject-error.sh | 12 -
test/label-compat.sh | 12 -
test/libndctl.c | 14 --
test/list-smart-dimm.c | 5 -
test/mmap.c | 14 --
test/mmap.sh | 12 -
test/multi-dax.sh | 12 -
test/multi-pmem.c | 14 --
test/parent-uuid.c | 16 --
test/pmem_namespaces.c | 16 --
test/sector-mode.sh | 12 -
test/smart-listen.c | 4
test/smart-notify.c | 4
util/COPYING | 340 --------------------------------------
util/abspath.c | 3
util/bitmap.c | 16 --
util/bitmap.h | 14 --
util/filter.c | 14 --
util/filter.h | 14 --
util/help.c | 18 --
util/iomem.c | 5 -
util/iomem.h | 4
util/json.c | 14 --
util/json.h | 14 --
util/list.h | 14 --
util/log.c | 14 --
util/log.h | 14 --
util/main.c | 16 --
util/main.h | 16 --
util/parse-options.c | 14 --
util/parse-options.h | 14 --
util/size.c | 14 --
util/size.h | 14 --
util/strbuf.c | 14 --
util/strbuf.h | 14 --
util/sysfs.c | 14 --
util/sysfs.h | 14 --
util/usage.c | 14 --
util/util.h | 16 --
util/wrapper.c | 16 --
135 files changed, 256 insertions(+), 1440 deletions(-)
rename licenses/CC0 => LICENSES/other/CC0-1.0 (100%)
rename licenses/BSD-MIT => LICENSES/other/MIT (100%)
rename COPYING.tools => LICENSES/preferred/GPL-2.0 (100%)
rename COPYING.libraries => LICENSES/preferred/LGPL-2.1 (100%)
delete mode 120000 ccan/array_size/LICENSE
delete mode 120000 ccan/build_assert/LICENSE
delete mode 120000 ccan/check_type/LICENSE
delete mode 120000 ccan/container_of/LICENSE
delete mode 120000 ccan/endian/LICENSE
delete mode 120000 ccan/list/LICENSE
delete mode 120000 ccan/minmax/LICENSE
delete mode 120000 ccan/short_types/LICENSE
delete mode 120000 ccan/str/LICENSE
delete mode 100644 util/COPYING
diff --git a/COPYING b/COPYING
index 7e705e83d220..0ec3b27e48cc 100644
--- a/COPYING
+++ b/COPYING
@@ -1,6 +1,25 @@
-This project has 2 classes of binaries, "tools" like ndctl and daxctl,
-and "libraries" like libndctl and libdaxctl. The libraries are licensed
-LGPLv2.1 for third-party application linking. See COPYING.libraries for
-the full license. The "tools" are licensed GPLv2 to provide a command
-line interface to the C libraries. See COPYING.tools for the full
-license.
+The ndctl project provides tools under:
+
+ SPDX-License-Identifier: GPL-2.0
+
+Being under the terms of the GNU General Public License version 2 only,
+according with:
+
+ LICENSES/preferred/GPL-2.0
+
+The ndctl project provides libraries under:
+
+ SPDX-License-Identifier: LGPL-2.1
+
+Being under the terms of the GNU Lesser General Public License version
+2.1 only, according with:
+
+ LICENSES/preferred/LGPL-2.1
+
+The project incorporates helper routines from the CCAN project under
+CC0-1.0 and MIT licenses according with:
+
+ LICENSES/other/CC0-1.0
+ LICENSES/other/MIT
+
+All contributions to the ndctl project are subject to this COPYING file.
diff --git a/Documentation/daxctl/Makefile.am b/Documentation/daxctl/Makefile.am
index 7696e23cc9c0..fa2ce1556cd6 100644
--- a/Documentation/daxctl/Makefile.am
+++ b/Documentation/daxctl/Makefile.am
@@ -1,13 +1,5 @@
-# Copyright(c) 2015-2017 Intel Corporation.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of version 2 of the GNU General Public License as
-# published by the Free Software Foundation.
-#
-# 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.
+# Copyright(c) 2015-2020 Intel Corporation. All rights reserved.
+# SPDX-License-Identifier: GPL-2.0
if USE_ASCIIDOCTOR
diff --git a/Documentation/ndctl/Makefile.am b/Documentation/ndctl/Makefile.am
index 0278c783ea66..192be74c0c55 100644
--- a/Documentation/ndctl/Makefile.am
+++ b/Documentation/ndctl/Makefile.am
@@ -1,13 +1,5 @@
-# Copyright(c) 2015-2017 Intel Corporation.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of version 2 of the GNU General Public License as
-# published by the Free Software Foundation.
-#
-# 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.
+# Copyright(c) 2015-2020 Intel Corporation. All rights reserved.
+# SPDX-License-Identifier: GPL-2.0
if USE_ASCIIDOCTOR
diff --git a/licenses/CC0 b/LICENSES/other/CC0-1.0
similarity index 100%
rename from licenses/CC0
rename to LICENSES/other/CC0-1.0
diff --git a/licenses/BSD-MIT b/LICENSES/other/MIT
similarity index 100%
rename from licenses/BSD-MIT
rename to LICENSES/other/MIT
diff --git a/COPYING.tools b/LICENSES/preferred/GPL-2.0
similarity index 100%
rename from COPYING.tools
rename to LICENSES/preferred/GPL-2.0
diff --git a/COPYING.libraries b/LICENSES/preferred/LGPL-2.1
similarity index 100%
rename from COPYING.libraries
rename to LICENSES/preferred/LGPL-2.1
diff --git a/acpi.h b/acpi.h
index e714e28e2354..a2bd9c716281 100644
--- a/acpi.h
+++ b/acpi.h
@@ -1,17 +1,5 @@
-/*
- * ACPI Table Definitions
- *
- * Copyright(c) 2013-2017 Intel Corporation. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * 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.
- */
+// Copyright(c) 2013-2020 Intel Corporation. All rights reserved.
+// SPDX-License-Identifier: GPL-2.0
#ifndef __ACPI_H__
#define __ACPI_H__
#include <stdint.h>
diff --git a/ccan/array_size/LICENSE b/ccan/array_size/LICENSE
deleted file mode 120000
index b7951dabdc82..000000000000
--- a/ccan/array_size/LICENSE
+++ /dev/null
@@ -1 +0,0 @@
-../../licenses/CC0
\ No newline at end of file
diff --git a/ccan/array_size/array_size.h b/ccan/array_size/array_size.h
index 0ca422a29168..5a164765e9c0 100644
--- a/ccan/array_size/array_size.h
+++ b/ccan/array_size/array_size.h
@@ -1,4 +1,4 @@
-/* CC0 (Public domain) - see LICENSE file for details */
+// SPDX-License-Identifier: CC0-1.0
#ifndef CCAN_ARRAY_SIZE_H
#define CCAN_ARRAY_SIZE_H
#include "config.h"
diff --git a/ccan/build_assert/LICENSE b/ccan/build_assert/LICENSE
deleted file mode 120000
index b7951dabdc82..000000000000
--- a/ccan/build_assert/LICENSE
+++ /dev/null
@@ -1 +0,0 @@
-../../licenses/CC0
\ No newline at end of file
diff --git a/ccan/build_assert/build_assert.h b/ccan/build_assert/build_assert.h
index b9ecd84028e3..9ca947a1473d 100644
--- a/ccan/build_assert/build_assert.h
+++ b/ccan/build_assert/build_assert.h
@@ -1,4 +1,4 @@
-/* CC0 (Public domain) - see LICENSE file for details */
+// SPDX-License-Identifier: CC0-1.0
#ifndef CCAN_BUILD_ASSERT_H
#define CCAN_BUILD_ASSERT_H
diff --git a/ccan/check_type/LICENSE b/ccan/check_type/LICENSE
deleted file mode 120000
index b7951dabdc82..000000000000
--- a/ccan/check_type/LICENSE
+++ /dev/null
@@ -1 +0,0 @@
-../../licenses/CC0
\ No newline at end of file
diff --git a/ccan/check_type/check_type.h b/ccan/check_type/check_type.h
index 77501a95597c..e92a87ec5507 100644
--- a/ccan/check_type/check_type.h
+++ b/ccan/check_type/check_type.h
@@ -1,4 +1,4 @@
-/* CC0 (Public domain) - see LICENSE file for details */
+// SPDX-License-Identifier: CC0-1.0
#ifndef CCAN_CHECK_TYPE_H
#define CCAN_CHECK_TYPE_H
#include "config.h"
diff --git a/ccan/container_of/LICENSE b/ccan/container_of/LICENSE
deleted file mode 120000
index b7951dabdc82..000000000000
--- a/ccan/container_of/LICENSE
+++ /dev/null
@@ -1 +0,0 @@
-../../licenses/CC0
\ No newline at end of file
diff --git a/ccan/container_of/container_of.h b/ccan/container_of/container_of.h
index 0449935056f5..ab8137a8598c 100644
--- a/ccan/container_of/container_of.h
+++ b/ccan/container_of/container_of.h
@@ -1,4 +1,4 @@
-/* CC0 (Public domain) - see LICENSE file for details */
+// SPDX-License-Identifier: CC0-1.0
#ifndef CCAN_CONTAINER_OF_H
#define CCAN_CONTAINER_OF_H
#include <stddef.h>
diff --git a/ccan/endian/LICENSE b/ccan/endian/LICENSE
deleted file mode 120000
index b7951dabdc82..000000000000
--- a/ccan/endian/LICENSE
+++ /dev/null
@@ -1 +0,0 @@
-../../licenses/CC0
\ No newline at end of file
diff --git a/ccan/endian/endian.h b/ccan/endian/endian.h
index dc9f62e646df..965a262fe6a6 100644
--- a/ccan/endian/endian.h
+++ b/ccan/endian/endian.h
@@ -1,4 +1,4 @@
-/* CC0 (Public domain) - see LICENSE file for details */
+// SPDX-License-Identifier: CC0-1.0
#ifndef CCAN_ENDIAN_H
#define CCAN_ENDIAN_H
#include <stdint.h>
diff --git a/ccan/list/LICENSE b/ccan/list/LICENSE
deleted file mode 120000
index 2354d12945d3..000000000000
--- a/ccan/list/LICENSE
+++ /dev/null
@@ -1 +0,0 @@
-../../licenses/BSD-MIT
\ No newline at end of file
diff --git a/ccan/list/list.c b/ccan/list/list.c
index 2717fa3f17e5..38b25a9ebf7b 100644
--- a/ccan/list/list.c
+++ b/ccan/list/list.c
@@ -1,4 +1,4 @@
-/* Licensed under BSD-MIT - see LICENSE file for details */
+// SPDX-License-Identifier: MIT
#include <stdio.h>
#include <stdlib.h>
#include "list.h"
diff --git a/ccan/list/list.h b/ccan/list/list.h
index 4d1d34e32709..74c473701e7b 100644
--- a/ccan/list/list.h
+++ b/ccan/list/list.h
@@ -1,4 +1,4 @@
-/* Licensed under BSD-MIT - see LICENSE file for details */
+// SPDX-License-Identifier: MIT
#ifndef CCAN_LIST_H
#define CCAN_LIST_H
//#define CCAN_LIST_DEBUG 1
diff --git a/ccan/minmax/LICENSE b/ccan/minmax/LICENSE
deleted file mode 120000
index b7951dabdc82..000000000000
--- a/ccan/minmax/LICENSE
+++ /dev/null
@@ -1 +0,0 @@
-../../licenses/CC0
\ No newline at end of file
diff --git a/ccan/minmax/minmax.h b/ccan/minmax/minmax.h
index 54f246cc112d..5416af04b032 100644
--- a/ccan/minmax/minmax.h
+++ b/ccan/minmax/minmax.h
@@ -1,4 +1,4 @@
-/* CC0 (Public domain) - see LICENSE file for details */
+// SPDX-License-Identifier: CC0-1.0
#ifndef CCAN_MINMAX_H
#define CCAN_MINMAX_H
diff --git a/ccan/short_types/LICENSE b/ccan/short_types/LICENSE
deleted file mode 120000
index b7951dabdc82..000000000000
--- a/ccan/short_types/LICENSE
+++ /dev/null
@@ -1 +0,0 @@
-../../licenses/CC0
\ No newline at end of file
diff --git a/ccan/short_types/short_types.h b/ccan/short_types/short_types.h
index 175377e9bab9..dabdfe594b9d 100644
--- a/ccan/short_types/short_types.h
+++ b/ccan/short_types/short_types.h
@@ -1,4 +1,4 @@
-/* CC0 (Public domain) - see LICENSE file for details */
+// SPDX-License-Identifier: CC0-1.0
#ifndef CCAN_SHORT_TYPES_H
#define CCAN_SHORT_TYPES_H
#include <stdint.h>
diff --git a/ccan/str/LICENSE b/ccan/str/LICENSE
deleted file mode 120000
index b7951dabdc82..000000000000
--- a/ccan/str/LICENSE
+++ /dev/null
@@ -1 +0,0 @@
-../../licenses/CC0
\ No newline at end of file
diff --git a/ccan/str/debug.c b/ccan/str/debug.c
index 8c519442d792..9dd0e28f0385 100644
--- a/ccan/str/debug.c
+++ b/ccan/str/debug.c
@@ -1,4 +1,4 @@
-/* CC0 (Public domain) - see LICENSE file for details */
+// SPDX-License-Identifier: CC0-1.0
#include "config.h"
#include <ccan/str/str_debug.h>
#include <assert.h>
diff --git a/ccan/str/str.c b/ccan/str/str.c
index a9245c1742ec..66ca7e2039b0 100644
--- a/ccan/str/str.c
+++ b/ccan/str/str.c
@@ -1,4 +1,4 @@
-/* CC0 (Public domain) - see LICENSE file for details */
+// SPDX-License-Identifier: CC0-1.0
#include <ccan/str/str.h>
size_t strcount(const char *haystack, const char *needle)
diff --git a/ccan/str/str.h b/ccan/str/str.h
index 85491bc7e33e..3c08c669b109 100644
--- a/ccan/str/str.h
+++ b/ccan/str/str.h
@@ -1,4 +1,4 @@
-/* CC0 (Public domain) - see LICENSE file for details */
+// SPDX-License-Identifier: CC0-1.0
#ifndef CCAN_STR_H
#define CCAN_STR_H
#include "config.h"
diff --git a/ccan/str/str_debug.h b/ccan/str/str_debug.h
index 92c10c41cc61..ee35e28ca40b 100644
--- a/ccan/str/str_debug.h
+++ b/ccan/str/str_debug.h
@@ -1,4 +1,4 @@
-/* CC0 (Public domain) - see LICENSE file for details */
+// SPDX-License-Identifier: CC0-1.0
#ifndef CCAN_STR_DEBUG_H
#define CCAN_STR_DEBUG_H
diff --git a/daxctl/builtin.h b/daxctl/builtin.h
index bdd71c1f45c8..eaa301269fb4 100644
--- a/daxctl/builtin.h
+++ b/daxctl/builtin.h
@@ -1,4 +1,4 @@
-/* SPDX-License-Identifier: GPL-2.0 */
+// SPDX-License-Identifier: GPL-2.0
/* Copyright(c) 2015-2018 Intel Corporation. All rights reserved. */
#ifndef _DAXCTL_BUILTIN_H_
#define _DAXCTL_BUILTIN_H_
diff --git a/daxctl/daxctl.c b/daxctl/daxctl.c
index f533f810eb42..506b9ff9e31e 100644
--- a/daxctl/daxctl.c
+++ b/daxctl/daxctl.c
@@ -1,16 +1,6 @@
-/*
- * Copyright(c) 2015-2017 Intel Corporation. All rights reserved.
- * Copyright(c) 2005 Andreas Ericsson. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * 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.
- */
+// Copyright(c) 2015-2020 Intel Corporation. All rights reserved.
+// Copyright(c) 2005 Andreas Ericsson. All rights reserved.
+// SPDX-License-Identifier: GPL-2.0
/* originally copied from perf and git */
diff --git a/daxctl/lib/libdaxctl-private.h b/daxctl/lib/libdaxctl-private.h
index 9f9c70d6024f..7a85b16943d7 100644
--- a/daxctl/lib/libdaxctl-private.h
+++ b/daxctl/lib/libdaxctl-private.h
@@ -1,15 +1,5 @@
-/*
- * Copyright (c) 2014-2016, Intel Corporation.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU Lesser General Public License,
- * version 2.1, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
- * more details.
- */
+// Copyright (c) 2014-2020, Intel Corporation. All rights reserved.
+// SPDX-License-Identifier: LGPL-2.1
#ifndef _LIBDAXCTL_PRIVATE_H_
#define _LIBDAXCTL_PRIVATE_H_
diff --git a/daxctl/lib/libdaxctl.c b/daxctl/lib/libdaxctl.c
index 9b43b68facfe..fbc2f4e56ae7 100644
--- a/daxctl/lib/libdaxctl.c
+++ b/daxctl/lib/libdaxctl.c
@@ -1,15 +1,5 @@
-/*
- * Copyright (c) 2016, Intel Corporation.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU Lesser General Public License,
- * version 2.1, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
- * more details.
- */
+// Copyright (c) 2016-2020, Intel Corporation. All rights reserved.
+// SPDX-License-Identifier: LGPL-2.1
#include <stdio.h>
#include <errno.h>
#include <limits.h>
diff --git a/daxctl/libdaxctl.h b/daxctl/libdaxctl.h
index 2b14faad1895..e334c68894b5 100644
--- a/daxctl/libdaxctl.h
+++ b/daxctl/libdaxctl.h
@@ -1,15 +1,5 @@
-/*
- * Copyright (c) 2016, Intel Corporation.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU Lesser General Public License,
- * version 2.1, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
- * more details.
- */
+// Copyright (c) 2016-2020, Intel Corporation. All rights reserved.
+// SPDX-License-Identifier: LGPL-2.1
#ifndef _LIBDAXCTL_H_
#define _LIBDAXCTL_H_
diff --git a/daxctl/list.c b/daxctl/list.c
index 6c6251b4de37..763481c0d5fb 100644
--- a/daxctl/list.c
+++ b/daxctl/list.c
@@ -1,15 +1,5 @@
-/*
- * Copyright(c) 2015-2017 Intel Corporation. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * 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.
- */
+// Copyright(c) 2015-2020 Intel Corporation. All rights reserved.
+// SPDX-License-Identifier: GPL-2.0
#include <stdio.h>
#include <errno.h>
#include <stdlib.h>
diff --git a/daxctl/migrate.c b/daxctl/migrate.c
index d859b0856338..27d379806b15 100644
--- a/daxctl/migrate.c
+++ b/daxctl/migrate.c
@@ -1,4 +1,4 @@
-/* SPDX-License-Identifier: GPL-2.0 */
+// SPDX-License-Identifier: GPL-2.0
/* Copyright(c) 2019 Intel Corporation. All rights reserved. */
#include <sys/types.h>
#include <sys/stat.h>
diff --git a/ndctl/action.h b/ndctl/action.h
index 51f8ee6f4bce..4c4ad9ce7c91 100644
--- a/ndctl/action.h
+++ b/ndctl/action.h
@@ -1,8 +1,5 @@
-/*
- * Copyright(c) 2015-2017 Intel Corporation. All rights reserved.
- *
- * SPDX-License-Identifier: GPL-2.0
- */
+// Copyright(c) 2015-2020 Intel Corporation. All rights reserved.
+// SPDX-License-Identifier: GPL-2.0
#ifndef __NDCTL_ACTION_H__
#define __NDCTL_ACTION_H__
enum device_action {
diff --git a/ndctl/bat.c b/ndctl/bat.c
index c4496f0aeaa0..7529a02198f6 100644
--- a/ndctl/bat.c
+++ b/ndctl/bat.c
@@ -1,15 +1,5 @@
-/*
- * Copyright(c) 2014 Intel Corporation. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * 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.
- */
+// Copyright(c) 2014-2020 Intel Corporation. All rights reserved.
+// SPDX-License-Identifier: GPL-2.0
#include <stdio.h>
#include <syslog.h>
#include <test.h>
diff --git a/ndctl/builtin.h b/ndctl/builtin.h
index 5de7379ce1b4..ec1a750225e4 100644
--- a/ndctl/builtin.h
+++ b/ndctl/builtin.h
@@ -1,4 +1,4 @@
-/* SPDX-License-Identifier: GPL-2.0 */
+// SPDX-License-Identifier: GPL-2.0
/* Copyright(c) 2015-2018 Intel Corporation. All rights reserved. */
#ifndef _NDCTL_BUILTIN_H_
#define _NDCTL_BUILTIN_H_
diff --git a/ndctl/bus.c b/ndctl/bus.c
index 47053c8af389..4db1ab50d7c9 100644
--- a/ndctl/bus.c
+++ b/ndctl/bus.c
@@ -1,4 +1,4 @@
-/* SPDX-License-Identifier: GPL-2.0 */
+// SPDX-License-Identifier: GPL-2.0
/* Copyright(c) 2015-2018 Intel Corporation. All rights reserved. */
#include <stdio.h>
#include <errno.h>
diff --git a/ndctl/check.c b/ndctl/check.c
index cdb3d0bb5ae7..77cf7edb2e98 100644
--- a/ndctl/check.c
+++ b/ndctl/check.c
@@ -1,15 +1,5 @@
-/*
- * Copyright(c) 2015-2016 Intel Corporation. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * 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.
- */
+// Copyright(c) 2015-2020 Intel Corporation. All rights reserved.
+// SPDX-License-Identifier: GPL-2.0
#include <stdio.h>
#include <fcntl.h>
#include <errno.h>
diff --git a/ndctl/create-nfit.c b/ndctl/create-nfit.c
index 8f05eab81494..96c09627f588 100644
--- a/ndctl/create-nfit.c
+++ b/ndctl/create-nfit.c
@@ -1,15 +1,5 @@
-/*
- * Copyright(c) 2014 Intel Corporation. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * 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.
- */
+// Copyright(c) 2014-2020 Intel Corporation. All rights reserved.
+// SPDX-License-Identifier: GPL-2.0
#include <stdio.h>
#include <errno.h>
#include <stdlib.h>
diff --git a/ndctl/dimm.c b/ndctl/dimm.c
index 90eb0b8013ae..02026ffc2afd 100644
--- a/ndctl/dimm.c
+++ b/ndctl/dimm.c
@@ -1,15 +1,5 @@
-/*
- * Copyright (c) 2016, Intel Corporation.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU Lesser General Public License,
- * version 2.1, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
- * more details.
- */
+// Copyright (c) 2016-2020, Intel Corporation. All rights reserved.
+// SPDX-License-Identifier: LGPL-2.1
#include <stdio.h>
#include <errno.h>
#include <stdlib.h>
diff --git a/ndctl/firmware-update.h b/ndctl/firmware-update.h
index a4386d6089d2..6f02340676b3 100644
--- a/ndctl/firmware-update.h
+++ b/ndctl/firmware-update.h
@@ -1,4 +1,4 @@
-/* SPDX-License-Identifier: GPL-2.0 */
+// SPDX-License-Identifier: GPL-2.0
/* Copyright(c) 2018 Intel Corporation. All rights reserved. */
#ifndef _FIRMWARE_UPDATE_H_
diff --git a/ndctl/inject-error.c b/ndctl/inject-error.c
index f6be6a536b49..887ee78297d3 100644
--- a/ndctl/inject-error.c
+++ b/ndctl/inject-error.c
@@ -1,15 +1,5 @@
-/*
- * Copyright(c) 2015-2017 Intel Corporation. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * 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.
- */
+// Copyright(c) 2015-2020 Intel Corporation. All rights reserved.
+// SPDX-License-Identifier: GPL-2.0
#include <stdio.h>
#include <fcntl.h>
#include <errno.h>
diff --git a/ndctl/inject-smart.c b/ndctl/inject-smart.c
index 00c81b87ed54..e5eec8b87f13 100644
--- a/ndctl/inject-smart.c
+++ b/ndctl/inject-smart.c
@@ -1,4 +1,4 @@
-/* SPDX-License-Identifier: GPL-2.0 */
+// SPDX-License-Identifier: GPL-2.0
/* Copyright(c) 2018 Intel Corporation. All rights reserved. */
#include <math.h>
#include <stdio.h>
diff --git a/ndctl/lib/ars.c b/ndctl/lib/ars.c
index 44871b2afde2..81f781e23d57 100644
--- a/ndctl/lib/ars.c
+++ b/ndctl/lib/ars.c
@@ -1,15 +1,5 @@
-/*
- * Copyright (c) 2014-2016, Intel Corporation.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU Lesser General Public License,
- * version 2.1, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
- * more details.
- */
+// Copyright (c) 2014-2020, Intel Corporation. All rights reserved.
+// SPDX-License-Identifier: LGPL-2.1
#include <stdlib.h>
#include <util/size.h>
#include <ndctl/libndctl.h>
diff --git a/ndctl/lib/dimm.c b/ndctl/lib/dimm.c
index 17344f0b168b..ed51ffaa4950 100644
--- a/ndctl/lib/dimm.c
+++ b/ndctl/lib/dimm.c
@@ -1,15 +1,5 @@
-/*
- * Copyright (c) 2014-2017, Intel Corporation.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU Lesser General Public License,
- * version 2.1, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
- * more details.
- */
+// Copyright (c) 2014-2020, Intel Corporation. All rights reserved.
+// SPDX-License-Identifier: LGPL-2.1
#include <ndctl/namespace.h>
#include <ndctl/libndctl.h>
#include <util/fletcher.h>
diff --git a/ndctl/lib/firmware.c b/ndctl/lib/firmware.c
index a5dd00640698..e3a6924db8bc 100644
--- a/ndctl/lib/firmware.c
+++ b/ndctl/lib/firmware.c
@@ -1,4 +1,4 @@
-/* SPDX-License-Identifier: GPL-2.0 */
+// SPDX-License-Identifier: GPL-2.0
/* Copyright(c) 2018 Intel Corporation. All rights reserved. */
#include <stdlib.h>
#include <limits.h>
diff --git a/ndctl/lib/hpe1.c b/ndctl/lib/hpe1.c
index b5ee02608d31..31bd215ca9ad 100644
--- a/ndctl/lib/hpe1.c
+++ b/ndctl/lib/hpe1.c
@@ -1,16 +1,6 @@
-/*
- * Copyright (C) 2016 Hewlett Packard Enterprise Development LP
- * Copyright (c) 2016, Intel Corporation.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU Lesser General Public License,
- * version 2.1, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
- * more details.
- */
+// Copyright (C) 2016 Hewlett Packard Enterprise Development LP
+// Copyright (c) 2016, Intel Corporation.
+// SPDX-License-Identifier: LGPL-2.1
#include <stdlib.h>
#include <limits.h>
#include <util/log.h>
diff --git a/ndctl/lib/hpe1.h b/ndctl/lib/hpe1.h
index 1afa54f127a6..acf82af7bb87 100644
--- a/ndctl/lib/hpe1.h
+++ b/ndctl/lib/hpe1.h
@@ -1,16 +1,5 @@
-/*
- * Copyright (C) 2016 Hewlett Packard Enterprise Development LP
- * Copyright (c) 2014-2015, Intel Corporation.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU Lesser General Public License,
- * version 2.1, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
- * more details.
- */
+// Copyright (C) 2016 Hewlett Packard Enterprise Development LP
+// SPDX-License-Identifier: LGPL-2.1
#ifndef __NDCTL_HPE1_H__
#define __NDCTL_HPE1_H__
diff --git a/ndctl/lib/inject.c b/ndctl/lib/inject.c
index 815f254308c6..00ef0a4d1d28 100644
--- a/ndctl/lib/inject.c
+++ b/ndctl/lib/inject.c
@@ -1,15 +1,5 @@
-/*
- * Copyright (c) 2014-2017, Intel Corporation.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU Lesser General Public License,
- * version 2.1, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
- * more details.
- */
+// Copyright (c) 2014-2017, Intel Corporation. All rights reserved.
+// SPDX-License-Identifier: LGPL-2.1
#include <stdlib.h>
#include <limits.h>
#include <util/list.h>
diff --git a/ndctl/lib/intel.c b/ndctl/lib/intel.c
index ebcefd8b5ad2..0d3da2bec017 100644
--- a/ndctl/lib/intel.c
+++ b/ndctl/lib/intel.c
@@ -1,15 +1,5 @@
-/*
- * Copyright (c) 2016-2017, Intel Corporation.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU Lesser General Public License,
- * version 2.1, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
- * more details.
- */
+// Copyright (c) 2016-2020, Intel Corporation. All rights reserved.
+// SPDX-License-Identifier: LGPL-2.1
#include <stdlib.h>
#include <limits.h>
#include <util/log.h>
diff --git a/ndctl/lib/intel.h b/ndctl/lib/intel.h
index 530c996a6930..bade1cba02b0 100644
--- a/ndctl/lib/intel.h
+++ b/ndctl/lib/intel.h
@@ -1,4 +1,4 @@
-/* SPDX-License-Identifier: LGPL-2.1 */
+// SPDX-License-Identifier: LGPL-2.1
/* Copyright (c) 2017, Intel Corporation. All rights reserved. */
#ifndef __INTEL_H__
diff --git a/ndctl/lib/libndctl.c b/ndctl/lib/libndctl.c
index 554696386f48..cd039d9bd5d8 100644
--- a/ndctl/lib/libndctl.c
+++ b/ndctl/lib/libndctl.c
@@ -1,15 +1,5 @@
-/*
- * Copyright (c) 2014-2016, Intel Corporation.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU Lesser General Public License,
- * version 2.1, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
- * more details.
- */
+// Copyright (c) 2014-2020, Intel Corporation. All rights reserved.
+// SPDX-License-Identifier: LGPL-2.1
#include <poll.h>
#include <stdio.h>
#include <signal.h>
diff --git a/ndctl/lib/msft.c b/ndctl/lib/msft.c
index c060b1f2609e..9eb9eb18fa8f 100644
--- a/ndctl/lib/msft.c
+++ b/ndctl/lib/msft.c
@@ -1,17 +1,7 @@
-/*
- * Copyright (C) 2016-2017 Dell, Inc.
- * Copyright (C) 2016 Hewlett Packard Enterprise Development LP
- * Copyright (c) 2016, Intel Corporation.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU Lesser General Public License,
- * version 2.1, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
- * more details.
- */
+// Copyright (c) 2016-2017 Dell, Inc.
+// Copyright (c) 2016 Hewlett Packard Enterprise Development LP
+// Copyright (c) 2016, Intel Corporation.
+// SPDX-License-Identifier: LGPL-2.1
#include <stdlib.h>
#include <limits.h>
#include <util/log.h>
diff --git a/ndctl/lib/msft.h b/ndctl/lib/msft.h
index c45981edd8d7..86f68770636d 100644
--- a/ndctl/lib/msft.h
+++ b/ndctl/lib/msft.h
@@ -1,17 +1,7 @@
-/*
- * Copyright (C) 2016-2017 Dell, Inc.
- * Copyright (C) 2016 Hewlett Packard Enterprise Development LP
- * Copyright (c) 2014-2015, Intel Corporation.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU Lesser General Public License,
- * version 2.1, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
- * more details.
- */
+// Copyright (c) 2016-2017 Dell, Inc.
+// Copyright (c) 2016 Hewlett Packard Enterprise Development LP
+// Copyright (c) 2014-2015, Intel Corporation.
+// SPDX-License-Identifier: LGPL-2.1
#ifndef __NDCTL_MSFT_H__
#define __NDCTL_MSFT_H__
diff --git a/ndctl/lib/nfit.c b/ndctl/lib/nfit.c
index f9fbe73f7446..6b52917c44e0 100644
--- a/ndctl/lib/nfit.c
+++ b/ndctl/lib/nfit.c
@@ -1,15 +1,5 @@
-/*
- * Copyright (c) 2017, FUJITSU LIMITED. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU Lesser General Public License,
- * version 2.1, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
- * more details.
- */
+// Copyright (c) 2017, FUJITSU LIMITED. All rights reserved.
+// SPDX-License-Identifier: LGPL-2.1
#include <stdlib.h>
#include <ndctl/libndctl.h>
#include "private.h"
diff --git a/ndctl/lib/papr.h b/ndctl/lib/papr.h
index 77579396a7bd..3979e492e9cb 100644
--- a/ndctl/lib/papr.h
+++ b/ndctl/lib/papr.h
@@ -1,4 +1,4 @@
-/* SPDX-License-Identifier: LGPL-2.1 */
+// SPDX-License-Identifier: LGPL-2.1
/* (C) Copyright IBM 2020 */
#ifndef __PAPR_H__
diff --git a/ndctl/lib/papr_pdsm.h b/ndctl/lib/papr_pdsm.h
index 1bac8a7fc933..4f14b26edb50 100644
--- a/ndctl/lib/papr_pdsm.h
+++ b/ndctl/lib/papr_pdsm.h
@@ -1,4 +1,4 @@
-/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
+// SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note
/*
* PAPR nvDimm Specific Methods (PDSM) and structs for libndctl
*
diff --git a/ndctl/lib/private.h b/ndctl/lib/private.h
index bab4298b01e3..1ed1a7c5843d 100644
--- a/ndctl/lib/private.h
+++ b/ndctl/lib/private.h
@@ -1,15 +1,5 @@
-/*
- * Copyright (c) 2014-2016, Intel Corporation.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU Lesser General Public License,
- * version 2.1, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
- * more details.
- */
+// Copyright (c) 2014-2020, Intel Corporation. All rights reserved.
+// SPDX-License-Identifier: LGPL-2.1
#ifndef _LIBNDCTL_PRIVATE_H_
#define _LIBNDCTL_PRIVATE_H_
diff --git a/ndctl/lib/smart.c b/ndctl/lib/smart.c
index 0e180cff5a3e..265651388f8e 100644
--- a/ndctl/lib/smart.c
+++ b/ndctl/lib/smart.c
@@ -1,15 +1,5 @@
-/*
- * Copyright (c) 2016, Intel Corporation.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU Lesser General Public License,
- * version 2.1, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
- * more details.
- */
+// Copyright (c) 2016-2020, Intel Corporation. All rights reserved.
+// SPDX-License-Identifier: LGPL-2.1
#include <stdlib.h>
#include <limits.h>
#include <util/log.h>
diff --git a/ndctl/libndctl-nfit.h b/ndctl/libndctl-nfit.h
index 8c4f72dfa7ec..b22dbd129a79 100644
--- a/ndctl/libndctl-nfit.h
+++ b/ndctl/libndctl-nfit.h
@@ -1,18 +1,6 @@
-/*
- *
- * Copyright (c) 2017 Hewlett Packard Enterprise Development LP
- * Copyright (c) 2017 Intel Corporation. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU Lesser General Public License,
- * version 2.1, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
- * more details.
- */
-
+// Copyright (c) 2017 Hewlett Packard Enterprise Development LP
+// Copyright (c) 2017 Intel Corporation. All rights reserved.
+// SPDX-License-Identifier: LGPL-2.1
#ifndef __LIBNDCTL_NFIT_H__
#define __LIBNDCTL_NFIT_H__
diff --git a/ndctl/libndctl.h b/ndctl/libndctl.h
index 231dbb560996..b11651b35865 100644
--- a/ndctl/libndctl.h
+++ b/ndctl/libndctl.h
@@ -1,15 +1,5 @@
-/*
- * Copyright (c) 2014-2016, Intel Corporation.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU Lesser General Public License,
- * version 2.1, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
- * more details.
- */
+// Copyright (c) 2014-2020, Intel Corporation. All rights reserved.
+// SPDX-License-Identifier: LGPL-2.1
#ifndef _LIBNDCTL_H_
#define _LIBNDCTL_H_
diff --git a/ndctl/list.c b/ndctl/list.c
index f98148aea479..1aa97fff1efa 100644
--- a/ndctl/list.c
+++ b/ndctl/list.c
@@ -1,15 +1,5 @@
-/*
- * Copyright(c) 2015-2017 Intel Corporation. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * 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.
- */
+// Copyright(c) 2015-2017 Intel Corporation. All rights reserved.
+// SPDX-License-Identifier: GPL-2.0
#include <stdio.h>
#include <errno.h>
#include <stdlib.h>
diff --git a/ndctl/monitor.c b/ndctl/monitor.c
index 4e9b2236ff3c..7270009083e6 100644
--- a/ndctl/monitor.c
+++ b/ndctl/monitor.c
@@ -1,5 +1,5 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-/* Copyright(c) 2018, FUJITSU LIMITED. All rights reserved. */
+// Copyright(c) 2018, FUJITSU LIMITED. All rights reserved.
+// SPDX-License-Identifier: GPL-2.0
#include <stdio.h>
#include <json-c/json.h>
diff --git a/ndctl/namespace.c b/ndctl/namespace.c
index e946bb6c9bfa..18417d9e380e 100644
--- a/ndctl/namespace.c
+++ b/ndctl/namespace.c
@@ -1,15 +1,5 @@
-/*
- * Copyright(c) 2015-2017 Intel Corporation. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * 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.
- */
+// Copyright(c) 2015-2020 Intel Corporation. All rights reserved.
+// SPDX-License-Identifier: GPL-2.0
#include <stdio.h>
#include <fcntl.h>
#include <errno.h>
diff --git a/ndctl/namespace.h b/ndctl/namespace.h
index 0f17df20ca3a..5f5970cea325 100644
--- a/ndctl/namespace.h
+++ b/ndctl/namespace.h
@@ -1,15 +1,5 @@
-/*
- * Copyright (c) 2014-2017, Intel Corporation.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU Lesser General Public License,
- * version 2.1, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
- * more details.
- */
+// Copyright (c) 2014-2020, Intel Corporation. All rights reserved.
+// SPDX-License-Identifier: LGPL-2.1
#ifndef __NDCTL_NAMESPACE_H__
#define __NDCTL_NAMESPACE_H__
#include <sys/types.h>
diff --git a/ndctl/ndctl.c b/ndctl/ndctl.c
index eb5d8392d8e4..f6596090b064 100644
--- a/ndctl/ndctl.c
+++ b/ndctl/ndctl.c
@@ -1,16 +1,5 @@
-/*
- * Copyright(c) 2015-2017 Intel Corporation. All rights reserved.
- * Copyright(c) 2005 Andreas Ericsson. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * 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.
- */
+// Copyright(c) 2015-2020 Intel Corporation. All rights reserved.
+// SPDX-License-Identifier: GPL-2.0
/* originally copied from perf and git */
diff --git a/ndctl/ndctl.h b/ndctl/ndctl.h
index a47b658f4a57..337202ee29bd 100644
--- a/ndctl/ndctl.h
+++ b/ndctl/ndctl.h
@@ -1,15 +1,5 @@
-/*
- * Copyright (c) 2014-2016, Intel Corporation.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU Lesser General Public License,
- * version 2.1, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
- * more details.
- */
+// Copyright (c) 2014-2020, Intel Corporation. All rights reserved.
+// SPDX-License-Identifier: LGPL-2.1
#ifndef __NDCTL_H__
#define __NDCTL_H__
diff --git a/ndctl/region.c b/ndctl/region.c
index 7945007905fd..93e354541221 100644
--- a/ndctl/region.c
+++ b/ndctl/region.c
@@ -1,15 +1,5 @@
-/*
- * Copyright(c) 2015-2017 Intel Corporation. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * 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.
- */
+// Copyright(c) 2015-2020 Intel Corporation. All rights reserved.
+// SPDX-License-Identifier: GPL-2.0
#include <stdio.h>
#include <errno.h>
#include <stdlib.h>
diff --git a/ndctl/test.c b/ndctl/test.c
index b78776311125..aaeda6826f87 100644
--- a/ndctl/test.c
+++ b/ndctl/test.c
@@ -1,15 +1,5 @@
-/*
- * Copyright(c) 2015-2017 Intel Corporation. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * 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.
- */
+// Copyright(c) 2015-2020 Intel Corporation. All rights reserved.
+// SPDX-License-Identifier: GPL-2.0
#include <stdio.h>
#include <limits.h>
#include <syslog.h>
diff --git a/ndctl/util/json-smart.c b/ndctl/util/json-smart.c
index a9bd17b37b4e..d111f1e82f50 100644
--- a/ndctl/util/json-smart.c
+++ b/ndctl/util/json-smart.c
@@ -1,15 +1,5 @@
-/*
- * Copyright(c) 2015-2017 Intel Corporation. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * 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.
- */
+// Copyright(c) 2015-2020 Intel Corporation. All rights reserved.
+// SPDX-License-Identifier: GPL-2.0
#include <limits.h>
#include <util/json.h>
#include <uuid/uuid.h>
diff --git a/test.h b/test.h
index 3f6212e067fc..579eeac3b48c 100644
--- a/test.h
+++ b/test.h
@@ -1,15 +1,5 @@
-/*
- * Copyright(c) 2015-2017 Intel Corporation. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * 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.
- */
+// Copyright(c) 2015-2020 Intel Corporation. All rights reserved.
+// SPDX-License-Identifier: GPL-2.0
#ifndef __TEST_H__
#define __TEST_H__
#include <stdbool.h>
diff --git a/test/ack-shutdown-count-set.c b/test/ack-shutdown-count-set.c
index 742e976bfa90..4ecbc7fa3000 100644
--- a/test/ack-shutdown-count-set.c
+++ b/test/ack-shutdown-count-set.c
@@ -1,5 +1,5 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-/* Copyright(c) 2018 Intel Corporation. All rights reserved. */
+// Copyright(c) 2018-2020 Intel Corporation. All rights reserved.
+// SPDX-License-Identifier: GPL-2.0
#include <stdio.h>
#include <stddef.h>
diff --git a/test/blk-exhaust.sh b/test/blk-exhaust.sh
index db7dc25aecbd..9bc6cb0d7522 100755
--- a/test/blk-exhaust.sh
+++ b/test/blk-exhaust.sh
@@ -1,15 +1,7 @@
#!/bin/bash -x
-# Copyright(c) 2015-2017 Intel Corporation. All rights reserved.
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of version 2 of the GNU General Public License as
-# published by the Free Software Foundation.
-#
-# 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.
+# Copyright(c) 2015-2020 Intel Corporation. All rights reserved.
+# SPDX-License-Identifier: GPL-2.0
set -e
diff --git a/test/blk_namespaces.c b/test/blk_namespaces.c
index 437fcad0a8f5..8f337a96a64a 100644
--- a/test/blk_namespaces.c
+++ b/test/blk_namespaces.c
@@ -1,17 +1,5 @@
-/*
- * blk_namespaces: tests functionality of multiple block namespaces
- *
- * Copyright (c) 2015, Intel Corporation.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU Lesser General Public License,
- * version 2.1, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
- * more details.
- */
+// Copyright (c) 2015-2020, Intel Corporation. All rights reserved.
+// SPDX-License-Identifier: LGPL-2.1
#include <errno.h>
#include <fcntl.h>
#include <linux/fs.h>
diff --git a/test/btt-check.sh b/test/btt-check.sh
index bd782f477728..76a73dfc842d 100755
--- a/test/btt-check.sh
+++ b/test/btt-check.sh
@@ -1,15 +1,7 @@
#!/bin/bash -E
-# Copyright(c) 2015-2017 Intel Corporation. All rights reserved.
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of version 2 of the GNU General Public License as
-# published by the Free Software Foundation.
-#
-# 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.
+# Copyright(c) 2015-2020 Intel Corporation. All rights reserved.
+# SPDX-License-Identifier: GPL-2.0
dev=""
mode=""
diff --git a/test/btt-errors.sh b/test/btt-errors.sh
index a56069789d4b..437f9d21ad6c 100755
--- a/test/btt-errors.sh
+++ b/test/btt-errors.sh
@@ -1,15 +1,7 @@
#!/bin/bash -x
-# Copyright(c) 2015-2017 Intel Corporation. All rights reserved.
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of version 2 of the GNU General Public License as
-# published by the Free Software Foundation.
-#
-# 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.
+# Copyright(c) 2015-2020 Intel Corporation. All rights reserved.
+# SPDX-License-Identifier: GPL-2.0
MNT=test_btt_mnt
FILE=image
diff --git a/test/btt-pad-compat.sh b/test/btt-pad-compat.sh
index b1a46edeaf9d..40cfb01b70d8 100755
--- a/test/btt-pad-compat.sh
+++ b/test/btt-pad-compat.sh
@@ -1,15 +1,7 @@
#!/bin/bash -Ex
-# Copyright(c) 2015-2017 Intel Corporation. All rights reserved.
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of version 2 of the GNU General Public License as
-# published by the Free Software Foundation.
-#
-# 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.
+# Copyright(c) 2015-2020 Intel Corporation. All rights reserved.
+# SPDX-License-Identifier: GPL-2.0
dev=""
size=""
diff --git a/test/clear.sh b/test/clear.sh
index 1fffd166504a..43dd58210375 100755
--- a/test/clear.sh
+++ b/test/clear.sh
@@ -1,15 +1,7 @@
#!/bin/bash -x
-# Copyright(c) 2015-2017 Intel Corporation. All rights reserved.
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of version 2 of the GNU General Public License as
-# published by the Free Software Foundation.
-#
-# 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.
+# Copyright(c) 2015-2020 Intel Corporation. All rights reserved.
+# SPDX-License-Identifier: GPL-2.0
set -e
diff --git a/test/core.c b/test/core.c
index 5118d86483d4..47eb4ae3b3b2 100644
--- a/test/core.c
+++ b/test/core.c
@@ -1,15 +1,5 @@
-/*
- * Copyright(c) 2015-2017 Intel Corporation. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * 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.
- */
+// Copyright(c) 2015-2020 Intel Corporation. All rights reserved.
+// SPDX-License-Identifier: GPL-2.0
#include <linux/version.h>
#include <sys/utsname.h>
#include <libkmod.h>
diff --git a/test/create.sh b/test/create.sh
index 520f3a9c1dc1..bc563d0cb333 100755
--- a/test/create.sh
+++ b/test/create.sh
@@ -1,15 +1,7 @@
#!/bin/bash -x
-# Copyright(c) 2015-2017 Intel Corporation. All rights reserved.
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of version 2 of the GNU General Public License as
-# published by the Free Software Foundation.
-#
-# 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.
+# Copyright(c) 2015-2020 Intel Corporation. All rights reserved.
+# SPDX-License-Identifier: GPL-2.0
set -e
diff --git a/test/dax-dev.c b/test/dax-dev.c
index ab6b35a67183..c62f607248fd 100644
--- a/test/dax-dev.c
+++ b/test/dax-dev.c
@@ -1,15 +1,5 @@
-/*
- * Copyright (c) 2014-2016, Intel Corporation.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU Lesser General Public License,
- * version 2.1, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
- * more details.
- */
+// Copyright (c) 2014-2020, Intel Corporation. All rights reserved.
+// SPDX-License-Identifier: LGPL-2.1
#include <stdio.h>
#include <stddef.h>
#include <stdlib.h>
diff --git a/test/dax-errors.c b/test/dax-errors.c
index fde3ba03546f..a35ecfaa687d 100644
--- a/test/dax-errors.c
+++ b/test/dax-errors.c
@@ -1,15 +1,5 @@
-/*
- * Copyright(c) 2015-2017 Intel Corporation. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * 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.
- */
+// Copyright(c) 2015-2020 Intel Corporation. All rights reserved.
+// SPDX-License-Identifier: GPL-2.0
#include <stdio.h>
#include <unistd.h>
#include <sys/mman.h>
diff --git a/test/dax-pmd.c b/test/dax-pmd.c
index df3219639a6d..ecaa871b4971 100644
--- a/test/dax-pmd.c
+++ b/test/dax-pmd.c
@@ -1,15 +1,5 @@
-/*
- * Copyright(c) 2015-2017 Intel Corporation. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * 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.
- */
+// Copyright(c) 2015-2020 Intel Corporation. All rights reserved.
+// SPDX-License-Identifier: GPL-2.0
#include <stdio.h>
#include <unistd.h>
#include <setjmp.h>
diff --git a/test/dax-poison.c b/test/dax-poison.c
index 69bb161db6d8..320668b4cae8 100644
--- a/test/dax-poison.c
+++ b/test/dax-poison.c
@@ -1,5 +1,5 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-/* Copyright(c) 2018 Intel Corporation. All rights reserved. */
+// Copyright(c) 2018-2020 Intel Corporation. All rights reserved.
+// SPDX-License-Identifier: GPL-2.0
#include <stdio.h>
#include <unistd.h>
#include <signal.h>
diff --git a/test/dax.sh b/test/dax.sh
index 5383c433283f..19dc5a2a5c35 100755
--- a/test/dax.sh
+++ b/test/dax.sh
@@ -1,15 +1,7 @@
#!/bin/bash -x
-# Copyright(c) 2015-2017 Intel Corporation. All rights reserved.
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of version 2 of the GNU General Public License as
-# published by the Free Software Foundation.
-#
-# 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.
+# Copyright(c) 2015-2020 Intel Corporation. All rights reserved.
+# SPDX-License-Identifier: GPL-2.0
. $(dirname $0)/common
diff --git a/test/daxdev-errors.c b/test/daxdev-errors.c
index 29de16b0a53d..36a04a5512f5 100644
--- a/test/daxdev-errors.c
+++ b/test/daxdev-errors.c
@@ -1,15 +1,5 @@
-/*
- * Copyright(c) 2015-2017 Intel Corporation. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * 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.
- */
+// Copyright(c) 2015-2020 Intel Corporation. All rights reserved.
+// SPDX-License-Identifier: GPL-2.0
#include <stdio.h>
#include <stdint.h>
#include <stdbool.h>
diff --git a/test/daxdev-errors.sh b/test/daxdev-errors.sh
index 15d3e67d1166..9f5616dc9fcb 100755
--- a/test/daxdev-errors.sh
+++ b/test/daxdev-errors.sh
@@ -1,15 +1,7 @@
#!/bin/bash -x
-# Copyright(c) 2015-2017 Intel Corporation. All rights reserved.
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of version 2 of the GNU General Public License as
-# published by the Free Software Foundation.
-#
-# 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.
+# Copyright(c) 2015-2020 Intel Corporation. All rights reserved.
+# SPDX-License-Identifier: GPL-2.0
set -e
diff --git a/test/device-dax-fio.sh b/test/device-dax-fio.sh
index d4ca7ab238e4..1ac258396ef0 100755
--- a/test/device-dax-fio.sh
+++ b/test/device-dax-fio.sh
@@ -1,15 +1,7 @@
#!/bin/bash
-# Copyright(c) 2015-2017 Intel Corporation. All rights reserved.
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of version 2 of the GNU General Public License as
-# published by the Free Software Foundation.
-#
-# 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.
+# Copyright(c) 2015-2020 Intel Corporation. All rights reserved.
+# SPDX-License-Identifier: GPL-2.0
. $(dirname $0)/common
diff --git a/test/device-dax.c b/test/device-dax.c
index 9de10682e34d..a3ae70985630 100644
--- a/test/device-dax.c
+++ b/test/device-dax.c
@@ -1,15 +1,5 @@
-/*
- * Copyright(c) 2015-2017 Intel Corporation. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * 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.
- */
+// Copyright(c) 2015-2020 Intel Corporation. All rights reserved.
+// SPDX-License-Identifier: GPL-2.0
#include <fcntl.h>
#include <stdio.h>
#include <errno.h>
diff --git a/test/dpa-alloc.c b/test/dpa-alloc.c
index b757b9ad9c2c..7010f66e09a2 100644
--- a/test/dpa-alloc.c
+++ b/test/dpa-alloc.c
@@ -1,15 +1,5 @@
-/*
- * Copyright (c) 2014-2016, Intel Corporation.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU Lesser General Public License,
- * version 2.1, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
- * more details.
- */
+// Copyright (c) 2014-2020, Intel Corporation. All rights reserved.
+// SPDX-License-Identifier: LGPL-2.1
#include <stdio.h>
#include <stddef.h>
#include <stdlib.h>
diff --git a/test/dsm-fail.c b/test/dsm-fail.c
index b2c51db4aa3a..bcabae86c2bc 100644
--- a/test/dsm-fail.c
+++ b/test/dsm-fail.c
@@ -1,15 +1,5 @@
-/*
- * Copyright (c) 2014-2016, Intel Corporation.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU Lesser General Public License,
- * version 2.1, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
- * more details.
- */
+// Copyright (c) 2014-2020, Intel Corporation. All rights reserved.
+// SPDX-License-Identifier: LGPL-2.1
#include <stdio.h>
#include <stddef.h>
#include <stdlib.h>
diff --git a/test/inject-error.sh b/test/inject-error.sh
index 5667b5131c7a..92e5fefa4a80 100755
--- a/test/inject-error.sh
+++ b/test/inject-error.sh
@@ -1,15 +1,7 @@
#!/bin/bash -Ex
-# Copyright(c) 2015-2017 Intel Corporation. All rights reserved.
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of version 2 of the GNU General Public License as
-# published by the Free Software Foundation.
-#
-# 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.
+# Copyright(c) 2015-2020 Intel Corporation. All rights reserved.
+# SPDX-License-Identifier: GPL-2.0
dev=""
size=""
diff --git a/test/label-compat.sh b/test/label-compat.sh
index a29dd1367233..3f17f75f454d 100755
--- a/test/label-compat.sh
+++ b/test/label-compat.sh
@@ -1,15 +1,7 @@
#!/bin/bash -x
-# Copyright(c) 2015-2017 Intel Corporation. All rights reserved.
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of version 2 of the GNU General Public License as
-# published by the Free Software Foundation.
-#
-# 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.
+# Copyright(c) 2015-2020 Intel Corporation. All rights reserved.
+# SPDX-License-Identifier: GPL-2.0
set -e
diff --git a/test/libndctl.c b/test/libndctl.c
index 994e0fadf4f7..a75a965b93f1 100644
--- a/test/libndctl.c
+++ b/test/libndctl.c
@@ -1,15 +1,5 @@
-/*
- * Copyright (c) 2014-2016, Intel Corporation.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU Lesser General Public License,
- * version 2.1, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
- * more details.
- */
+// Copyright (c) 2014-2020, Intel Corporation. All rights reserved.
+// SPDX-License-Identifier: LGPL-2.1
#include <stdio.h>
#include <stddef.h>
#include <stdlib.h>
diff --git a/test/list-smart-dimm.c b/test/list-smart-dimm.c
index c9982d50f1ad..669318d3be7c 100644
--- a/test/list-smart-dimm.c
+++ b/test/list-smart-dimm.c
@@ -1,6 +1,5 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-/* Copyright(c) 2018, FUJITSU LIMITED. All rights reserved. */
-
+// Copyright(c) 2018, FUJITSU LIMITED. All rights reserved.
+// SPDX-License-Identifier: GPL-2.0
#include <stdio.h>
#include <errno.h>
#include <util/json.h>
diff --git a/test/mmap.c b/test/mmap.c
index b087ba872ba9..23ef669abbce 100644
--- a/test/mmap.c
+++ b/test/mmap.c
@@ -1,15 +1,5 @@
-/*
- * Copyright(c) 2015 Toshi Kani, Hewlett Packard Enterprise. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * 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.
- */
+// Copyright(c) 2015 Toshi Kani, Hewlett Packard Enterprise. All rights reserved.
+// SPDX-License-Identifier: GPL-2.0
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/mman.h>
diff --git a/test/mmap.sh b/test/mmap.sh
index 0bcc35f619f5..ef11696cf1d4 100755
--- a/test/mmap.sh
+++ b/test/mmap.sh
@@ -1,15 +1,7 @@
#!/bin/bash
-# Copyright(c) 2015-2017 Intel Corporation. All rights reserved.
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of version 2 of the GNU General Public License as
-# published by the Free Software Foundation.
-#
-# 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.
+# Copyright(c) 2015-2020 Intel Corporation. All rights reserved.
+# SPDX-License-Identifier: GPL-2.0
. $(dirname $0)/common
diff --git a/test/multi-dax.sh b/test/multi-dax.sh
index 110ba3d80339..39e9e4e111d7 100755
--- a/test/multi-dax.sh
+++ b/test/multi-dax.sh
@@ -1,15 +1,7 @@
#!/bin/bash -x
-# Copyright(c) 2015-2017 Intel Corporation. All rights reserved.
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of version 2 of the GNU General Public License as
-# published by the Free Software Foundation.
-#
-# 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.
+# Copyright(c) 2015-2020 Intel Corporation. All rights reserved.
+# SPDX-License-Identifier: GPL-2.0
set -e
diff --git a/test/multi-pmem.c b/test/multi-pmem.c
index cb7cd4033f37..c31780f26b3e 100644
--- a/test/multi-pmem.c
+++ b/test/multi-pmem.c
@@ -1,15 +1,5 @@
-/*
- * Copyright(c) 2015-2017 Intel Corporation. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * 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.
- */
+// Copyright(c) 2015-2020 Intel Corporation. All rights reserved.
+// SPDX-License-Identifier: GPL-2.0
#include <stdio.h>
#include <errno.h>
#include <unistd.h>
diff --git a/test/parent-uuid.c b/test/parent-uuid.c
index f41ca2c7bd75..33568afc0b62 100644
--- a/test/parent-uuid.c
+++ b/test/parent-uuid.c
@@ -1,17 +1,5 @@
-/*
- * blk_namespaces: tests functionality of multiple block namespaces
- *
- * Copyright (c) 2015, Intel Corporation.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU Lesser General Public License,
- * version 2.1, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
- * more details.
- */
+// Copyright (c) 2015-2020, Intel Corporation. All rights reserved.
+// SPDX-License-Identifier: LGPL-2.1
#include <stdio.h>
#include <stddef.h>
#include <stdlib.h>
diff --git a/test/pmem_namespaces.c b/test/pmem_namespaces.c
index eac56ce25d58..34dcf386acbb 100644
--- a/test/pmem_namespaces.c
+++ b/test/pmem_namespaces.c
@@ -1,17 +1,5 @@
-/*
- * pmem_namespaces: test functionality of PMEM namespaces
- *
- * Copyright (c) 2015, Intel Corporation.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU Lesser General Public License,
- * version 2.1, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
- * more details.
- */
+// Copyright (c) 2015-2020, Intel Corporation. All rights reserved.
+// SPDX-License-Identifier: LGPL-2.1
#include <errno.h>
#include <fcntl.h>
#include <linux/fs.h>
diff --git a/test/sector-mode.sh b/test/sector-mode.sh
index eef8dc6d6a3e..6374e18597a2 100755
--- a/test/sector-mode.sh
+++ b/test/sector-mode.sh
@@ -1,15 +1,7 @@
#!/bin/bash -x
-# Copyright(c) 2015-2017 Intel Corporation. All rights reserved.
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of version 2 of the GNU General Public License as
-# published by the Free Software Foundation.
-#
-# 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.
+# Copyright(c) 2015-2020 Intel Corporation. All rights reserved.
+# SPDX-License-Identifier: GPL-2.0
rc=77
diff --git a/test/smart-listen.c b/test/smart-listen.c
index e365ce54c7bd..a42428ab6e58 100644
--- a/test/smart-listen.c
+++ b/test/smart-listen.c
@@ -1,5 +1,5 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-/* Copyright(c) 2017 Intel Corporation. All rights reserved. */
+// Copyright(c) 2017-2020 Intel Corporation. All rights reserved.
+// SPDX-License-Identifier: GPL-2.0
#include <poll.h>
#include <stdio.h>
#include <string.h>
diff --git a/test/smart-notify.c b/test/smart-notify.c
index e28e0f414efd..8312706ef2d5 100644
--- a/test/smart-notify.c
+++ b/test/smart-notify.c
@@ -1,5 +1,5 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-/* Copyright(c) 2017 Intel Corporation. All rights reserved. */
+// Copyright(c) 2017-2020 Intel Corporation. All rights reserved.
+// SPDX-License-Identifier: GPL-2.0
#include <stdio.h>
#include <string.h>
#include <unistd.h>
diff --git a/util/COPYING b/util/COPYING
deleted file mode 100644
index 3912109b5cd6..000000000000
--- a/util/COPYING
+++ /dev/null
@@ -1,340 +0,0 @@
- 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
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users. This
-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
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
- To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have. You must make sure that they, too, receive or can get the
-source code. And you must show them these terms so they know their
-rights.
-
- We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
- Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software. If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
- Finally, any free program is threatened constantly by software
-patents. We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary. To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- GNU GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License. The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language. (Hereinafter, translation is included without limitation in
-the term "modification".) Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
- 1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
- 2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) You must cause the modified files to carry prominent notices
- stating that you changed the files and the date of any change.
-
- b) You must cause any work that you distribute or publish, that in
- whole or in part contains or is derived from the Program or any
- part thereof, to be licensed as a whole at no charge to all third
- parties under the terms of this License.
-
- c) If the modified program normally reads commands interactively
- when run, you must cause it, when started running for such
- interactive use in the most ordinary way, to print or display an
- announcement including an appropriate copyright notice and a
- notice that there is no warranty (or else, saying that you provide
- a warranty) and that users may redistribute the program under
- these conditions, and telling the user how to view a copy of this
- 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
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
- a) Accompany it with the complete corresponding machine-readable
- source code, which must be distributed under the terms of Sections
- 1 and 2 above on a medium customarily used for software interchange; or,
-
- b) Accompany it with a written offer, valid for at least three
- years, to give any third party, for a charge no more than your
- cost of physically performing source distribution, a complete
- machine-readable copy of the corresponding source code, to be
- distributed under the terms of Sections 1 and 2 above on a medium
- customarily used for software interchange; or,
-
- c) Accompany it with the information you received as to the offer
- to distribute corresponding source code. (This alternative is
- allowed only for noncommercial distribution and only if you
- received the program in object code or executable form with such
- an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it. For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable. However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-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
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
- 5. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Program or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
- 6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
- 7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all. For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-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
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded. In such case, this License incorporates
-the limitation as if written in the body of this License.
-
- 9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation. If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
- 10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission. For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this. Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
- 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
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-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
-
- 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
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
- <one line to give the program's name and a brief idea of what it does.>
- Copyright (C) <year> <name of author>
-
- 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 St, Fifth Floor, Boston, MA 02110-1301 USA
-
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
- Gnomovision version 69, Copyright (C) year name of author
- Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- This is free software, and you are welcome to redistribute it
- under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License. Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the program
- `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
- <signature of Ty Coon>, 1 April 1989
- Ty Coon, President of Vice
-
-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
-Public License instead of this License.
diff --git a/util/abspath.c b/util/abspath.c
index e44236fa0da5..d59cc5d7bbf7 100644
--- a/util/abspath.c
+++ b/util/abspath.c
@@ -1,4 +1,5 @@
-/* SPDX-License-Identifier: GPL-2.0 */
+// SPDX-License-Identifier: GPL-2.0
+
/* originally copied from git/abspath.c */
#include <util/util.h>
diff --git a/util/bitmap.c b/util/bitmap.c
index 8df8a3253f10..86b5d02f8411 100644
--- a/util/bitmap.c
+++ b/util/bitmap.c
@@ -1,16 +1,6 @@
-/*
- * Copyright(c) 2017 Intel Corporation. All rights reserved.
- * Copyright(c) 2009 Akinobu Mita. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * 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.
- */
+// Copyright(c) 2017 Intel Corporation. All rights reserved.
+// Copyright(c) 2009 Akinobu Mita. All rights reserved.
+// SPDX-License-Identifier: GPL-2.0
/* originally copied from the Linux kernel bitmap implementation */
diff --git a/util/bitmap.h b/util/bitmap.h
index 11ef22cc657b..4783245adadb 100644
--- a/util/bitmap.h
+++ b/util/bitmap.h
@@ -1,15 +1,5 @@
-/*
- * Copyright(c) 2015-2017 Intel Corporation. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * 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.
- */
+// Copyright(c) 2015-2020 Intel Corporation. All rights reserved.
+// SPDX-License-Identifier: GPL-2.0
#ifndef _NDCTL_BITMAP_H_
#define _NDCTL_BITMAP_H_
diff --git a/util/filter.c b/util/filter.c
index 7c8debb3d42e..aa602f473b92 100644
--- a/util/filter.c
+++ b/util/filter.c
@@ -1,15 +1,5 @@
-/*
- * Copyright(c) 2015-2017 Intel Corporation. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * 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.
- */
+// Copyright(c) 2015-2020 Intel Corporation. All rights reserved.
+// SPDX-License-Identifier: GPL-2.0
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
diff --git a/util/filter.h b/util/filter.h
index ad3441cc3a16..939a39c52af3 100644
--- a/util/filter.h
+++ b/util/filter.h
@@ -1,15 +1,5 @@
-/*
- * Copyright(c) 2015-2017 Intel Corporation. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * 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.
- */
+// Copyright(c) 2015-2020 Intel Corporation. All rights reserved.
+// SPDX-License-Identifier: GPL-2.0
#ifndef _UTIL_FILTER_H_
#define _UTIL_FILTER_H_
#include <stdbool.h>
diff --git a/util/help.c b/util/help.c
index 2d57fa17791c..11b413eb2b1c 100644
--- a/util/help.c
+++ b/util/help.c
@@ -1,17 +1,7 @@
-/*
- * Copyright(c) 2015-2017 Intel Corporation. All rights reserved.
- * Copyright(c) 2008 Miklos Vajna. All rights reserved.
- * Copyright(c) 2006 Linus Torvalds. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * 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.
- */
+// Copyright(c) 2015-2020 Intel Corporation. All rights reserved.
+// Copyright(c) 2008 Miklos Vajna. All rights reserved.
+// Copyright(c) 2006 Linus Torvalds. All rights reserved.
+// SPDX-License-Identifier: GPL-2.0
/* originally copied from perf and git */
diff --git a/util/iomem.c b/util/iomem.c
index a3c23f5a9d1d..a5cd77bc670e 100644
--- a/util/iomem.c
+++ b/util/iomem.c
@@ -1,6 +1,5 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-/* Copyright(c) 2019 Intel Corporation. All rights reserved. */
-
+// Copyright(c) 2019-2020 Intel Corporation. All rights reserved.
+// SPDX-License-Identifier: GPL-2.0
#include <stdio.h>
#include <errno.h>
#include <string.h>
diff --git a/util/iomem.h b/util/iomem.h
index aaaf6a7026a5..70cef7816d12 100644
--- a/util/iomem.h
+++ b/util/iomem.h
@@ -1,5 +1,5 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-/* Copyright(c) 2019 Intel Corporation. All rights reserved. */
+// Copyright(c) 2019-2020 Intel Corporation. All rights reserved.
+// SPDX-License-Identifier: GPL-2.0
#ifndef _NDCTL_IOMEM_H_
#define _NDCTL_IOMEM_H_
diff --git a/util/json.c b/util/json.c
index 77bd4781551d..c928bf35a956 100644
--- a/util/json.c
+++ b/util/json.c
@@ -1,15 +1,5 @@
-/*
- * Copyright(c) 2015-2017 Intel Corporation. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * 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.
- */
+// Copyright(c) 2015-2020 Intel Corporation. All rights reserved.
+// SPDX-License-Identifier: GPL-2.0
#include <limits.h>
#include <string.h>
#include <util/json.h>
diff --git a/util/json.h b/util/json.h
index 39a33789bac9..30e229c62538 100644
--- a/util/json.h
+++ b/util/json.h
@@ -1,15 +1,5 @@
-/*
- * Copyright(c) 2015-2017 Intel Corporation. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * 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.
- */
+// Copyright(c) 2015-2020 Intel Corporation. All rights reserved.
+// SPDX-License-Identifier: GPL-2.0
#ifndef __NDCTL_JSON_H__
#define __NDCTL_JSON_H__
#include <stdio.h>
diff --git a/util/list.h b/util/list.h
index 6439aeff171e..17c78f44cbe0 100644
--- a/util/list.h
+++ b/util/list.h
@@ -1,15 +1,5 @@
-/*
- * Copyright(c) 2015-2017 Intel Corporation. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * 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.
- */
+// Copyright(c) 2015-2020 Intel Corporation. All rights reserved.
+// SPDX-License-Identifier: GPL-2.0
#ifndef _NDCTL_LIST_H_
#define _NDCTL_LIST_H_
diff --git a/util/log.c b/util/log.c
index c60ca3318e5b..a666861ef44e 100644
--- a/util/log.c
+++ b/util/log.c
@@ -1,15 +1,5 @@
-/*
- * Copyright (c) 2016, Intel Corporation.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU Lesser General Public License,
- * version 2.1, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
- * more details.
- */
+// Copyright (c) 2016-2020, Intel Corporation. All rights reserved.
+// SPDX-License-Identifier: LGPL-2.1
#include <syslog.h>
#include <stdlib.h>
#include <ctype.h>
diff --git a/util/log.h b/util/log.h
index 495e0d33c7f5..bf45771bb6de 100644
--- a/util/log.h
+++ b/util/log.h
@@ -1,15 +1,5 @@
-/*
- * Copyright (c) 2016, Intel Corporation.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU Lesser General Public License,
- * version 2.1, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
- * more details.
- */
+// Copyright (c) 2016-2020, Intel Corporation. All rights reserved.
+// SPDX-License-Identifier: LGPL-2.1
#ifndef __UTIL_LOG_H__
#define __UTIL_LOG_H__
#include <stdio.h>
diff --git a/util/main.c b/util/main.c
index 4f925f84966a..7e4012e23084 100644
--- a/util/main.c
+++ b/util/main.c
@@ -1,16 +1,6 @@
-/*
- * Copyright(c) 2015-2017 Intel Corporation. All rights reserved.
- * Copyright(c) 2006 Linus Torvalds. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * 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.
- */
+// Copyright(c) 2015-2020 Intel Corporation. All rights reserved.
+// Copyright(c) 2006 Linus Torvalds. All rights reserved.
+// SPDX-License-Identifier: GPL-2.0
/* originally copied from perf and git */
diff --git a/util/main.h b/util/main.h
index 35fb33e63049..8d5381b821e3 100644
--- a/util/main.h
+++ b/util/main.h
@@ -1,16 +1,6 @@
-/*
- * Copyright(c) 2015-2017 Intel Corporation. All rights reserved.
- * Copyright(c) 2006 Linus Torvalds. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * 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.
- */
+// Copyright(c) 2015-2020 Intel Corporation. All rights reserved.
+// Copyright(c) 2006 Linus Torvalds. All rights reserved.
+// SPDX-License-Identifier: GPL-2.0
/* originally copied from perf and git */
diff --git a/util/parse-options.c b/util/parse-options.c
index c78117426807..6ea581aa3b3c 100644
--- a/util/parse-options.c
+++ b/util/parse-options.c
@@ -1,15 +1,5 @@
-/*
- * Copyright(c) 2007 Pierre Habouzit. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * 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.
- */
+// Copyright(c) 2007 Pierre Habouzit. All rights reserved.
+// SPDX-License-Identifier: GPL-2.0
/* originally copied from perf and git */
diff --git a/util/parse-options.h b/util/parse-options.h
index fc5015a9c9c2..401de2962dda 100644
--- a/util/parse-options.h
+++ b/util/parse-options.h
@@ -1,15 +1,5 @@
-/*
- * Copyright(c) 2007 Pierre Habouzit. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * 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.
- */
+// Copyright(c) 2007 Pierre Habouzit. All rights reserved.
+// SPDX-License-Identifier: GPL-2.0
/* originally copied from perf and git */
diff --git a/util/size.c b/util/size.c
index 6efa91f6eef9..29aa2be8185b 100644
--- a/util/size.c
+++ b/util/size.c
@@ -1,15 +1,5 @@
-/*
- * Copyright(c) 2015-2017 Intel Corporation. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * 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.
- */
+// Copyright(c) 2015-2020 Intel Corporation. All rights reserved.
+// SPDX-License-Identifier: GPL-2.0
#include <stdlib.h>
#include <limits.h>
#include <util/size.h>
diff --git a/util/size.h b/util/size.h
index 2138989b42ac..9274c567164d 100644
--- a/util/size.h
+++ b/util/size.h
@@ -1,15 +1,5 @@
-/*
- * Copyright(c) 2015-2017 Intel Corporation. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * 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.
- */
+// Copyright(c) 2015-2020 Intel Corporation. All rights reserved.
+// SPDX-License-Identifier: GPL-2.0
#ifndef _NDCTL_SIZE_H_
#define _NDCTL_SIZE_H_
diff --git a/util/strbuf.c b/util/strbuf.c
index eaa5bedf7e60..219c4756bd28 100644
--- a/util/strbuf.c
+++ b/util/strbuf.c
@@ -1,15 +1,5 @@
-/*
- * Copyright(c) 2005 Junio C Hamano. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * 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.
- */
+// Copyright(c) 2005 Junio C Hamano. All rights reserved.
+// SPDX-License-Identifier: GPL-2.0
/* originally copied from perf and git */
diff --git a/util/strbuf.h b/util/strbuf.h
index 4cf8348dfd55..0fc4813f4699 100644
--- a/util/strbuf.h
+++ b/util/strbuf.h
@@ -1,15 +1,5 @@
-/*
- * Copyright(c) 2005 Junio C Hamano. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * 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.
- */
+// Copyright(c) 2005 Junio C Hamano. All rights reserved.
+// SPDX-License-Identifier: GPL-2.0
/* originally copied from perf and git */
diff --git a/util/sysfs.c b/util/sysfs.c
index 9f7bc1f4930f..51ff36aeeafa 100644
--- a/util/sysfs.c
+++ b/util/sysfs.c
@@ -1,15 +1,5 @@
-/*
- * Copyright (c) 2014-2016, Intel Corporation.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU Lesser General Public License,
- * version 2.1, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
- * more details.
- */
+// Copyright (c) 2014-2020, Intel Corporation. All rights reserved.
+// SPDX-License-Identifier: LGPL-2.1
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
diff --git a/util/sysfs.h b/util/sysfs.h
index fb169c6da80a..5561f74d0109 100644
--- a/util/sysfs.h
+++ b/util/sysfs.h
@@ -1,15 +1,5 @@
-/*
- * Copyright (c) 2014-2016, Intel Corporation.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU Lesser General Public License,
- * version 2.1, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
- * more details.
- */
+// Copyright (c) 2014-2020, Intel Corporation. All rights reserved.
+// SPDX-License-Identifier: LGPL-2.1
#ifndef __UTIL_SYSFS_H__
#define __UTIL_SYSFS_H__
diff --git a/util/usage.c b/util/usage.c
index 0896955c7f52..827a5abbe0b0 100644
--- a/util/usage.c
+++ b/util/usage.c
@@ -1,15 +1,5 @@
-/*
- * Copyright(c) 2005 Linus Torvalds. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * 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.
- */
+// Copyright(c) 2005 Linus Torvalds. All rights reserved.
+// SPDX-License-Identifier: GPL-2.0
/* originally copied from perf and git */
diff --git a/util/util.h b/util/util.h
index 54c6ef18b6d7..8519ec80906f 100644
--- a/util/util.h
+++ b/util/util.h
@@ -1,16 +1,6 @@
-/*
- * Copyright(c) 2005 Junio C Hamano. All rights reserved.
- * Copyright(c) 2005 Linus Torvalds. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * 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.
- */
+// Copyright(c) 2005 Junio C Hamano. All rights reserved.
+// Copyright(c) 2005 Linus Torvalds. All rights reserved.
+// SPDX-License-Identifier: GPL-2.0
/* originally copied from perf and git */
diff --git a/util/wrapper.c b/util/wrapper.c
index b0de7bc92bb1..2ff9eb9b231f 100644
--- a/util/wrapper.c
+++ b/util/wrapper.c
@@ -1,16 +1,6 @@
-/*
- * Copyright(c) 2005 Junio C Hamano. All rights reserved.
- * Copyright(c) 2005 Linus Torvalds. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * 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.
- */
+// Copyright(c) 2005 Junio C Hamano. All rights reserved.
+// Copyright(c) 2005 Linus Torvalds. All rights reserved.
+// SPDX-License-Identifier: GPL-2.0
/* originally copied from perf and git */
1 year, 9 months
Re: [EXT] Re: [PATCH v2 00/22] add Object Storage Media Pool (mpool)
by Dan Williams
On Wed, Oct 21, 2020 at 10:11 AM Nabeel Meeramohideen Mohamed
(nmeeramohide) <nmeeramohide(a)micron.com> wrote:
>
> On Tuesday, October 20, 2020 3:36 PM, Dan Williams <dan.j.williams(a)intel.com> wrote:
> >
> > What does Linux get from merging mpool?
> >
>
> What Linux gets from merging mpool is a generic object store target with some
> unique and beneficial features:
I'll try to make the point a different way. Mpool points out places
where the existing apis fail to scale. Rather than attempt to fix that
problem it proposes to replace the old apis. However, the old apis are
still there. So now upstream has 2 maintenance burdens when it could
have just had one. So when I ask "what does Linux get" it is in
reference to the fact that Linux gets a compounded maintenance problem
and whether the benefits of mpool outweigh that burden. Historically
Linux has been able to evolve to meet the scaling requirements of new
applications, so I am asking whether you have tried to solve the
application problem by evolving rather than replacing existing
infrastructure? The justification to replace rather than evolve is
high because that's how core Linux stays relevant.
1 year, 9 months
Re: [EXT] Re: [PATCH v2 00/22] add Object Storage Media Pool (mpool)
by Dan Williams
On Mon, Oct 19, 2020 at 3:30 PM Nabeel Meeramohideen Mohamed
(nmeeramohide) <nmeeramohide(a)micron.com> wrote:
>
> Hi Dan,
>
> On Friday, October 16, 2020 4:12 PM, Dan Williams <dan.j.williams(a)intel.com> wrote:
> >
> > On Fri, Oct 16, 2020 at 2:59 PM Nabeel Meeramohideen Mohamed
> > (nmeeramohide) <nmeeramohide(a)micron.com> wrote:
> > >
> > > On Thursday, October 15, 2020 2:03 AM, Christoph Hellwig
> > <hch(a)infradead.org> wrote:
> > > > I don't think this belongs into the kernel. It is a classic case for
> > > > infrastructure that should be built in userspace. If anything is
> > > > missing to implement it in userspace with equivalent performance we
> > > > need to improve out interfaces, although io_uring should cover pretty
> > > > much everything you need.
> > >
> > > Hi Christoph,
> > >
> > > We previously considered moving the mpool object store code to user-space.
> > > However, by implementing mpool as a device driver, we get several benefits
> > > in terms of scalability, performance, and functionality. In doing so, we relied
> > > only on standard interfaces and did not make any changes to the kernel.
> > >
> > > (1) mpool's "mcache map" facility allows us to memory-map (and later unmap)
> > > a collection of logically related objects with a single system call. The objects in
> > > such a collection are created at different times, physically disparate, and may
> > > even reside on different media class volumes.
> > >
> > > For our HSE storage engine application, there are commonly 10's to 100's of
> > > objects in a given mcache map, and 75,000 total objects mapped at a given
> > time.
> > >
> > > Compared to memory-mapping objects individually, the mcache map facility
> > > scales well because it requires only a single system call and single
> > vm_area_struct
> > > to memory-map a complete collection of objects.
>
> > Why can't that be a batch of mmap calls on io_uring?
>
> Agreed, we could add the capability to invoke mmap via io_uring to help mitigate the
> system call overhead of memory-mapping individual objects, versus our mache map
> mechanism. However, there is still the scalability issue of having a vm_area_struct
> for each object (versus one for each mache map).
>
> We ran YCSB workload C in two different configurations -
> Config 1: memory-mapping each individual object
> Config 2: memory-mapping a collection of related objects using mcache map
>
> - Config 1 incurred ~3.3x additional kernel memory for the vm_area_struct slab -
> 24.8 MB (127188 objects) for config 1, versus 7.3 MB (37482 objects) for config 2.
>
> - Workload C exhibited around 10-25% better tail latencies (4-nines) for config 2,
> not sure if it's due the reduced complexity of searching VMAs during page faults.
So this gets to the meta question that is giving me pause on this
whole proposal:
What does Linux get from merging mpool?
What you have above is a decent scalability bug report. That type of
pressure to meet new workload needs is how Linux interfaces evolve.
However, rather than evolve those interfaces mpool is a revolutionary
replacement that leaves the bugs intact for everyone that does not
switch over to mpool.
Consider io_uring as an example where the kernel resisted trends
towards userspace I/O engines and instead evolved a solution that
maintained kernel control while also achieving similar performance
levels.
The exercise is useful to identify places where Linux has
deficiencies, but wholesale replacing an entire I/O submission model
is a direction that leaves the old apis to rot.
1 year, 9 months
[RFC PATCH 0/4] powerpc/papr_scm: Add support for reporting NVDIMM performance statistics
by Vaibhav Jain
The patch-set proposes to add support for fetching and reporting
performance statistics for PAPR compliant NVDIMMs as described in
documentation for H_SCM_PERFORMANCE_STATS hcall Ref[1]. The patch-set
also implements mechanisms to expose NVDIMM performance stats via
sysfs and newly introduced PDSMs[2] for libndctl.
This patch-set combined with corresponding ndctl and libndctl changes
proposed at Ref[3] should enable user to fetch PAPR compliant NVDIMMs
using following command:
# ndctl list -D --stats
[
{
"dev":"nmem0",
"stats":{
"Controller Reset Count":2,
"Controller Reset Elapsed Time":603331,
"Power-on Seconds":603931,
"Life Remaining":"100%",
"Critical Resource Utilization":"0%",
"Host Load Count":5781028,
"Host Store Count":8966800,
"Host Load Duration":975895365,
"Host Store Duration":716230690,
"Media Read Count":0,
"Media Write Count":6313,
"Media Read Duration":0,
"Media Write Duration":9679615,
"Cache Read Hit Count":5781028,
"Cache Write Hit Count":8442479,
"Fast Write Count":8969912
}
}
]
The patchset is dependent on existing patch-set "[PATCH v7 0/5]
powerpc/papr_scm: Add support for reporting nvdimm health" available
at Ref[2] that adds support for reporting PAPR compliant NVDIMMs in
'papr_scm' kernel module.
Structure of the patch-set
==========================
The patch-set starts with implementing functionality in papr_scm
module to issue H_SCM_PERFORMANCE_STATS hcall, fetch & parse dimm
performance stats and exposing them as a PAPR specific libnvdimm
attribute named 'perf_stats'
Patch-2 introduces a new PDSM named FETCH_PERF_STATS that can be
issued by libndctl asking papr_scm to issue the
H_SCM_PERFORMANCE_STATS hcall using helpers introduced earlier and
storing the results in a dimm specific perf-stats-buffer.
Patch-3 introduces a new PDSM named READ_PERF_STATS that can be
issued by libndctl to read the perf-stats-buffer in an incremental
manner to workaround the 256-bytes envelop limitation of libnvdimm.
Finally Patch-4 introduces a new PDSM named GET_PERF_STAT that can be
issued by libndctl to read values of a specific NVDIMM performance
stat like "Life Remaining".
References
==========
[1] Documentation/powerpc/papr_hcals.rst
[2] https://lore.kernel.org/linux-nvdimm/20200508104922.72565-1-vaibhav@linux...
[3] https://github.com/vaibhav92/ndctl/tree/papr_scm_stats_v1
Vaibhav Jain (4):
powerpc/papr_scm: Fetch nvdimm performance stats from PHYP
powerpc/papr_scm: Add support for PAPR_SCM_PDSM_FETCH_PERF_STATS
powerpc/papr_scm: Implement support for PAPR_SCM_PDSM_READ_PERF_STATS
powerpc/papr_scm: Add support for PDSM GET_PERF_STAT
Documentation/ABI/testing/sysfs-bus-papr-scm | 27 ++
arch/powerpc/include/uapi/asm/papr_scm_pdsm.h | 60 +++
arch/powerpc/platforms/pseries/papr_scm.c | 391 ++++++++++++++++++
3 files changed, 478 insertions(+)
--
2.26.2
1 year, 9 months
Re: [EXT] Re: [PATCH v2 00/22] add Object Storage Media Pool (mpool)
by Dan Williams
On Fri, Oct 16, 2020 at 2:59 PM Nabeel Meeramohideen Mohamed
(nmeeramohide) <nmeeramohide(a)micron.com> wrote:
>
> On Thursday, October 15, 2020 2:03 AM, Christoph Hellwig <hch(a)infradead.org> wrote:
> > I don't think this belongs into the kernel. It is a classic case for
> > infrastructure that should be built in userspace. If anything is
> > missing to implement it in userspace with equivalent performance we
> > need to improve out interfaces, although io_uring should cover pretty
> > much everything you need.
>
> Hi Christoph,
>
> We previously considered moving the mpool object store code to user-space.
> However, by implementing mpool as a device driver, we get several benefits
> in terms of scalability, performance, and functionality. In doing so, we relied
> only on standard interfaces and did not make any changes to the kernel.
>
> (1) mpool's "mcache map" facility allows us to memory-map (and later unmap)
> a collection of logically related objects with a single system call. The objects in
> such a collection are created at different times, physically disparate, and may
> even reside on different media class volumes.
>
> For our HSE storage engine application, there are commonly 10's to 100's of
> objects in a given mcache map, and 75,000 total objects mapped at a given time.
>
> Compared to memory-mapping objects individually, the mcache map facility
> scales well because it requires only a single system call and single vm_area_struct
> to memory-map a complete collection of objects.
Why can't that be a batch of mmap calls on io_uring?
> (2) The mcache map reaper mechanism proactively evicts object data from the page
> cache based on object-level metrics. This provides significant performance benefit
> for many workloads.
>
> For example, we ran YCSB workloads B (95/5 read/write mix) and C (100% read)
> against our HSE storage engine using the mpool driver in a 5.9 kernel.
> For each workload, we ran with the reaper turned-on and turned-off.
>
> For workload B, the reaper increased throughput 1.77x, while reducing 99.99% tail
> latency for reads by 39% and updates by 99%. For workload C, the reaper increased
> throughput by 1.84x, while reducing the 99.99% read tail latency by 63%. These
> improvements are even more dramatic with earlier kernels.
What metrics proved useful and can the vanilla page cache / page
reclaim mechanism be augmented with those metrics?
>
> (3) The mcache map facility can memory-map objects on NVMe ZNS drives that were
> created using the Zone Append command. This patch set does not support ZNS, but
> that work is in progress and we will be demonstrating our HSE storage engine
> running on mpool with ZNS drives at FMS 2020.
>
> (4) mpool's immutable object model allows the driver to support concurrent reading
> of object data directly and memory-mapped without a performance penalty to verify
> coherence. This allows background operations, such as LSM-tree compaction, to
> operate efficiently and without polluting the page cache.
>
How is this different than existing background operations / defrag
that filesystems perform today? Where are the opportunities to improve
those operations?
> (5) Representing an mpool as a /dev/mpool/<mpool-name> device file provides a
> convenient mechanism for controlling access to and managing the multiple storage
> volumes, and in the future pmem devices, that may comprise an logical mpool.
Christoph and I have talked about replacing the pmem driver's
dependence on device-mapper for pooling. What extensions would be
needed for the existing driver arch?
1 year, 9 months
[RFC] treewide: cleanup unreachable breaks
by trix@redhat.com
From: Tom Rix <trix(a)redhat.com>
This is a upcoming change to clean up a new warning treewide.
I am wondering if the change could be one mega patch (see below) or
normal patch per file about 100 patches or somewhere half way by collecting
early acks.
clang has a number of useful, new warnings see
https://clang.llvm.org/docs/DiagnosticsReference.html
This change cleans up -Wunreachable-code-break
https://clang.llvm.org/docs/DiagnosticsReference.html#wunreachable-code-b...
for 266 of 485 warnings in this week's linux-next, allyesconfig on x86_64.
The method of fixing was to look for warnings where the preceding statement
was a simple statement and by inspection made the subsequent break unneeded.
In order of frequency these look like
return and break
switch (c->x86_vendor) {
case X86_VENDOR_INTEL:
intel_p5_mcheck_init(c);
return 1;
- break;
goto and break
default:
operation = 0; /* make gcc happy */
goto fail_response;
- break;
break and break
case COLOR_SPACE_SRGB:
/* by pass */
REG_SET(OUTPUT_CSC_CONTROL, 0,
OUTPUT_CSC_GRPH_MODE, 0);
break;
- break;
The exception to the simple statement, is a switch case with a block
and the end of block is a return
struct obj_buffer *buff = r->ptr;
return scnprintf(str, PRIV_STR_SIZE,
"size=%u\naddr=0x%X\n", buff->size,
buff->addr);
}
- break;
Not considered obvious and excluded, breaks after
multi level switches
complicated if-else if-else blocks
panic() or similar calls
And there is an odd addition of a 'fallthrough' in drivers/tty/nozomi.c
Tom
---
diff --git a/arch/x86/kernel/cpu/mce/core.c b/arch/x86/kernel/cpu/mce/core.c
index 1c08cb9eb9f6..16ce86aed8e2 100644
--- a/arch/x86/kernel/cpu/mce/core.c
+++ b/arch/x86/kernel/cpu/mce/core.c
@@ -1809,15 +1809,13 @@ static int __mcheck_cpu_ancient_init(struct cpuinfo_x86 *c)
switch (c->x86_vendor) {
case X86_VENDOR_INTEL:
intel_p5_mcheck_init(c);
return 1;
- break;
case X86_VENDOR_CENTAUR:
winchip_mcheck_init(c);
return 1;
- break;
default:
return 0;
}
return 0;
diff --git a/arch/x86/kernel/cpu/microcode/amd.c b/arch/x86/kernel/cpu/microcode/amd.c
index 3f6b137ef4e6..3d4a48336084 100644
--- a/arch/x86/kernel/cpu/microcode/amd.c
+++ b/arch/x86/kernel/cpu/microcode/amd.c
@@ -213,11 +213,10 @@ static unsigned int __verify_patch_size(u8 family, u32 sh_psize, size_t buf_size
max_size = F14H_MPB_MAX_SIZE;
break;
default:
WARN(1, "%s: WTF family: 0x%x\n", __func__, family);
return 0;
- break;
}
if (sh_psize > min_t(u32, buf_size, max_size))
return 0;
diff --git a/drivers/acpi/utils.c b/drivers/acpi/utils.c
index 838b719ec7ce..d5411a166685 100644
--- a/drivers/acpi/utils.c
+++ b/drivers/acpi/utils.c
@@ -102,11 +102,10 @@ acpi_extract_package(union acpi_object *package,
printk(KERN_WARNING PREFIX "Invalid package element"
" [%d]: got number, expecting"
" [%c]\n",
i, format_string[i]);
return AE_BAD_DATA;
- break;
}
break;
case ACPI_TYPE_STRING:
case ACPI_TYPE_BUFFER:
@@ -127,11 +126,10 @@ acpi_extract_package(union acpi_object *package,
printk(KERN_WARNING PREFIX "Invalid package element"
" [%d] got string/buffer,"
" expecting [%c]\n",
i, format_string[i]);
return AE_BAD_DATA;
- break;
}
break;
case ACPI_TYPE_LOCAL_REFERENCE:
switch (format_string[i]) {
case 'R':
@@ -142,22 +140,20 @@ acpi_extract_package(union acpi_object *package,
printk(KERN_WARNING PREFIX "Invalid package element"
" [%d] got reference,"
" expecting [%c]\n",
i, format_string[i]);
return AE_BAD_DATA;
- break;
}
break;
case ACPI_TYPE_PACKAGE:
default:
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"Found unsupported element at index=%d\n",
i));
/* TBD: handle nested packages... */
return AE_SUPPORT;
- break;
}
}
/*
* Validate output buffer.
diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c
index 205a06752ca9..c7ac49042cee 100644
--- a/drivers/base/power/main.c
+++ b/drivers/base/power/main.c
@@ -361,11 +361,10 @@ static pm_callback_t pm_op(const struct dev_pm_ops *ops, pm_message_t state)
case PM_EVENT_HIBERNATE:
return ops->poweroff;
case PM_EVENT_THAW:
case PM_EVENT_RECOVER:
return ops->thaw;
- break;
case PM_EVENT_RESTORE:
return ops->restore;
#endif /* CONFIG_HIBERNATE_CALLBACKS */
}
diff --git a/drivers/block/xen-blkback/blkback.c b/drivers/block/xen-blkback/blkback.c
index adfc9352351d..f769fbd1b4c4 100644
--- a/drivers/block/xen-blkback/blkback.c
+++ b/drivers/block/xen-blkback/blkback.c
@@ -1267,11 +1267,10 @@ static int dispatch_rw_block_io(struct xen_blkif_ring *ring,
operation_flags = REQ_PREFLUSH;
break;
default:
operation = 0; /* make gcc happy */
goto fail_response;
- break;
}
/* Check that the number of segments is sane. */
nseg = req->operation == BLKIF_OP_INDIRECT ?
req->u.indirect.nr_segments : req->u.rw.nr_segments;
diff --git a/drivers/char/ipmi/ipmi_devintf.c b/drivers/char/ipmi/ipmi_devintf.c
index f7b1c004a12b..3dd1d5abb298 100644
--- a/drivers/char/ipmi/ipmi_devintf.c
+++ b/drivers/char/ipmi/ipmi_devintf.c
@@ -488,11 +488,10 @@ static long ipmi_ioctl(struct file *file,
rv = -EFAULT;
break;
}
return ipmi_set_my_address(priv->user, val.channel, val.value);
- break;
}
case IPMICTL_GET_MY_CHANNEL_ADDRESS_CMD:
{
struct ipmi_channel_lun_address_set val;
diff --git a/drivers/char/lp.c b/drivers/char/lp.c
index 0ec73917d8dd..862c2fd933c7 100644
--- a/drivers/char/lp.c
+++ b/drivers/char/lp.c
@@ -620,11 +620,10 @@ static int lp_do_ioctl(unsigned int minor, unsigned int cmd,
case LPWAIT:
LP_WAIT(minor) = arg;
break;
case LPSETIRQ:
return -EINVAL;
- break;
case LPGETIRQ:
if (copy_to_user(argp, &LP_IRQ(minor),
sizeof(int)))
return -EFAULT;
break;
diff --git a/drivers/char/mwave/mwavedd.c b/drivers/char/mwave/mwavedd.c
index e43c876a9223..11272d605ecd 100644
--- a/drivers/char/mwave/mwavedd.c
+++ b/drivers/char/mwave/mwavedd.c
@@ -401,11 +401,10 @@ static long mwave_ioctl(struct file *file, unsigned int iocmd,
}
break;
default:
return -ENOTTY;
- break;
} /* switch */
PRINTK_2(TRACE_MWAVE, "mwavedd::mwave_ioctl, exit retval %x\n", retval);
return retval;
diff --git a/drivers/crypto/atmel-sha.c b/drivers/crypto/atmel-sha.c
index 75ccf41a7cb9..0eb6f54e3b66 100644
--- a/drivers/crypto/atmel-sha.c
+++ b/drivers/crypto/atmel-sha.c
@@ -457,11 +457,10 @@ static int atmel_sha_init(struct ahash_request *req)
ctx->flags |= SHA_FLAGS_SHA512;
ctx->block_size = SHA512_BLOCK_SIZE;
break;
default:
return -EINVAL;
- break;
}
ctx->bufcnt = 0;
ctx->digcnt[0] = 0;
ctx->digcnt[1] = 0;
diff --git a/drivers/edac/amd64_edac.c b/drivers/edac/amd64_edac.c
index fcc08bbf6945..386a3a4cf279 100644
--- a/drivers/edac/amd64_edac.c
+++ b/drivers/edac/amd64_edac.c
@@ -2459,38 +2459,30 @@ static int map_err_sym_to_channel(int err_sym, int sym_size)
if (sym_size == 4)
switch (err_sym) {
case 0x20:
case 0x21:
return 0;
- break;
case 0x22:
case 0x23:
return 1;
- break;
default:
return err_sym >> 4;
- break;
}
/* x8 symbols */
else
switch (err_sym) {
/* imaginary bits not in a DIMM */
case 0x10:
WARN(1, KERN_ERR "Invalid error symbol: 0x%x\n",
err_sym);
return -1;
- break;
-
case 0x11:
return 0;
- break;
case 0x12:
return 1;
- break;
default:
return err_sym >> 3;
- break;
}
return -1;
}
static int get_channel_from_ecc_syndrome(struct mem_ctl_info *mci, u16 syndrome)
diff --git a/drivers/gpio/gpio-bd70528.c b/drivers/gpio/gpio-bd70528.c
index 45b3da8da336..931e5765fe92 100644
--- a/drivers/gpio/gpio-bd70528.c
+++ b/drivers/gpio/gpio-bd70528.c
@@ -69,21 +69,18 @@ static int bd70528_gpio_set_config(struct gpio_chip *chip, unsigned int offset,
case PIN_CONFIG_DRIVE_OPEN_DRAIN:
return regmap_update_bits(bdgpio->chip.regmap,
GPIO_OUT_REG(offset),
BD70528_GPIO_DRIVE_MASK,
BD70528_GPIO_OPEN_DRAIN);
- break;
case PIN_CONFIG_DRIVE_PUSH_PULL:
return regmap_update_bits(bdgpio->chip.regmap,
GPIO_OUT_REG(offset),
BD70528_GPIO_DRIVE_MASK,
BD70528_GPIO_PUSH_PULL);
- break;
case PIN_CONFIG_INPUT_DEBOUNCE:
return bd70528_set_debounce(bdgpio, offset,
pinconf_to_config_argument(config));
- break;
default:
break;
}
return -ENOTSUPP;
}
diff --git a/drivers/gpu/drm/amd/display/dc/dce/dce_transform.c b/drivers/gpu/drm/amd/display/dc/dce/dce_transform.c
index 2a32b66959ba..130a0a0c8332 100644
--- a/drivers/gpu/drm/amd/display/dc/dce/dce_transform.c
+++ b/drivers/gpu/drm/amd/display/dc/dce/dce_transform.c
@@ -1328,11 +1328,10 @@ static bool configure_graphics_mode(
case COLOR_SPACE_SRGB:
/* by pass */
REG_SET(OUTPUT_CSC_CONTROL, 0,
OUTPUT_CSC_GRPH_MODE, 0);
break;
- break;
case COLOR_SPACE_SRGB_LIMITED:
/* TV RGB */
REG_SET(OUTPUT_CSC_CONTROL, 0,
OUTPUT_CSC_GRPH_MODE, 1);
break;
diff --git a/drivers/gpu/drm/amd/display/dc/dce100/dce100_resource.c b/drivers/gpu/drm/amd/display/dc/dce100/dce100_resource.c
index d741787f75dc..42c7d157da32 100644
--- a/drivers/gpu/drm/amd/display/dc/dce100/dce100_resource.c
+++ b/drivers/gpu/drm/amd/display/dc/dce100/dce100_resource.c
@@ -416,29 +416,22 @@ static int map_transmitter_id_to_phy_instance(
enum transmitter transmitter)
{
switch (transmitter) {
case TRANSMITTER_UNIPHY_A:
return 0;
- break;
case TRANSMITTER_UNIPHY_B:
return 1;
- break;
case TRANSMITTER_UNIPHY_C:
return 2;
- break;
case TRANSMITTER_UNIPHY_D:
return 3;
- break;
case TRANSMITTER_UNIPHY_E:
return 4;
- break;
case TRANSMITTER_UNIPHY_F:
return 5;
- break;
case TRANSMITTER_UNIPHY_G:
return 6;
- break;
default:
ASSERT(0);
return 0;
}
}
diff --git a/drivers/gpu/drm/amd/display/dc/dce110/dce110_resource.c b/drivers/gpu/drm/amd/display/dc/dce110/dce110_resource.c
index 2bbfa2e176a9..382581c4a674 100644
--- a/drivers/gpu/drm/amd/display/dc/dce110/dce110_resource.c
+++ b/drivers/gpu/drm/amd/display/dc/dce110/dce110_resource.c
@@ -469,29 +469,22 @@ static int map_transmitter_id_to_phy_instance(
enum transmitter transmitter)
{
switch (transmitter) {
case TRANSMITTER_UNIPHY_A:
return 0;
- break;
case TRANSMITTER_UNIPHY_B:
return 1;
- break;
case TRANSMITTER_UNIPHY_C:
return 2;
- break;
case TRANSMITTER_UNIPHY_D:
return 3;
- break;
case TRANSMITTER_UNIPHY_E:
return 4;
- break;
case TRANSMITTER_UNIPHY_F:
return 5;
- break;
case TRANSMITTER_UNIPHY_G:
return 6;
- break;
default:
ASSERT(0);
return 0;
}
}
diff --git a/drivers/gpu/drm/amd/display/dc/dce112/dce112_resource.c b/drivers/gpu/drm/amd/display/dc/dce112/dce112_resource.c
index b622b4b1dac3..7b4b2304bbff 100644
--- a/drivers/gpu/drm/amd/display/dc/dce112/dce112_resource.c
+++ b/drivers/gpu/drm/amd/display/dc/dce112/dce112_resource.c
@@ -444,29 +444,22 @@ static int map_transmitter_id_to_phy_instance(
enum transmitter transmitter)
{
switch (transmitter) {
case TRANSMITTER_UNIPHY_A:
return 0;
- break;
case TRANSMITTER_UNIPHY_B:
return 1;
- break;
case TRANSMITTER_UNIPHY_C:
return 2;
- break;
case TRANSMITTER_UNIPHY_D:
return 3;
- break;
case TRANSMITTER_UNIPHY_E:
return 4;
- break;
case TRANSMITTER_UNIPHY_F:
return 5;
- break;
case TRANSMITTER_UNIPHY_G:
return 6;
- break;
default:
ASSERT(0);
return 0;
}
}
diff --git a/drivers/gpu/drm/amd/display/dc/dce120/dce120_resource.c b/drivers/gpu/drm/amd/display/dc/dce120/dce120_resource.c
index 16fe7344702f..3d782b7c86cb 100644
--- a/drivers/gpu/drm/amd/display/dc/dce120/dce120_resource.c
+++ b/drivers/gpu/drm/amd/display/dc/dce120/dce120_resource.c
@@ -381,29 +381,22 @@ static int map_transmitter_id_to_phy_instance(
enum transmitter transmitter)
{
switch (transmitter) {
case TRANSMITTER_UNIPHY_A:
return 0;
- break;
case TRANSMITTER_UNIPHY_B:
return 1;
- break;
case TRANSMITTER_UNIPHY_C:
return 2;
- break;
case TRANSMITTER_UNIPHY_D:
return 3;
- break;
case TRANSMITTER_UNIPHY_E:
return 4;
- break;
case TRANSMITTER_UNIPHY_F:
return 5;
- break;
case TRANSMITTER_UNIPHY_G:
return 6;
- break;
default:
ASSERT(0);
return 0;
}
}
diff --git a/drivers/gpu/drm/amd/display/dc/dce60/dce60_resource.c b/drivers/gpu/drm/amd/display/dc/dce60/dce60_resource.c
index 5a5a9cb77acb..e9dd78c484d6 100644
--- a/drivers/gpu/drm/amd/display/dc/dce60/dce60_resource.c
+++ b/drivers/gpu/drm/amd/display/dc/dce60/dce60_resource.c
@@ -451,29 +451,22 @@ static int map_transmitter_id_to_phy_instance(
enum transmitter transmitter)
{
switch (transmitter) {
case TRANSMITTER_UNIPHY_A:
return 0;
- break;
case TRANSMITTER_UNIPHY_B:
return 1;
- break;
case TRANSMITTER_UNIPHY_C:
return 2;
- break;
case TRANSMITTER_UNIPHY_D:
return 3;
- break;
case TRANSMITTER_UNIPHY_E:
return 4;
- break;
case TRANSMITTER_UNIPHY_F:
return 5;
- break;
case TRANSMITTER_UNIPHY_G:
return 6;
- break;
default:
ASSERT(0);
return 0;
}
}
diff --git a/drivers/gpu/drm/amd/display/dc/dce80/dce80_resource.c b/drivers/gpu/drm/amd/display/dc/dce80/dce80_resource.c
index 0eae8cd35f9a..9dbf658162cd 100644
--- a/drivers/gpu/drm/amd/display/dc/dce80/dce80_resource.c
+++ b/drivers/gpu/drm/amd/display/dc/dce80/dce80_resource.c
@@ -456,29 +456,22 @@ static int map_transmitter_id_to_phy_instance(
enum transmitter transmitter)
{
switch (transmitter) {
case TRANSMITTER_UNIPHY_A:
return 0;
- break;
case TRANSMITTER_UNIPHY_B:
return 1;
- break;
case TRANSMITTER_UNIPHY_C:
return 2;
- break;
case TRANSMITTER_UNIPHY_D:
return 3;
- break;
case TRANSMITTER_UNIPHY_E:
return 4;
- break;
case TRANSMITTER_UNIPHY_F:
return 5;
- break;
case TRANSMITTER_UNIPHY_G:
return 6;
- break;
default:
ASSERT(0);
return 0;
}
}
diff --git a/drivers/gpu/drm/mgag200/mgag200_mode.c b/drivers/gpu/drm/mgag200/mgag200_mode.c
index 38672f9e5c4f..bbe4e60dfd08 100644
--- a/drivers/gpu/drm/mgag200/mgag200_mode.c
+++ b/drivers/gpu/drm/mgag200/mgag200_mode.c
@@ -792,25 +792,20 @@ static int mgag200_crtc_set_plls(struct mga_device *mdev, long clock)
case G200_AGP:
return mgag200_g200_set_plls(mdev, clock);
case G200_SE_A:
case G200_SE_B:
return mga_g200se_set_plls(mdev, clock);
- break;
case G200_WB:
case G200_EW3:
return mga_g200wb_set_plls(mdev, clock);
- break;
case G200_EV:
return mga_g200ev_set_plls(mdev, clock);
- break;
case G200_EH:
case G200_EH3:
return mga_g200eh_set_plls(mdev, clock);
- break;
case G200_ER:
return mga_g200er_set_plls(mdev, clock);
- break;
}
misc = RREG8(MGA_MISC_IN);
misc &= ~MGAREG_MISC_CLK_SEL_MASK;
misc |= MGAREG_MISC_CLK_SEL_MGA_MSK;
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/pll.c b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/pll.c
index 350f10a3de37..2ec84b8a3b3a 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/pll.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/pll.c
@@ -121,11 +121,10 @@ pll_map(struct nvkm_bios *bios)
case NV_10:
case NV_11:
case NV_20:
case NV_30:
return nv04_pll_mapping;
- break;
case NV_40:
return nv40_pll_mapping;
case NV_50:
if (device->chipset == 0x50)
return nv50_pll_mapping;
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/clk/mcp77.c b/drivers/gpu/drm/nouveau/nvkm/subdev/clk/mcp77.c
index efa50274df97..4884eb4a9221 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/clk/mcp77.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/clk/mcp77.c
@@ -138,21 +138,18 @@ mcp77_clk_read(struct nvkm_clk *base, enum nv_clk_src src)
case 0x00000030: return read_pll(clk, 0x004020) >> P;
}
break;
case nv_clk_src_mem:
return 0;
- break;
case nv_clk_src_vdec:
P = (read_div(clk) & 0x00000700) >> 8;
switch (mast & 0x00400000) {
case 0x00400000:
return nvkm_clk_read(&clk->base, nv_clk_src_core) >> P;
- break;
default:
return 500000 >> P;
- break;
}
break;
default:
break;
}
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramnv50.c b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramnv50.c
index 2ccb4b6be153..7b1eb44ff3da 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramnv50.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramnv50.c
@@ -169,11 +169,10 @@ nv50_ram_timing_read(struct nv50_ram *ram, u32 *timing)
case NVKM_RAM_TYPE_GDDR3:
T(CWL) = ((timing[2] & 0xff000000) >> 24) + 1;
break;
default:
return -ENOSYS;
- break;
}
T(WR) = ((timing[1] >> 24) & 0xff) - 1 - T(CWL);
return 0;
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/top/gk104.c b/drivers/gpu/drm/nouveau/nvkm/subdev/top/gk104.c
index e01746ce9fc4..1156634533f9 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/top/gk104.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/top/gk104.c
@@ -88,11 +88,10 @@ gk104_top_oneinit(struct nvkm_top *top)
case 0x0000000e: B_(NVENC ); break;
case 0x0000000f: A_(NVENC1); break;
case 0x00000010: B_(NVDEC ); break;
case 0x00000013: B_(CE ); break;
case 0x00000014: C_(GSP ); break;
- break;
default:
break;
}
nvkm_debug(subdev, "%02x.%d (%8s): addr %06x fault %2d "
diff --git a/drivers/gpu/drm/qxl/qxl_ioctl.c b/drivers/gpu/drm/qxl/qxl_ioctl.c
index 5cea6eea72ab..2072ddc9549c 100644
--- a/drivers/gpu/drm/qxl/qxl_ioctl.c
+++ b/drivers/gpu/drm/qxl/qxl_ioctl.c
@@ -158,11 +158,10 @@ static int qxl_process_single_command(struct qxl_device *qdev,
case QXL_CMD_SURFACE:
case QXL_CMD_CURSOR:
default:
DRM_DEBUG("Only draw commands in execbuffers\n");
return -EINVAL;
- break;
}
if (cmd->command_size > PAGE_SIZE - sizeof(union qxl_release_info))
return -EINVAL;
diff --git a/drivers/iio/adc/meson_saradc.c b/drivers/iio/adc/meson_saradc.c
index e03988698755..66dc452d643a 100644
--- a/drivers/iio/adc/meson_saradc.c
+++ b/drivers/iio/adc/meson_saradc.c
@@ -591,17 +591,15 @@ static int meson_sar_adc_iio_info_read_raw(struct iio_dev *indio_dev,
switch (mask) {
case IIO_CHAN_INFO_RAW:
return meson_sar_adc_get_sample(indio_dev, chan, NO_AVERAGING,
ONE_SAMPLE, val);
- break;
case IIO_CHAN_INFO_AVERAGE_RAW:
return meson_sar_adc_get_sample(indio_dev, chan,
MEAN_AVERAGING, EIGHT_SAMPLES,
val);
- break;
case IIO_CHAN_INFO_SCALE:
if (chan->type == IIO_VOLTAGE) {
ret = regulator_get_voltage(priv->vref);
if (ret < 0) {
diff --git a/drivers/iio/imu/bmi160/bmi160_core.c b/drivers/iio/imu/bmi160/bmi160_core.c
index 222ebb26f013..431076dc0d2c 100644
--- a/drivers/iio/imu/bmi160/bmi160_core.c
+++ b/drivers/iio/imu/bmi160/bmi160_core.c
@@ -484,11 +484,10 @@ static int bmi160_write_raw(struct iio_dev *indio_dev,
switch (mask) {
case IIO_CHAN_INFO_SCALE:
return bmi160_set_scale(data,
bmi160_to_sensor(chan->type), val2);
- break;
case IIO_CHAN_INFO_SAMP_FREQ:
return bmi160_set_odr(data, bmi160_to_sensor(chan->type),
val, val2);
default:
return -EINVAL;
diff --git a/drivers/ipack/devices/ipoctal.c b/drivers/ipack/devices/ipoctal.c
index d480a514c983..3940714e4397 100644
--- a/drivers/ipack/devices/ipoctal.c
+++ b/drivers/ipack/devices/ipoctal.c
@@ -542,11 +542,10 @@ static void ipoctal_set_termios(struct tty_struct *tty,
mr1 |= MR1_RxRTS_CONTROL_OFF;
mr2 |= MR2_TxRTS_CONTROL_ON | MR2_CTS_ENABLE_TX_OFF;
break;
default:
return;
- break;
}
baud = tty_get_baud_rate(tty);
tty_termios_encode_baud_rate(&tty->termios, baud, baud);
diff --git a/drivers/media/dvb-frontends/drx39xyj/drxj.c b/drivers/media/dvb-frontends/drx39xyj/drxj.c
index 237b9d04c076..37b32d9b398d 100644
--- a/drivers/media/dvb-frontends/drx39xyj/drxj.c
+++ b/drivers/media/dvb-frontends/drx39xyj/drxj.c
@@ -2323,11 +2323,10 @@ hi_command(struct i2c_device_addr *dev_addr, const struct drxj_hi_cmd *cmd, u16
/* No parameters */
break;
default:
return -EINVAL;
- break;
}
/* Write command */
rc = drxj_dap_write_reg16(dev_addr, SIO_HI_RA_RAM_CMD__A, cmd->cmd, 0);
if (rc != 0) {
@@ -3592,11 +3591,10 @@ static int ctrl_set_uio_cfg(struct drx_demod_instance *demod, struct drxuio_cfg
goto rw_error;
}
break;
default:
return -EINVAL;
- break;
} /* switch ( uio_cfg->mode ) */
break;
/*====================================================================*/
case DRX_UIO3:
/* DRX_UIO3: GPIO UIO-3 */
@@ -3616,11 +3614,10 @@ static int ctrl_set_uio_cfg(struct drx_demod_instance *demod, struct drxuio_cfg
goto rw_error;
}
break;
default:
return -EINVAL;
- break;
} /* switch ( uio_cfg->mode ) */
break;
/*====================================================================*/
case DRX_UIO4:
/* DRX_UIO4: IRQN UIO-4 */
@@ -3640,11 +3637,10 @@ static int ctrl_set_uio_cfg(struct drx_demod_instance *demod, struct drxuio_cfg
ext_attr->uio_irqn_mode = uio_cfg->mode;
break;
case DRX_UIO_MODE_FIRMWARE0:
default:
return -EINVAL;
- break;
} /* switch ( uio_cfg->mode ) */
break;
/*====================================================================*/
default:
return -EINVAL;
@@ -10951,11 +10947,10 @@ ctrl_set_standard(struct drx_demod_instance *demod, enum drx_standard *standard)
}
break;
default:
ext_attr->standard = DRX_STANDARD_UNKNOWN;
return -EINVAL;
- break;
}
return 0;
rw_error:
/* Don't know what the standard is now ... try again */
@@ -11072,11 +11067,10 @@ ctrl_power_mode(struct drx_demod_instance *demod, enum drx_power_mode *mode)
sio_cc_pwd_mode = SIO_CC_PWD_MODE_LEVEL_OSC;
break;
default:
/* Unknow sleep mode */
return -EINVAL;
- break;
}
/* Check if device needs to be powered up */
if ((common_attr->current_power_mode != DRX_POWER_UP)) {
rc = power_up_device(demod);
@@ -11894,11 +11888,10 @@ static int drx_ctrl_u_code(struct drx_demod_instance *demod,
}
break;
}
default:
return -EINVAL;
- break;
}
mc_data += mc_block_nr_bytes;
}
diff --git a/drivers/media/dvb-frontends/drxd_hard.c b/drivers/media/dvb-frontends/drxd_hard.c
index 45f982863904..a7eb81df88c2 100644
--- a/drivers/media/dvb-frontends/drxd_hard.c
+++ b/drivers/media/dvb-frontends/drxd_hard.c
@@ -1620,11 +1620,10 @@ static int CorrectSysClockDeviation(struct drxd_state *state)
case 6000000:
bandwidth = DRXD_BANDWIDTH_6MHZ_IN_HZ;
break;
default:
return -1;
- break;
}
/* Compute new sysclock value
sysClockFreq = (((incr + 2^23)*bandwidth)/2^21)/1000 */
incr += (1 << 23);
diff --git a/drivers/media/dvb-frontends/nxt200x.c b/drivers/media/dvb-frontends/nxt200x.c
index 35b83b1dd82c..200b6dbc75f8 100644
--- a/drivers/media/dvb-frontends/nxt200x.c
+++ b/drivers/media/dvb-frontends/nxt200x.c
@@ -166,11 +166,10 @@ static int nxt200x_writereg_multibyte (struct nxt200x_state* state, u8 reg, u8*
len2 = ((attr << 4) | 0x10) | len;
buf = 0x80;
break;
default:
return -EINVAL;
- break;
}
/* set multi register length */
nxt200x_writebytes(state, 0x34, &len2, 1);
@@ -188,11 +187,10 @@ static int nxt200x_writereg_multibyte (struct nxt200x_state* state, u8 reg, u8*
if (buf == 0)
return 0;
break;
default:
return -EINVAL;
- break;
}
pr_warn("Error writing multireg register 0x%02X\n", reg);
return 0;
@@ -214,11 +212,10 @@ static int nxt200x_readreg_multibyte (struct nxt200x_state* state, u8 reg, u8* d
nxt200x_writebytes(state, 0x34, &len2, 1);
/* read the actual data */
nxt200x_readbytes(state, reg, data, len);
return 0;
- break;
case NXT2004:
/* probably not right, but gives correct values */
attr = 0x02;
if (reg & 0x80) {
attr = attr << 1;
@@ -237,14 +234,12 @@ static int nxt200x_readreg_multibyte (struct nxt200x_state* state, u8 reg, u8* d
/* read the actual data */
for(i = 0; i < len; i++) {
nxt200x_readbytes(state, 0x36 + i, &data[i], 1);
}
return 0;
- break;
default:
return -EINVAL;
- break;
}
}
static void nxt200x_microcontroller_stop (struct nxt200x_state* state)
{
@@ -372,11 +367,10 @@ static int nxt200x_writetuner (struct nxt200x_state* state, u8* data)
}
pr_warn("timeout error writing to tuner\n");
break;
default:
return -EINVAL;
- break;
}
return 0;
}
static void nxt200x_agc_reset(struct nxt200x_state* state)
@@ -553,11 +547,10 @@ static int nxt200x_setup_frontend_parameters(struct dvb_frontend *fe)
if (state->config->set_ts_params)
state->config->set_ts_params(fe, 0);
break;
default:
return -EINVAL;
- break;
}
if (fe->ops.tuner_ops.calc_regs) {
/* get tuning information */
fe->ops.tuner_ops.calc_regs(fe, buf, 5);
@@ -578,11 +571,10 @@ static int nxt200x_setup_frontend_parameters(struct dvb_frontend *fe)
case VSB_8:
buf[0] = 0x70;
break;
default:
return -EINVAL;
- break;
}
nxt200x_writebytes(state, 0x42, buf, 1);
/* configure sdm */
switch (state->demod_chip) {
@@ -592,11 +584,10 @@ static int nxt200x_setup_frontend_parameters(struct dvb_frontend *fe)
case NXT2004:
buf[0] = 0x07;
break;
default:
return -EINVAL;
- break;
}
nxt200x_writebytes(state, 0x57, buf, 1);
/* write sdm1 input */
buf[0] = 0x10;
@@ -608,11 +599,10 @@ static int nxt200x_setup_frontend_parameters(struct dvb_frontend *fe)
case NXT2004:
nxt200x_writebytes(state, 0x58, buf, 2);
break;
default:
return -EINVAL;
- break;
}
/* write sdmx input */
switch (p->modulation) {
case QAM_64:
@@ -624,11 +614,10 @@ static int nxt200x_setup_frontend_parameters(struct dvb_frontend *fe)
case VSB_8:
buf[0] = 0x60;
break;
default:
return -EINVAL;
- break;
}
buf[1] = 0x00;
switch (state->demod_chip) {
case NXT2002:
nxt200x_writereg_multibyte(state, 0x5C, buf, 2);
@@ -636,11 +625,10 @@ static int nxt200x_setup_frontend_parameters(struct dvb_frontend *fe)
case NXT2004:
nxt200x_writebytes(state, 0x5C, buf, 2);
break;
default:
return -EINVAL;
- break;
}
/* write adc power lpf fc */
buf[0] = 0x05;
nxt200x_writebytes(state, 0x43, buf, 1);
@@ -662,11 +650,10 @@ static int nxt200x_setup_frontend_parameters(struct dvb_frontend *fe)
case NXT2004:
nxt200x_writebytes(state, 0x4B, buf, 2);
break;
default:
return -EINVAL;
- break;
}
/* write kg1 */
buf[0] = 0x00;
nxt200x_writebytes(state, 0x4D, buf, 1);
@@ -718,11 +705,10 @@ static int nxt200x_setup_frontend_parameters(struct dvb_frontend *fe)
case VSB_8:
buf[0] = 0x00;
break;
default:
return -EINVAL;
- break;
}
nxt200x_writebytes(state, 0x30, buf, 1);
/* write agc control reg */
buf[0] = 0x00;
@@ -740,11 +726,10 @@ static int nxt200x_setup_frontend_parameters(struct dvb_frontend *fe)
nxt200x_writebytes(state, 0x49, buf, 2);
nxt200x_writebytes(state, 0x4B, buf, 2);
break;
default:
return -EINVAL;
- break;
}
/* write agc control reg */
buf[0] = 0x04;
nxt200x_writebytes(state, 0x41, buf, 1);
@@ -1112,11 +1097,10 @@ static int nxt200x_init(struct dvb_frontend* fe)
case NXT2004:
ret = nxt2004_init(fe);
break;
default:
return -EINVAL;
- break;
}
state->initialised = 1;
}
return ret;
}
diff --git a/drivers/media/dvb-frontends/si21xx.c b/drivers/media/dvb-frontends/si21xx.c
index a116eff417f2..e31eb2c5cc4c 100644
--- a/drivers/media/dvb-frontends/si21xx.c
+++ b/drivers/media/dvb-frontends/si21xx.c
@@ -462,14 +462,12 @@ static int si21xx_set_voltage(struct dvb_frontend *fe, enum fe_sec_voltage volt)
val = (0x80 | si21_readreg(state, LNB_CTRL_REG_1));
switch (volt) {
case SEC_VOLTAGE_18:
return si21_writereg(state, LNB_CTRL_REG_1, val | 0x40);
- break;
case SEC_VOLTAGE_13:
return si21_writereg(state, LNB_CTRL_REG_1, (val & ~0x40));
- break;
default:
return -EINVAL;
}
}
diff --git a/drivers/media/tuners/mt2063.c b/drivers/media/tuners/mt2063.c
index 2240d214dfac..d105431a2e2d 100644
--- a/drivers/media/tuners/mt2063.c
+++ b/drivers/media/tuners/mt2063.c
@@ -1847,11 +1847,10 @@ static int mt2063_init(struct dvb_frontend *fe)
def = MT2063B0_defaults;
break;
default:
return -ENODEV;
- break;
}
while (status >= 0 && *def) {
u8 reg = *def++;
u8 val = *def++;
diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c
index 9903e9660a38..3078fac34e51 100644
--- a/drivers/message/fusion/mptbase.c
+++ b/drivers/message/fusion/mptbase.c
@@ -471,11 +471,10 @@ mpt_turbo_reply(MPT_ADAPTER *ioc, u32 pa)
req_idx = pa & 0x0000FFFF;
mf = MPT_INDEX_2_MFPTR(ioc, req_idx);
mpt_free_msg_frame(ioc, mf);
mb();
return;
- break;
}
mr = (MPT_FRAME_HDR *) CAST_U32_TO_PTR(pa);
break;
case MPI_CONTEXT_REPLY_TYPE_SCSI_TARGET:
cb_idx = mpt_get_cb_idx(MPTSTM_DRIVER);
diff --git a/drivers/misc/mei/hbm.c b/drivers/misc/mei/hbm.c
index a97eb5d47705..686e8b6a4c55 100644
--- a/drivers/misc/mei/hbm.c
+++ b/drivers/misc/mei/hbm.c
@@ -1375,11 +1375,10 @@ int mei_hbm_dispatch(struct mei_device *dev, struct mei_msg_hdr *hdr)
dev->dev_state = MEI_DEV_POWER_DOWN;
dev_info(dev->dev, "hbm: stop response: resetting.\n");
/* force the reset */
return -EPROTO;
- break;
case CLIENT_DISCONNECT_REQ_CMD:
dev_dbg(dev->dev, "hbm: disconnect request: message received\n");
disconnect_req = (struct hbm_client_connect_request *)mei_msg;
diff --git a/drivers/mtd/mtdchar.c b/drivers/mtd/mtdchar.c
index b40f46a43fc6..323035d4f2d0 100644
--- a/drivers/mtd/mtdchar.c
+++ b/drivers/mtd/mtdchar.c
@@ -879,21 +879,19 @@ static int mtdchar_ioctl(struct file *file, u_int cmd, u_long arg)
loff_t offs;
if (copy_from_user(&offs, argp, sizeof(loff_t)))
return -EFAULT;
return mtd_block_isbad(mtd, offs);
- break;
}
case MEMSETBADBLOCK:
{
loff_t offs;
if (copy_from_user(&offs, argp, sizeof(loff_t)))
return -EFAULT;
return mtd_block_markbad(mtd, offs);
- break;
}
case OTPSELECT:
{
int mode;
diff --git a/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c b/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c
index c3f49543ff26..9c215f7c5f81 100644
--- a/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c
+++ b/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c
@@ -73,15 +73,15 @@ static const struct can_bittiming_const mcp251xfd_data_bittiming_const = {
static const char *__mcp251xfd_get_model_str(enum mcp251xfd_model model)
{
switch (model) {
case MCP251XFD_MODEL_MCP2517FD:
- return "MCP2517FD"; break;
+ return "MCP2517FD";
case MCP251XFD_MODEL_MCP2518FD:
- return "MCP2518FD"; break;
+ return "MCP2518FD";
case MCP251XFD_MODEL_MCP251XFD:
- return "MCP251xFD"; break;
+ return "MCP251xFD";
}
return "<unknown>";
}
@@ -93,25 +93,25 @@ mcp251xfd_get_model_str(const struct mcp251xfd_priv *priv)
static const char *mcp251xfd_get_mode_str(const u8 mode)
{
switch (mode) {
case MCP251XFD_REG_CON_MODE_MIXED:
- return "Mixed (CAN FD/CAN 2.0)"; break;
+ return "Mixed (CAN FD/CAN 2.0)";
case MCP251XFD_REG_CON_MODE_SLEEP:
- return "Sleep"; break;
+ return "Sleep";
case MCP251XFD_REG_CON_MODE_INT_LOOPBACK:
- return "Internal Loopback"; break;
+ return "Internal Loopback";
case MCP251XFD_REG_CON_MODE_LISTENONLY:
- return "Listen Only"; break;
+ return "Listen Only";
case MCP251XFD_REG_CON_MODE_CONFIG:
- return "Configuration"; break;
+ return "Configuration";
case MCP251XFD_REG_CON_MODE_EXT_LOOPBACK:
- return "External Loopback"; break;
+ return "External Loopback";
case MCP251XFD_REG_CON_MODE_CAN2_0:
- return "CAN 2.0"; break;
+ return "CAN 2.0";
case MCP251XFD_REG_CON_MODE_RESTRICTED:
- return "Restricted Operation"; break;
+ return "Restricted Operation";
}
return "<unknown>";
}
diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_nic.c b/drivers/net/ethernet/aquantia/atlantic/aq_nic.c
index 0f865daeb36d..bf5e0e9bd0e2 100644
--- a/drivers/net/ethernet/aquantia/atlantic/aq_nic.c
+++ b/drivers/net/ethernet/aquantia/atlantic/aq_nic.c
@@ -1161,11 +1161,10 @@ int aq_nic_set_link_ksettings(struct aq_nic_s *self,
break;
default:
err = -1;
goto err_exit;
- break;
}
if (!(self->aq_nic_cfg.aq_hw_caps->link_speed_msk & rate)) {
err = -1;
goto err_exit;
}
diff --git a/drivers/net/ethernet/cisco/enic/enic_ethtool.c b/drivers/net/ethernet/cisco/enic/enic_ethtool.c
index a4dd52bba2c3..1a9803f2073e 100644
--- a/drivers/net/ethernet/cisco/enic/enic_ethtool.c
+++ b/drivers/net/ethernet/cisco/enic/enic_ethtool.c
@@ -432,11 +432,10 @@ static int enic_grxclsrule(struct enic *enic, struct ethtool_rxnfc *cmd)
case IPPROTO_UDP:
fsp->flow_type = UDP_V4_FLOW;
break;
default:
return -EINVAL;
- break;
}
fsp->h_u.tcp_ip4_spec.ip4src = flow_get_u32_src(&n->keys);
fsp->m_u.tcp_ip4_spec.ip4src = (__u32)~0;
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_x540.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_x540.c
index de563cfd294d..4b93ba149ec5 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_x540.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_x540.c
@@ -348,11 +348,10 @@ static s32 ixgbe_calc_eeprom_checksum_X540(struct ixgbe_hw *hw)
continue;
if (ixgbe_read_eerd_generic(hw, pointer, &length)) {
hw_dbg(hw, "EEPROM read failed\n");
return IXGBE_ERR_EEPROM;
- break;
}
/* Skip pointer section if length is invalid. */
if (length == 0xFFFF || length == 0 ||
(pointer + length) >= hw->eeprom.word_size)
diff --git a/drivers/net/wan/lmc/lmc_proto.c b/drivers/net/wan/lmc/lmc_proto.c
index e8b0b902b424..4e9cc83b615a 100644
--- a/drivers/net/wan/lmc/lmc_proto.c
+++ b/drivers/net/wan/lmc/lmc_proto.c
@@ -87,21 +87,17 @@ void lmc_proto_close(lmc_softc_t *sc)
__be16 lmc_proto_type(lmc_softc_t *sc, struct sk_buff *skb) /*FOLD00*/
{
switch(sc->if_type){
case LMC_PPP:
return hdlc_type_trans(skb, sc->lmc_device);
- break;
case LMC_NET:
return htons(ETH_P_802_2);
- break;
case LMC_RAW: /* Packet type for skbuff kind of useless */
return htons(ETH_P_802_2);
- break;
default:
printk(KERN_WARNING "%s: No protocol set for this interface, assuming 802.2 (which is wrong!!)\n", sc->name);
return htons(ETH_P_802_2);
- break;
}
}
void lmc_proto_netif(lmc_softc_t *sc, struct sk_buff *skb) /*FOLD00*/
{
diff --git a/drivers/net/wireless/ath/ath10k/htt_rx.c b/drivers/net/wireless/ath/ath10k/htt_rx.c
index 5c1af2021883..9c4e6cf2137a 100644
--- a/drivers/net/wireless/ath/ath10k/htt_rx.c
+++ b/drivers/net/wireless/ath/ath10k/htt_rx.c
@@ -3876,11 +3876,10 @@ bool ath10k_htt_t2h_msg_handler(struct ath10k *ar, struct sk_buff *skb)
atomic_inc(&htt->num_mpdus_ready);
return ath10k_htt_rx_proc_rx_frag_ind(htt,
&resp->rx_frag_ind,
skb);
- break;
}
case HTT_T2H_MSG_TYPE_TEST:
break;
case HTT_T2H_MSG_TYPE_STATS_CONF:
trace_ath10k_htt_stats(ar, skb->data, skb->len);
diff --git a/drivers/net/wireless/ath/ath6kl/testmode.c b/drivers/net/wireless/ath/ath6kl/testmode.c
index f3906dbe5495..89c7c4e25169 100644
--- a/drivers/net/wireless/ath/ath6kl/testmode.c
+++ b/drivers/net/wireless/ath/ath6kl/testmode.c
@@ -92,11 +92,10 @@ int ath6kl_tm_cmd(struct wiphy *wiphy, struct wireless_dev *wdev,
ath6kl_wmi_test_cmd(ar->wmi, buf, buf_len);
return 0;
- break;
case ATH6KL_TM_CMD_RX_REPORT:
default:
return -EOPNOTSUPP;
}
}
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
index 6609ce122e6e..b66eeb577272 100644
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
@@ -2306,11 +2306,10 @@ void ath9k_hw_beaconinit(struct ath_hw *ah, u32 next_beacon, u32 beacon_period)
break;
default:
ath_dbg(ath9k_hw_common(ah), BEACON,
"%s: unsupported opmode: %d\n", __func__, ah->opmode);
return;
- break;
}
REG_WRITE(ah, AR_BEACON_PERIOD, beacon_period);
REG_WRITE(ah, AR_DMA_BEACON_PERIOD, beacon_period);
REG_WRITE(ah, AR_SWBA_PERIOD, beacon_period);
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c b/drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c
index cbdebefb854a..8698ca4d30de 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c
@@ -1200,17 +1200,15 @@ static int iwl_mvm_mac_ctx_send(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
switch (vif->type) {
case NL80211_IFTYPE_STATION:
return iwl_mvm_mac_ctxt_cmd_sta(mvm, vif, action,
force_assoc_off,
bssid_override);
- break;
case NL80211_IFTYPE_AP:
if (!vif->p2p)
return iwl_mvm_mac_ctxt_cmd_ap(mvm, vif, action);
else
return iwl_mvm_mac_ctxt_cmd_go(mvm, vif, action);
- break;
case NL80211_IFTYPE_MONITOR:
return iwl_mvm_mac_ctxt_cmd_listener(mvm, vif, action);
case NL80211_IFTYPE_P2P_DEVICE:
return iwl_mvm_mac_ctxt_cmd_p2p_device(mvm, vif, action);
case NL80211_IFTYPE_ADHOC:
diff --git a/drivers/net/wireless/intersil/p54/eeprom.c b/drivers/net/wireless/intersil/p54/eeprom.c
index 5bd35c147e19..3ca9d26df174 100644
--- a/drivers/net/wireless/intersil/p54/eeprom.c
+++ b/drivers/net/wireless/intersil/p54/eeprom.c
@@ -868,11 +868,10 @@ int p54_parse_eeprom(struct ieee80211_hw *dev, void *eeprom, int len)
err = -ENOMSG;
goto err;
} else {
goto good_eeprom;
}
- break;
default:
break;
}
crc16 = crc_ccitt(crc16, (u8 *)entry, (entry_len + 1) * 2);
diff --git a/drivers/net/wireless/intersil/prism54/oid_mgt.c b/drivers/net/wireless/intersil/prism54/oid_mgt.c
index 9fd307ca4b6d..7b251ae90a68 100644
--- a/drivers/net/wireless/intersil/prism54/oid_mgt.c
+++ b/drivers/net/wireless/intersil/prism54/oid_mgt.c
@@ -785,21 +785,19 @@ mgt_response_to_str(enum oid_num_t n, union oid_res_t *r, char *str)
struct obj_buffer *buff = r->ptr;
return scnprintf(str, PRIV_STR_SIZE,
"size=%u\naddr=0x%X\n", buff->size,
buff->addr);
}
- break;
case OID_TYPE_BSS:{
struct obj_bss *bss = r->ptr;
return scnprintf(str, PRIV_STR_SIZE,
"age=%u\nchannel=%u\n"
"capinfo=0x%X\nrates=0x%X\n"
"basic_rates=0x%X\n", bss->age,
bss->channel, bss->capinfo,
bss->rates, bss->basic_rates);
}
- break;
case OID_TYPE_BSSLIST:{
struct obj_bsslist *list = r->ptr;
int i, k;
k = scnprintf(str, PRIV_STR_SIZE, "nr=%u\n", list->nr);
for (i = 0; i < list->nr; i++)
@@ -812,53 +810,47 @@ mgt_response_to_str(enum oid_num_t n, union oid_res_t *r, char *str)
list->bsslist[i].capinfo,
list->bsslist[i].rates,
list->bsslist[i].basic_rates);
return k;
}
- break;
case OID_TYPE_FREQUENCIES:{
struct obj_frequencies *freq = r->ptr;
int i, t;
printk("nr : %u\n", freq->nr);
t = scnprintf(str, PRIV_STR_SIZE, "nr=%u\n", freq->nr);
for (i = 0; i < freq->nr; i++)
t += scnprintf(str + t, PRIV_STR_SIZE - t,
"mhz[%u]=%u\n", i, freq->mhz[i]);
return t;
}
- break;
case OID_TYPE_MLME:{
struct obj_mlme *mlme = r->ptr;
return scnprintf(str, PRIV_STR_SIZE,
"id=0x%X\nstate=0x%X\ncode=0x%X\n",
mlme->id, mlme->state, mlme->code);
}
- break;
case OID_TYPE_MLMEEX:{
struct obj_mlmeex *mlme = r->ptr;
return scnprintf(str, PRIV_STR_SIZE,
"id=0x%X\nstate=0x%X\n"
"code=0x%X\nsize=0x%X\n", mlme->id,
mlme->state, mlme->code, mlme->size);
}
- break;
case OID_TYPE_ATTACH:{
struct obj_attachment *attach = r->ptr;
return scnprintf(str, PRIV_STR_SIZE,
"id=%d\nsize=%d\n",
attach->id,
attach->size);
}
- break;
case OID_TYPE_SSID:{
struct obj_ssid *ssid = r->ptr;
return scnprintf(str, PRIV_STR_SIZE,
"length=%u\noctets=%.*s\n",
ssid->length, ssid->length,
ssid->octets);
}
- break;
case OID_TYPE_KEY:{
struct obj_key *key = r->ptr;
int t, i;
t = scnprintf(str, PRIV_STR_SIZE,
"type=0x%X\nlength=0x%X\nkey=0x",
@@ -867,11 +859,10 @@ mgt_response_to_str(enum oid_num_t n, union oid_res_t *r, char *str)
t += scnprintf(str + t, PRIV_STR_SIZE - t,
"%02X:", key->key[i]);
t += scnprintf(str + t, PRIV_STR_SIZE - t, "\n");
return t;
}
- break;
case OID_TYPE_RAW:
case OID_TYPE_ADDR:{
unsigned char *buff = r->ptr;
int t, i;
t = scnprintf(str, PRIV_STR_SIZE, "hex data=");
@@ -879,11 +870,10 @@ mgt_response_to_str(enum oid_num_t n, union oid_res_t *r, char *str)
t += scnprintf(str + t, PRIV_STR_SIZE - t,
"%02X:", buff[i]);
t += scnprintf(str + t, PRIV_STR_SIZE - t, "\n");
return t;
}
- break;
default:
BUG();
}
return 0;
}
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/hw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/hw.c
index 63f9ea21962f..bd9160b166c5 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/hw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/hw.c
@@ -1224,11 +1224,10 @@ static int _rtl88ee_set_media_status(struct ieee80211_hw *hw,
"Set Network type to AP!\n");
break;
default:
pr_err("Network type %d not support!\n", type);
return 1;
- break;
}
/* MSR_INFRA == Link in infrastructure network;
* MSR_ADHOC == Link in ad hoc network;
* Therefore, check link state is necessary.
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/hw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/hw.c
index a36dc6e726d2..f8a1de6e9849 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/hw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/hw.c
@@ -1130,11 +1130,10 @@ static int _rtl8723e_set_media_status(struct ieee80211_hw *hw,
"Set Network type to AP!\n");
break;
default:
pr_err("Network type %d not support!\n", type);
return 1;
- break;
}
/* MSR_INFRA == Link in infrastructure network;
* MSR_ADHOC == Link in ad hoc network;
* Therefore, check link state is necessary.
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c
index f41a7643b9c4..225b8cd44f23 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c
@@ -2083,16 +2083,14 @@ bool rtl8812ae_phy_config_rf_with_headerfile(struct ieee80211_hw *hw,
switch (rfpath) {
case RF90_PATH_A:
return __rtl8821ae_phy_config_with_headerfile(hw,
radioa_array_table_a, radioa_arraylen_a,
_rtl8821ae_config_rf_radio_a);
- break;
case RF90_PATH_B:
return __rtl8821ae_phy_config_with_headerfile(hw,
radioa_array_table_b, radioa_arraylen_b,
_rtl8821ae_config_rf_radio_b);
- break;
case RF90_PATH_C:
case RF90_PATH_D:
pr_err("switch case %#x not processed\n", rfpath);
break;
}
@@ -2114,11 +2112,10 @@ bool rtl8821ae_phy_config_rf_with_headerfile(struct ieee80211_hw *hw,
switch (rfpath) {
case RF90_PATH_A:
return __rtl8821ae_phy_config_with_headerfile(hw,
radioa_array_table, radioa_arraylen,
_rtl8821ae_config_rf_radio_a);
- break;
case RF90_PATH_B:
case RF90_PATH_C:
case RF90_PATH_D:
pr_err("switch case %#x not processed\n", rfpath);
diff --git a/drivers/nfc/st21nfca/core.c b/drivers/nfc/st21nfca/core.c
index 2ce17932a073..6ca0d2f56b18 100644
--- a/drivers/nfc/st21nfca/core.c
+++ b/drivers/nfc/st21nfca/core.c
@@ -792,11 +792,10 @@ static int st21nfca_hci_im_transceive(struct nfc_hci_dev *hdev,
return nfc_hci_send_cmd_async(hdev, target->hci_reader_gate,
ST21NFCA_WR_XCHG_DATA, skb->data,
skb->len,
st21nfca_hci_data_exchange_cb,
info);
- break;
default:
return 1;
}
}
diff --git a/drivers/nfc/trf7970a.c b/drivers/nfc/trf7970a.c
index 3bd97c73f983..c70f62fe321e 100644
--- a/drivers/nfc/trf7970a.c
+++ b/drivers/nfc/trf7970a.c
@@ -1380,11 +1380,10 @@ static int trf7970a_is_iso15693_write_or_lock(u8 cmd)
case ISO15693_CMD_WRITE_AFI:
case ISO15693_CMD_LOCK_AFI:
case ISO15693_CMD_WRITE_DSFID:
case ISO15693_CMD_LOCK_DSFID:
return 1;
- break;
default:
return 0;
}
}
diff --git a/drivers/nvdimm/claim.c b/drivers/nvdimm/claim.c
index 5a7c80053c62..2f250874b1a4 100644
--- a/drivers/nvdimm/claim.c
+++ b/drivers/nvdimm/claim.c
@@ -200,11 +200,10 @@ ssize_t nd_namespace_store(struct device *dev,
}
break;
default:
len = -EBUSY;
goto out_attach;
- break;
}
if (__nvdimm_namespace_capacity(ndns) < SZ_16M) {
dev_dbg(dev, "%s too small to host\n", name);
len = -ENXIO;
diff --git a/drivers/pci/controller/pci-v3-semi.c b/drivers/pci/controller/pci-v3-semi.c
index 1f54334f09f7..154a5398633c 100644
--- a/drivers/pci/controller/pci-v3-semi.c
+++ b/drivers/pci/controller/pci-v3-semi.c
@@ -656,11 +656,10 @@ static int v3_get_dma_range_config(struct v3_pci *v3,
val |= V3_LB_BASE_ADR_SIZE_2GB;
break;
default:
dev_err(v3->dev, "illegal dma memory chunk size\n");
return -EINVAL;
- break;
}
val |= V3_PCI_MAP_M_REG_EN | V3_PCI_MAP_M_ENABLE;
*pci_map = val;
dev_dbg(dev,
diff --git a/drivers/pinctrl/samsung/pinctrl-s3c24xx.c b/drivers/pinctrl/samsung/pinctrl-s3c24xx.c
index 5e24838a582f..2223ead5bd72 100644
--- a/drivers/pinctrl/samsung/pinctrl-s3c24xx.c
+++ b/drivers/pinctrl/samsung/pinctrl-s3c24xx.c
@@ -106,23 +106,18 @@ struct s3c24xx_eint_domain_data {
static int s3c24xx_eint_get_trigger(unsigned int type)
{
switch (type) {
case IRQ_TYPE_EDGE_RISING:
return EINT_EDGE_RISING;
- break;
case IRQ_TYPE_EDGE_FALLING:
return EINT_EDGE_FALLING;
- break;
case IRQ_TYPE_EDGE_BOTH:
return EINT_EDGE_BOTH;
- break;
case IRQ_TYPE_LEVEL_HIGH:
return EINT_LEVEL_HIGH;
- break;
case IRQ_TYPE_LEVEL_LOW:
return EINT_LEVEL_LOW;
- break;
default:
return -EINVAL;
}
}
diff --git a/drivers/platform/x86/acer-wmi.c b/drivers/platform/x86/acer-wmi.c
index 49f4b73be513..1c2084c74a57 100644
--- a/drivers/platform/x86/acer-wmi.c
+++ b/drivers/platform/x86/acer-wmi.c
@@ -790,11 +790,10 @@ static acpi_status AMW0_set_u32(u32 value, u32 cap)
if (value > max_brightness)
return AE_BAD_PARAMETER;
switch (quirks->brightness) {
default:
return ec_write(0x83, value);
- break;
}
default:
return AE_ERROR;
}
diff --git a/drivers/platform/x86/sony-laptop.c b/drivers/platform/x86/sony-laptop.c
index e5a1b5533408..704813374922 100644
--- a/drivers/platform/x86/sony-laptop.c
+++ b/drivers/platform/x86/sony-laptop.c
@@ -2465,26 +2465,23 @@ static int __sony_nc_gfx_switch_status_get(void)
case 0x0146:
/* 1: discrete GFX (speed)
* 0: integrated GFX (stamina)
*/
return result & 0x1 ? SPEED : STAMINA;
- break;
case 0x015B:
/* 0: discrete GFX (speed)
* 1: integrated GFX (stamina)
*/
return result & 0x1 ? STAMINA : SPEED;
- break;
case 0x0128:
/* it's a more elaborated bitmask, for now:
* 2: integrated GFX (stamina)
* 0: discrete GFX (speed)
*/
dprintk("GFX Status: 0x%x\n", result);
return result & 0x80 ? AUTO :
result & 0x02 ? STAMINA : SPEED;
- break;
}
return -EINVAL;
}
static ssize_t sony_nc_gfx_switch_status_show(struct device *dev,
diff --git a/drivers/platform/x86/wmi.c b/drivers/platform/x86/wmi.c
index d88f388a3450..44e802f9f1b4 100644
--- a/drivers/platform/x86/wmi.c
+++ b/drivers/platform/x86/wmi.c
@@ -1258,17 +1258,14 @@ acpi_wmi_ec_space_handler(u32 function, acpi_physical_address address,
}
switch (result) {
case -EINVAL:
return AE_BAD_PARAMETER;
- break;
case -ENODEV:
return AE_NOT_FOUND;
- break;
case -ETIME:
return AE_TIME;
- break;
default:
return AE_OK;
}
}
diff --git a/drivers/power/supply/wm831x_power.c b/drivers/power/supply/wm831x_power.c
index 18b33f14dfee..4cd2dd870039 100644
--- a/drivers/power/supply/wm831x_power.c
+++ b/drivers/power/supply/wm831x_power.c
@@ -666,11 +666,10 @@ static int wm831x_power_probe(struct platform_device *pdev)
default:
dev_err(&pdev->dev, "Failed to find USB phy: %d\n", ret);
fallthrough;
case -EPROBE_DEFER:
goto err_bat_irq;
- break;
}
return ret;
err_bat_irq:
diff --git a/drivers/scsi/aic94xx/aic94xx_task.c b/drivers/scsi/aic94xx/aic94xx_task.c
index f923ed019d4a..ed034192b3c3 100644
--- a/drivers/scsi/aic94xx/aic94xx_task.c
+++ b/drivers/scsi/aic94xx/aic94xx_task.c
@@ -267,11 +267,10 @@ static void asd_task_tasklet_complete(struct asd_ascb *ascb,
ts->stat = SAS_NAK_R_ERR;
break;
case TA_I_T_NEXUS_LOSS:
opcode = dl->status_block[0];
goto Again;
- break;
case TF_INV_CONN_HANDLE:
ts->resp = SAS_TASK_UNDELIVERED;
ts->stat = SAS_DEVICE_UNKNOWN;
break;
case TF_REQUESTED_N_PENDING:
diff --git a/drivers/scsi/be2iscsi/be_mgmt.c b/drivers/scsi/be2iscsi/be_mgmt.c
index 96d6e384b2b2..0d4928567265 100644
--- a/drivers/scsi/be2iscsi/be_mgmt.c
+++ b/drivers/scsi/be2iscsi/be_mgmt.c
@@ -1242,22 +1242,18 @@ beiscsi_adap_family_disp(struct device *dev, struct device_attribute *attr,
case BE_DEVICE_ID1:
case OC_DEVICE_ID1:
case OC_DEVICE_ID2:
return snprintf(buf, PAGE_SIZE,
"Obsolete/Unsupported BE2 Adapter Family\n");
- break;
case BE_DEVICE_ID2:
case OC_DEVICE_ID3:
return snprintf(buf, PAGE_SIZE, "BE3-R Adapter Family\n");
- break;
case OC_SKH_ID1:
return snprintf(buf, PAGE_SIZE, "Skyhawk-R Adapter Family\n");
- break;
default:
return snprintf(buf, PAGE_SIZE,
"Unknown Adapter Family: 0x%x\n", dev_id);
- break;
}
}
/**
* beiscsi_phys_port()- Display Physical Port Identifier
diff --git a/drivers/scsi/bnx2fc/bnx2fc_hwi.c b/drivers/scsi/bnx2fc/bnx2fc_hwi.c
index 08992095ce7a..b37b0a9ec12d 100644
--- a/drivers/scsi/bnx2fc/bnx2fc_hwi.c
+++ b/drivers/scsi/bnx2fc/bnx2fc_hwi.c
@@ -768,11 +768,10 @@ static void bnx2fc_process_unsol_compl(struct bnx2fc_rport *tgt, u16 wqe)
if (rc)
goto skip_rec;
} else
printk(KERN_ERR PFX "SRR in progress\n");
goto ret_err_rqe;
- break;
default:
break;
}
skip_rec:
diff --git a/drivers/scsi/fcoe/fcoe.c b/drivers/scsi/fcoe/fcoe.c
index 0f9274960dc6..a4be6f439c47 100644
--- a/drivers/scsi/fcoe/fcoe.c
+++ b/drivers/scsi/fcoe/fcoe.c
@@ -1892,11 +1892,10 @@ static int fcoe_device_notification(struct notifier_block *notifier,
fcoe_interface_remove(fcoe);
fcoe_interface_cleanup(fcoe);
mutex_unlock(&fcoe_config_mutex);
fcoe_ctlr_device_delete(fcoe_ctlr_to_ctlr_dev(ctlr));
goto out;
- break;
case NETDEV_FEAT_CHANGE:
fcoe_netdev_features_change(lport, netdev);
break;
default:
FCOE_NETDEV_DBG(netdev, "Unknown event %ld "
diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
index 83ce4f11a589..45136e3a4efc 100644
--- a/drivers/scsi/hpsa.c
+++ b/drivers/scsi/hpsa.c
@@ -7440,11 +7440,10 @@ static int find_PCI_BAR_index(struct pci_dev *pdev, unsigned long pci_bar_addr)
break;
default: /* reserved in PCI 2.2 */
dev_warn(&pdev->dev,
"base address is invalid\n");
return -1;
- break;
}
}
if (offset == pci_bar_addr - PCI_BASE_ADDRESS_0)
return i + 1;
}
diff --git a/drivers/scsi/hptiop.c b/drivers/scsi/hptiop.c
index 6a2561f26e38..db4c7a7ff4dd 100644
--- a/drivers/scsi/hptiop.c
+++ b/drivers/scsi/hptiop.c
@@ -756,11 +756,10 @@ static void hptiop_finish_scsi_req(struct hptiop_hba *hba, u32 tag,
scsi_set_resid(scp,
scsi_bufflen(scp) - le32_to_cpu(req->dataxfer_length));
scp->result = SAM_STAT_CHECK_CONDITION;
memcpy(scp->sense_buffer, &req->sg_list, SCSI_SENSE_BUFFERSIZE);
goto skip_resid;
- break;
default:
scp->result = DRIVER_INVALID << 24 | DID_ABORT << 16;
break;
}
diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c
index b0aa58d117cc..e451102b9a29 100644
--- a/drivers/scsi/ipr.c
+++ b/drivers/scsi/ipr.c
@@ -9485,11 +9485,10 @@ static pci_ers_result_t ipr_pci_error_detected(struct pci_dev *pdev,
ipr_pci_frozen(pdev);
return PCI_ERS_RESULT_CAN_RECOVER;
case pci_channel_io_perm_failure:
ipr_pci_perm_failure(pdev);
return PCI_ERS_RESULT_DISCONNECT;
- break;
default:
break;
}
return PCI_ERS_RESULT_NEED_RESET;
}
diff --git a/drivers/scsi/isci/phy.c b/drivers/scsi/isci/phy.c
index 7041e2e3ab48..1b87d9080ebe 100644
--- a/drivers/scsi/isci/phy.c
+++ b/drivers/scsi/isci/phy.c
@@ -751,11 +751,10 @@ enum sci_status sci_phy_event_handler(struct isci_phy *iphy, u32 event_code)
sci_change_state(&iphy->sm, SCI_PHY_STARTING);
break;
default:
phy_event_warn(iphy, state, event_code);
return SCI_FAILURE;
- break;
}
return SCI_SUCCESS;
case SCI_PHY_SUB_AWAIT_IAF_UF:
switch (scu_get_event_code(event_code)) {
case SCU_EVENT_SAS_PHY_DETECTED:
@@ -956,11 +955,10 @@ enum sci_status sci_phy_event_handler(struct isci_phy *iphy, u32 event_code)
sci_change_state(&iphy->sm, SCI_PHY_STARTING);
break;
default:
phy_event_warn(iphy, state, event_code);
return SCI_FAILURE_INVALID_STATE;
- break;
}
return SCI_SUCCESS;
default:
dev_dbg(sciphy_to_dev(iphy), "%s: in wrong state: %s\n",
__func__, phy_state_name(state));
diff --git a/drivers/scsi/lpfc/lpfc_debugfs.c b/drivers/scsi/lpfc/lpfc_debugfs.c
index c9a327b13e5c..325081ac6553 100644
--- a/drivers/scsi/lpfc/lpfc_debugfs.c
+++ b/drivers/scsi/lpfc/lpfc_debugfs.c
@@ -3339,11 +3339,10 @@ lpfc_idiag_pcicfg_read(struct file *file, char __user *buf, size_t nbytes,
len += scnprintf(pbuffer+len, LPFC_PCI_CFG_SIZE-len,
"%03x: %08x\n", where, u32val);
break;
case LPFC_PCI_CFG_BROWSE: /* browse all */
goto pcicfg_browse;
- break;
default:
/* illegal count */
len = 0;
break;
}
@@ -4379,11 +4378,11 @@ lpfc_idiag_queacc_write(struct file *file, const char __user *buf,
goto pass_check;
}
}
}
goto error_out;
- break;
+
case LPFC_IDIAG_CQ:
/* MBX complete queue */
if (phba->sli4_hba.mbx_cq &&
phba->sli4_hba.mbx_cq->queue_id == queid) {
/* Sanity check */
@@ -4431,11 +4430,11 @@ lpfc_idiag_queacc_write(struct file *file, const char __user *buf,
goto pass_check;
}
}
}
goto error_out;
- break;
+
case LPFC_IDIAG_MQ:
/* MBX work queue */
if (phba->sli4_hba.mbx_wq &&
phba->sli4_hba.mbx_wq->queue_id == queid) {
/* Sanity check */
@@ -4445,11 +4444,11 @@ lpfc_idiag_queacc_write(struct file *file, const char __user *buf,
goto error_out;
idiag.ptr_private = phba->sli4_hba.mbx_wq;
goto pass_check;
}
goto error_out;
- break;
+
case LPFC_IDIAG_WQ:
/* ELS work queue */
if (phba->sli4_hba.els_wq &&
phba->sli4_hba.els_wq->queue_id == queid) {
/* Sanity check */
@@ -4485,13 +4484,12 @@ lpfc_idiag_queacc_write(struct file *file, const char __user *buf,
idiag.ptr_private = qp;
goto pass_check;
}
}
}
-
goto error_out;
- break;
+
case LPFC_IDIAG_RQ:
/* HDR queue */
if (phba->sli4_hba.hdr_rq &&
phba->sli4_hba.hdr_rq->queue_id == queid) {
/* Sanity check */
@@ -4512,14 +4510,12 @@ lpfc_idiag_queacc_write(struct file *file, const char __user *buf,
goto error_out;
idiag.ptr_private = phba->sli4_hba.dat_rq;
goto pass_check;
}
goto error_out;
- break;
default:
goto error_out;
- break;
}
pass_check:
if (idiag.cmd.opcode == LPFC_IDIAG_CMD_QUEACC_RD) {
diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
index ca25e54bb782..b6090357e8a5 100644
--- a/drivers/scsi/lpfc/lpfc_init.c
+++ b/drivers/scsi/lpfc/lpfc_init.c
@@ -7194,11 +7194,10 @@ lpfc_init_api_table_setup(struct lpfc_hba *phba, uint8_t dev_grp)
default:
lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
"1431 Invalid HBA PCI-device group: 0x%x\n",
dev_grp);
return -ENODEV;
- break;
}
return 0;
}
/**
diff --git a/drivers/scsi/lpfc/lpfc_scsi.c b/drivers/scsi/lpfc/lpfc_scsi.c
index 983eeb0e3d07..c3b02dab6e5c 100644
--- a/drivers/scsi/lpfc/lpfc_scsi.c
+++ b/drivers/scsi/lpfc/lpfc_scsi.c
@@ -4282,11 +4282,10 @@ lpfc_scsi_api_table_setup(struct lpfc_hba *phba, uint8_t dev_grp)
default:
lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
"1418 Invalid HBA PCI-device group: 0x%x\n",
dev_grp);
return -ENODEV;
- break;
}
phba->lpfc_rampdown_queue_depth = lpfc_rampdown_queue_depth;
phba->lpfc_scsi_cmd_iocb_cmpl = lpfc_scsi_cmd_iocb_cmpl;
return 0;
}
diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c
index e158cd77d387..0f18f1ba8a28 100644
--- a/drivers/scsi/lpfc/lpfc_sli.c
+++ b/drivers/scsi/lpfc/lpfc_sli.c
@@ -9187,11 +9187,10 @@ lpfc_mbox_api_table_setup(struct lpfc_hba *phba, uint8_t dev_grp)
default:
lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
"1420 Invalid HBA PCI-device group: 0x%x\n",
dev_grp);
return -ENODEV;
- break;
}
return 0;
}
/**
@@ -10070,11 +10069,10 @@ lpfc_sli4_iocb2wqe(struct lpfc_hba *phba, struct lpfc_iocbq *iocbq,
default:
lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
"2014 Invalid command 0x%x\n",
iocbq->iocb.ulpCommand);
return IOCB_ERROR;
- break;
}
if (iocbq->iocb_flag & LPFC_IO_DIF_PASS)
bf_set(wqe_dif, &wqe->generic.wqe_com, LPFC_WQE_DIF_PASSTHRU);
else if (iocbq->iocb_flag & LPFC_IO_DIF_STRIP)
@@ -10232,11 +10230,10 @@ lpfc_sli_api_table_setup(struct lpfc_hba *phba, uint8_t dev_grp)
default:
lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
"1419 Invalid HBA PCI-device group: 0x%x\n",
dev_grp);
return -ENODEV;
- break;
}
phba->lpfc_get_iocb_from_iocbq = lpfc_get_iocb_from_iocbq;
return 0;
}
diff --git a/drivers/scsi/mvumi.c b/drivers/scsi/mvumi.c
index 0354898d7cac..2f7a52bd653a 100644
--- a/drivers/scsi/mvumi.c
+++ b/drivers/scsi/mvumi.c
@@ -2294,11 +2294,10 @@ static int mvumi_cfg_hw_reg(struct mvumi_hba *mhba)
regs->int_drbl_int_mask = 0x3FFFFFFF;
regs->int_mu = regs->int_dl_cpu2pciea | regs->int_comaout;
break;
default:
return -1;
- break;
}
return 0;
}
diff --git a/drivers/scsi/pcmcia/nsp_cs.c b/drivers/scsi/pcmcia/nsp_cs.c
index bc5a623519e7..bb3b3884f968 100644
--- a/drivers/scsi/pcmcia/nsp_cs.c
+++ b/drivers/scsi/pcmcia/nsp_cs.c
@@ -1100,12 +1100,10 @@ static irqreturn_t nspintr(int irq, void *dev_id)
nsp_index_write(base, SCSIBUSCTRL, SCSI_ATN);
udelay(1);
nsp_index_write(base, SCSIBUSCTRL, SCSI_ATN | AUTODIRECTION | ACKENB);
return IRQ_HANDLED;
- break;
-
case PH_RESELECT:
//nsp_dbg(NSP_DEBUG_INTR, "phase reselect");
// *sync_neg = SYNC_NOT_YET;
if ((phase & BUSMON_PHASE_MASK) != BUSPHASE_MESSAGE_IN) {
diff --git a/drivers/scsi/qla2xxx/qla_mbx.c b/drivers/scsi/qla2xxx/qla_mbx.c
index 07afd0d8a8f3..40af7f1524ce 100644
--- a/drivers/scsi/qla2xxx/qla_mbx.c
+++ b/drivers/scsi/qla2xxx/qla_mbx.c
@@ -4028,11 +4028,10 @@ qla24xx_report_id_acquisition(scsi_qla_host_t *vha,
/* if our portname is higher then initiate N2N login */
set_bit(N2N_LOGIN_NEEDED, &vha->dpc_flags);
return;
- break;
case TOPO_FL:
ha->current_topology = ISP_CFG_FL;
break;
case TOPO_F:
ha->current_topology = ISP_CFG_F;
diff --git a/drivers/scsi/st.c b/drivers/scsi/st.c
index e2e5356a997d..43f7624508a9 100644
--- a/drivers/scsi/st.c
+++ b/drivers/scsi/st.c
@@ -2844,11 +2844,10 @@ static int st_int_ioctl(struct scsi_tape *STp, unsigned int cmd_in, unsigned lon
fileno = blkno = at_sm = 0;
break;
case MTNOP:
DEBC_printk(STp, "No op on tape.\n");
return 0; /* Should do something ? */
- break;
case MTRETEN:
cmd[0] = START_STOP;
if (STp->immediate) {
cmd[1] = 1; /* Don't wait for completion */
timeout = STp->device->request_queue->rq_timeout;
diff --git a/drivers/scsi/sym53c8xx_2/sym_hipd.c b/drivers/scsi/sym53c8xx_2/sym_hipd.c
index a9fe092a4906..255a2d48d421 100644
--- a/drivers/scsi/sym53c8xx_2/sym_hipd.c
+++ b/drivers/scsi/sym53c8xx_2/sym_hipd.c
@@ -4594,11 +4594,10 @@ static void sym_int_sir(struct sym_hcb *np)
sym_print_addr(cp->cmd,
"M_REJECT received (%x:%x).\n",
scr_to_cpu(np->lastmsg), np->msgout[0]);
}
goto out_clrack;
- break;
default:
goto out_reject;
}
break;
/*
diff --git a/drivers/staging/media/atomisp/pci/sh_css.c b/drivers/staging/media/atomisp/pci/sh_css.c
index ddee04c8248d..eab7a048ca7a 100644
--- a/drivers/staging/media/atomisp/pci/sh_css.c
+++ b/drivers/staging/media/atomisp/pci/sh_css.c
@@ -6284,11 +6284,10 @@ allocate_delay_frames(struct ia_css_pipe *pipe) {
case IA_CSS_PIPE_ID_CAPTURE: {
struct ia_css_capture_settings *mycs_capture = &pipe->pipe_settings.capture;
(void)mycs_capture;
return err;
}
- break;
case IA_CSS_PIPE_ID_VIDEO: {
struct ia_css_video_settings *mycs_video = &pipe->pipe_settings.video;
ref_info = mycs_video->video_binary.internal_frame_info;
/*The ref frame expects
diff --git a/drivers/staging/rts5208/rtsx_scsi.c b/drivers/staging/rts5208/rtsx_scsi.c
index 1deb74112ad4..672248be7bf3 100644
--- a/drivers/staging/rts5208/rtsx_scsi.c
+++ b/drivers/staging/rts5208/rtsx_scsi.c
@@ -569,12 +569,10 @@ static int start_stop_unit(struct scsi_cmnd *srb, struct rtsx_chip *chip)
case LOAD_MEDIUM:
if (check_card_ready(chip, lun))
return TRANSPORT_GOOD;
set_sense_type(chip, lun, SENSE_TYPE_MEDIA_NOT_PRESENT);
return TRANSPORT_FAILED;
-
- break;
}
return TRANSPORT_ERROR;
}
diff --git a/drivers/staging/vme/devices/vme_user.c b/drivers/staging/vme/devices/vme_user.c
index fd0ea4dbcb91..7c7d3858e6ca 100644
--- a/drivers/staging/vme/devices/vme_user.c
+++ b/drivers/staging/vme/devices/vme_user.c
@@ -355,12 +355,10 @@ static int vme_user_ioctl(struct inode *inode, struct file *file,
* to userspace as they are
*/
return vme_master_set(image[minor].resource,
master.enable, master.vme_addr, master.size,
master.aspace, master.cycle, master.dwidth);
-
- break;
}
break;
case SLAVE_MINOR:
switch (cmd) {
case VME_GET_SLAVE:
@@ -396,12 +394,10 @@ static int vme_user_ioctl(struct inode *inode, struct file *file,
*/
return vme_slave_set(image[minor].resource,
slave.enable, slave.vme_addr, slave.size,
image[minor].pci_buf, slave.aspace,
slave.cycle);
-
- break;
}
break;
}
return -EINVAL;
diff --git a/drivers/tty/nozomi.c b/drivers/tty/nozomi.c
index d42b854cb7df..861e95043191 100644
--- a/drivers/tty/nozomi.c
+++ b/drivers/tty/nozomi.c
@@ -412,15 +412,13 @@ static void read_mem32(u32 *buf, const void __iomem *mem_addr_start,
switch (size_bytes) {
case 2: /* 2 bytes */
buf16 = (u16 *) buf;
*buf16 = __le16_to_cpu(readw(ptr));
goto out;
- break;
case 4: /* 4 bytes */
*(buf) = __le32_to_cpu(readl(ptr));
goto out;
- break;
}
while (i < size_bytes) {
if (size_bytes - i == 2) {
/* Handle 2 bytes in the end */
@@ -458,19 +456,18 @@ static u32 write_mem32(void __iomem *mem_addr_start, const u32 *buf,
switch (size_bytes) {
case 2: /* 2 bytes */
buf16 = (const u16 *)buf;
writew(__cpu_to_le16(*buf16), ptr);
return 2;
- break;
case 1: /*
* also needs to write 4 bytes in this case
* so falling through..
*/
+ fallthrough;
case 4: /* 4 bytes */
writel(__cpu_to_le32(*buf), ptr);
return 4;
- break;
}
while (i < size_bytes) {
if (size_bytes - i == 2) {
/* 2 bytes */
diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index 1731d9728865..09703079db7b 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -318,31 +318,26 @@ static void imx_uart_writel(struct imx_port *sport, u32 val, u32 offset)
static u32 imx_uart_readl(struct imx_port *sport, u32 offset)
{
switch (offset) {
case UCR1:
return sport->ucr1;
- break;
case UCR2:
/*
* UCR2_SRST is the only bit in the cached registers that might
* differ from the value that was last written. As it only
* automatically becomes one after being cleared, reread
* conditionally.
*/
if (!(sport->ucr2 & UCR2_SRST))
sport->ucr2 = readl(sport->port.membase + offset);
return sport->ucr2;
- break;
case UCR3:
return sport->ucr3;
- break;
case UCR4:
return sport->ucr4;
- break;
case UFCR:
return sport->ufcr;
- break;
default:
return readl(sport->port.membase + offset);
}
}
diff --git a/drivers/usb/gadget/function/f_hid.c b/drivers/usb/gadget/function/f_hid.c
index 1125f4715830..5204769834d1 100644
--- a/drivers/usb/gadget/function/f_hid.c
+++ b/drivers/usb/gadget/function/f_hid.c
@@ -509,27 +509,23 @@ static int hidg_setup(struct usb_function *f,
VDBG(cdev, "get_report\n");
/* send an empty report */
length = min_t(unsigned, length, hidg->report_length);
memset(req->buf, 0x0, length);
-
goto respond;
- break;
case ((USB_DIR_IN | USB_TYPE_CLASS | USB_RECIP_INTERFACE) << 8
| HID_REQ_GET_PROTOCOL):
VDBG(cdev, "get_protocol\n");
length = min_t(unsigned int, length, 1);
((u8 *) req->buf)[0] = hidg->protocol;
goto respond;
- break;
case ((USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE) << 8
| HID_REQ_SET_REPORT):
VDBG(cdev, "set_report | wLength=%d\n", ctrl->wLength);
goto stall;
- break;
case ((USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE) << 8
| HID_REQ_SET_PROTOCOL):
VDBG(cdev, "set_protocol\n");
if (value > HID_REPORT_PROTOCOL)
@@ -542,11 +538,10 @@ static int hidg_setup(struct usb_function *f,
if (hidg->bInterfaceSubClass == USB_INTERFACE_SUBCLASS_BOOT) {
hidg->protocol = value;
goto respond;
}
goto stall;
- break;
case ((USB_DIR_IN | USB_TYPE_STANDARD | USB_RECIP_INTERFACE) << 8
| USB_REQ_GET_DESCRIPTOR):
switch (value >> 8) {
case HID_DT_HID:
@@ -560,33 +555,29 @@ static int hidg_setup(struct usb_function *f,
length = min_t(unsigned short, length,
hidg_desc_copy.bLength);
memcpy(req->buf, &hidg_desc_copy, length);
goto respond;
- break;
}
case HID_DT_REPORT:
VDBG(cdev, "USB_REQ_GET_DESCRIPTOR: REPORT\n");
length = min_t(unsigned short, length,
hidg->report_desc_length);
memcpy(req->buf, hidg->report_desc, length);
goto respond;
- break;
default:
VDBG(cdev, "Unknown descriptor request 0x%x\n",
value >> 8);
goto stall;
- break;
}
break;
default:
VDBG(cdev, "Unknown request 0x%x\n",
ctrl->bRequest);
goto stall;
- break;
}
stall:
return -EOPNOTSUPP;
diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c
index fe405cd38dbc..b46ef45c4d25 100644
--- a/drivers/usb/host/xhci-mem.c
+++ b/drivers/usb/host/xhci-mem.c
@@ -1142,11 +1142,10 @@ int xhci_setup_addressable_virt_dev(struct xhci_hcd *xhci, struct usb_device *ud
max_packets = MAX_PACKET(8);
break;
case USB_SPEED_WIRELESS:
xhci_dbg(xhci, "FIXME xHCI doesn't support wireless speeds\n");
return -EINVAL;
- break;
default:
/* Speed was set earlier, this shouldn't happen. */
return -EINVAL;
}
/* Find the root hub port this device is under */
diff --git a/drivers/usb/misc/iowarrior.c b/drivers/usb/misc/iowarrior.c
index 70ec29681526..efbd317f2f25 100644
--- a/drivers/usb/misc/iowarrior.c
+++ b/drivers/usb/misc/iowarrior.c
@@ -382,11 +382,10 @@ static ssize_t iowarrior_write(struct file *file,
goto exit;
}
retval = usb_set_report(dev->interface, 2, 0, buf, count);
kfree(buf);
goto exit;
- break;
case USB_DEVICE_ID_CODEMERCS_IOW56:
case USB_DEVICE_ID_CODEMERCS_IOW56AM:
case USB_DEVICE_ID_CODEMERCS_IOW28:
case USB_DEVICE_ID_CODEMERCS_IOW28L:
case USB_DEVICE_ID_CODEMERCS_IOW100:
@@ -452,18 +451,16 @@ static ssize_t iowarrior_write(struct file *file,
}
/* submit was ok */
retval = count;
usb_free_urb(int_out_urb);
goto exit;
- break;
default:
/* what do we have here ? An unsupported Product-ID ? */
dev_err(&dev->interface->dev, "%s - not supported for product=0x%x\n",
__func__, dev->product_id);
retval = -EFAULT;
goto exit;
- break;
}
error:
usb_free_coherent(dev->udev, dev->report_size, buf,
int_out_urb->transfer_dma);
error_no_buffer:
diff --git a/drivers/usb/serial/iuu_phoenix.c b/drivers/usb/serial/iuu_phoenix.c
index b4ba79123d9d..f1201d4de297 100644
--- a/drivers/usb/serial/iuu_phoenix.c
+++ b/drivers/usb/serial/iuu_phoenix.c
@@ -848,11 +848,10 @@ static int iuu_uart_baud(struct usb_serial_port *port, u32 baud_base,
dataout[DataCount++] = 0x04;
break;
default:
kfree(dataout);
return IUU_INVALID_PARAMETER;
- break;
}
switch (parity & 0xF0) {
case IUU_ONE_STOP_BIT:
dataout[DataCount - 1] |= IUU_ONE_STOP_BIT;
@@ -862,11 +861,10 @@ static int iuu_uart_baud(struct usb_serial_port *port, u32 baud_base,
dataout[DataCount - 1] |= IUU_TWO_STOP_BITS;
break;
default:
kfree(dataout);
return IUU_INVALID_PARAMETER;
- break;
}
status = bulk_immediate(port, dataout, DataCount);
if (status != IUU_OPERATION_OK)
dev_dbg(&port->dev, "%s - uart_off error\n", __func__);
diff --git a/drivers/usb/storage/freecom.c b/drivers/usb/storage/freecom.c
index 3d5f7d0ff0f1..2b098b55c4cb 100644
--- a/drivers/usb/storage/freecom.c
+++ b/drivers/usb/storage/freecom.c
@@ -429,11 +429,10 @@ static int freecom_transport(struct scsi_cmnd *srb, struct us_data *us)
/* should never hit here -- filtered in usb.c */
usb_stor_dbg(us, "freecom unimplemented direction: %d\n",
us->srb->sc_data_direction);
/* Return fail, SCSI seems to handle this better. */
return USB_STOR_TRANSPORT_FAILED;
- break;
}
return USB_STOR_TRANSPORT_GOOD;
}
diff --git a/drivers/vme/bridges/vme_tsi148.c b/drivers/vme/bridges/vme_tsi148.c
index 50ae26977a02..1227ea937059 100644
--- a/drivers/vme/bridges/vme_tsi148.c
+++ b/drivers/vme/bridges/vme_tsi148.c
@@ -504,11 +504,10 @@ static int tsi148_slave_set(struct vme_slave_resource *image, int enabled,
addr |= TSI148_LCSR_ITAT_AS_A64;
break;
default:
dev_err(tsi148_bridge->parent, "Invalid address space\n");
return -EINVAL;
- break;
}
/* Convert 64-bit variables to 2x 32-bit variables */
reg_split(vme_base, &vme_base_high, &vme_base_low);
@@ -993,11 +992,10 @@ static int tsi148_master_set(struct vme_master_resource *image, int enabled,
default:
spin_unlock(&image->lock);
dev_err(tsi148_bridge->parent, "Invalid address space\n");
retval = -EINVAL;
goto err_aspace;
- break;
}
temp_ctl &= ~(3<<4);
if (cycle & VME_SUPER)
temp_ctl |= TSI148_LCSR_OTAT_SUP;
@@ -1501,11 +1499,10 @@ static int tsi148_dma_set_vme_src_attributes(struct device *dev, __be32 *attr,
val |= TSI148_LCSR_DSAT_AMODE_USER4;
break;
default:
dev_err(dev, "Invalid address space\n");
return -EINVAL;
- break;
}
if (cycle & VME_SUPER)
val |= TSI148_LCSR_DSAT_SUP;
if (cycle & VME_PROG)
@@ -1601,11 +1598,10 @@ static int tsi148_dma_set_vme_dest_attributes(struct device *dev, __be32 *attr,
val |= TSI148_LCSR_DDAT_AMODE_USER4;
break;
default:
dev_err(dev, "Invalid address space\n");
return -EINVAL;
- break;
}
if (cycle & VME_SUPER)
val |= TSI148_LCSR_DDAT_SUP;
if (cycle & VME_PROG)
@@ -1699,11 +1695,10 @@ static int tsi148_dma_list_add(struct vme_dma_list *list,
break;
default:
dev_err(tsi148_bridge->parent, "Invalid source type\n");
retval = -EINVAL;
goto err_source;
- break;
}
/* Assume last link - this will be over-written by adding another */
entry->descriptor.dnlau = cpu_to_be32(0);
entry->descriptor.dnlal = cpu_to_be32(TSI148_LCSR_DNLAL_LLA);
@@ -1736,11 +1731,10 @@ static int tsi148_dma_list_add(struct vme_dma_list *list,
break;
default:
dev_err(tsi148_bridge->parent, "Invalid destination type\n");
retval = -EINVAL;
goto err_dest;
- break;
}
/* Fill out count */
entry->descriptor.dcnt = cpu_to_be32((u32)count);
@@ -1962,11 +1956,10 @@ static int tsi148_lm_set(struct vme_lm_resource *lm, unsigned long long lm_base,
break;
default:
mutex_unlock(&lm->mtx);
dev_err(tsi148_bridge->parent, "Invalid address space\n");
return -EINVAL;
- break;
}
if (cycle & VME_SUPER)
lm_ctl |= TSI148_LCSR_LMAT_SUPR ;
if (cycle & VME_USER)
diff --git a/drivers/vme/vme.c b/drivers/vme/vme.c
index b398293980b6..e1a940e43327 100644
--- a/drivers/vme/vme.c
+++ b/drivers/vme/vme.c
@@ -50,27 +50,22 @@ static struct vme_bridge *find_bridge(struct vme_resource *resource)
/* Get list to search */
switch (resource->type) {
case VME_MASTER:
return list_entry(resource->entry, struct vme_master_resource,
list)->parent;
- break;
case VME_SLAVE:
return list_entry(resource->entry, struct vme_slave_resource,
list)->parent;
- break;
case VME_DMA:
return list_entry(resource->entry, struct vme_dma_resource,
list)->parent;
- break;
case VME_LM:
return list_entry(resource->entry, struct vme_lm_resource,
list)->parent;
- break;
default:
printk(KERN_ERR "Unknown resource type\n");
return NULL;
- break;
}
}
/**
* vme_free_consistent - Allocate contiguous memory.
@@ -177,26 +172,22 @@ size_t vme_get_size(struct vme_resource *resource)
&aspace, &cycle, &dwidth);
if (retval)
return 0;
return size;
- break;
case VME_SLAVE:
retval = vme_slave_get(resource, &enabled, &base, &size,
&buf_base, &aspace, &cycle);
if (retval)
return 0;
return size;
- break;
case VME_DMA:
return 0;
- break;
default:
printk(KERN_ERR "Unknown resource type\n");
return 0;
- break;
}
}
EXPORT_SYMBOL(vme_get_size);
int vme_check_window(u32 aspace, unsigned long long vme_base,
diff --git a/drivers/watchdog/geodewdt.c b/drivers/watchdog/geodewdt.c
index 83418924e30a..0b699c783d57 100644
--- a/drivers/watchdog/geodewdt.c
+++ b/drivers/watchdog/geodewdt.c
@@ -148,12 +148,10 @@ static long geodewdt_ioctl(struct file *file, unsigned int cmd,
switch (cmd) {
case WDIOC_GETSUPPORT:
return copy_to_user(argp, &ident,
sizeof(ident)) ? -EFAULT : 0;
- break;
-
case WDIOC_GETSTATUS:
case WDIOC_GETBOOTSTATUS:
return put_user(0, p);
case WDIOC_SETOPTIONS:
diff --git a/fs/efs/inode.c b/fs/efs/inode.c
index 89e73a6f0d36..64f3a54a0f72 100644
--- a/fs/efs/inode.c
+++ b/fs/efs/inode.c
@@ -161,11 +161,10 @@ struct inode *efs_iget(struct super_block *super, unsigned long ino)
init_special_inode(inode, inode->i_mode, device);
break;
default:
pr_warn("unsupported inode mode %o\n", inode->i_mode);
goto read_inode_error;
- break;
}
unlock_new_inode(inode);
return inode;
diff --git a/fs/ocfs2/cluster/tcp.c b/fs/ocfs2/cluster/tcp.c
index 79a231719460..3bd8119bed5e 100644
--- a/fs/ocfs2/cluster/tcp.c
+++ b/fs/ocfs2/cluster/tcp.c
@@ -1196,11 +1196,10 @@ static int o2net_process_message(struct o2net_sock_container *sc,
break;
default:
msglog(hdr, "bad magic\n");
ret = -EINVAL;
goto out;
- break;
}
/* find a handler for it */
handler_status = 0;
nmh = o2net_handler_get(be16_to_cpu(hdr->msg_type),
diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c
index 1110ecd7d1f3..8f50c9c19f1b 100644
--- a/kernel/bpf/syscall.c
+++ b/kernel/bpf/syscall.c
@@ -2911,11 +2911,10 @@ attach_type_to_prog_type(enum bpf_attach_type attach_type)
{
switch (attach_type) {
case BPF_CGROUP_INET_INGRESS:
case BPF_CGROUP_INET_EGRESS:
return BPF_PROG_TYPE_CGROUP_SKB;
- break;
case BPF_CGROUP_INET_SOCK_CREATE:
case BPF_CGROUP_INET_SOCK_RELEASE:
case BPF_CGROUP_INET4_POST_BIND:
case BPF_CGROUP_INET6_POST_BIND:
return BPF_PROG_TYPE_CGROUP_SOCK;
diff --git a/security/integrity/ima/ima_appraise.c b/security/integrity/ima/ima_appraise.c
index 3dd8c2e4314e..f400a6122b3c 100644
--- a/security/integrity/ima/ima_appraise.c
+++ b/security/integrity/ima/ima_appraise.c
@@ -179,11 +179,10 @@ enum hash_algo ima_get_hash_algo(struct evm_ima_xattr_data *xattr_value,
case EVM_IMA_XATTR_DIGSIG:
sig = (typeof(sig))xattr_value;
if (sig->version != 2 || xattr_len <= sizeof(*sig))
return ima_hash_algo;
return sig->hash_algo;
- break;
case IMA_XATTR_DIGEST_NG:
/* first byte contains algorithm id */
ret = xattr_value->data[0];
if (ret < HASH_ALGO__LAST)
return ret;
diff --git a/security/keys/trusted-keys/trusted_tpm1.c b/security/keys/trusted-keys/trusted_tpm1.c
index b9fe02e5f84f..eddc9477d42a 100644
--- a/security/keys/trusted-keys/trusted_tpm1.c
+++ b/security/keys/trusted-keys/trusted_tpm1.c
@@ -899,11 +899,10 @@ static int datablob_parse(char *datablob, struct trusted_key_payload *p,
return ret;
ret = Opt_update;
break;
case Opt_err:
return -EINVAL;
- break;
}
return ret;
}
static struct trusted_key_options *trusted_options_alloc(void)
diff --git a/security/safesetid/lsm.c b/security/safesetid/lsm.c
index 8a176b6adbe5..1079c6d54784 100644
--- a/security/safesetid/lsm.c
+++ b/security/safesetid/lsm.c
@@ -123,11 +123,10 @@ static int safesetid_security_capable(const struct cred *cred,
* set*uid() (e.g. setting up userns uid mappings).
*/
pr_warn("Operation requires CAP_SETUID, which is not available to UID %u for operations besides approved set*uid transitions\n",
__kuid_val(cred->uid));
return -EPERM;
- break;
case CAP_SETGID:
/*
* If no policy applies to this task, allow the use of CAP_SETGID for
* other purposes.
*/
@@ -138,15 +137,13 @@ static int safesetid_security_capable(const struct cred *cred,
* set*gid() (e.g. setting up userns gid mappings).
*/
pr_warn("Operation requires CAP_SETGID, which is not available to GID %u for operations besides approved set*gid transitions\n",
__kuid_val(cred->uid));
return -EPERM;
- break;
default:
/* Error, the only capabilities were checking for is CAP_SETUID/GID */
return 0;
- break;
}
return 0;
}
/*
diff --git a/sound/pci/rme32.c b/sound/pci/rme32.c
index 869af8a32c98..4eabece4dcba 100644
--- a/sound/pci/rme32.c
+++ b/sound/pci/rme32.c
@@ -466,11 +466,10 @@ static int snd_rme32_capture_getrate(struct rme32 * rme32, int *is_adat)
return 44100;
case 7:
return 32000;
default:
return -1;
- break;
}
else
switch (n) { /* supporting the CS8412 */
case 0:
return -1;
diff --git a/sound/pci/rme9652/hdspm.c b/sound/pci/rme9652/hdspm.c
index 4a1f576dd9cf..3382c069fd3d 100644
--- a/sound/pci/rme9652/hdspm.c
+++ b/sound/pci/rme9652/hdspm.c
@@ -2284,11 +2284,10 @@ static int hdspm_get_wc_sample_rate(struct hdspm *hdspm)
switch (hdspm->io_type) {
case RayDAT:
case AIO:
status = hdspm_read(hdspm, HDSPM_RD_STATUS_1);
return (status >> 16) & 0xF;
- break;
case AES32:
status = hdspm_read(hdspm, HDSPM_statusRegister);
return (status >> HDSPM_AES32_wcFreq_bit) & 0xF;
default:
break;
@@ -2310,11 +2309,10 @@ static int hdspm_get_tco_sample_rate(struct hdspm *hdspm)
switch (hdspm->io_type) {
case RayDAT:
case AIO:
status = hdspm_read(hdspm, HDSPM_RD_STATUS_1);
return (status >> 20) & 0xF;
- break;
case AES32:
status = hdspm_read(hdspm, HDSPM_statusRegister);
return (status >> 1) & 0xF;
default:
break;
@@ -2336,11 +2334,10 @@ static int hdspm_get_sync_in_sample_rate(struct hdspm *hdspm)
switch (hdspm->io_type) {
case RayDAT:
case AIO:
status = hdspm_read(hdspm, HDSPM_RD_STATUS_2);
return (status >> 12) & 0xF;
- break;
default:
break;
}
}
@@ -2356,11 +2353,10 @@ static int hdspm_get_aes_sample_rate(struct hdspm *hdspm, int index)
switch (hdspm->io_type) {
case AES32:
timecode = hdspm_read(hdspm, HDSPM_timecodeRegister);
return (timecode >> (4*index)) & 0xF;
- break;
default:
break;
}
return 0;
}
@@ -3843,22 +3839,20 @@ static int hdspm_wc_sync_check(struct hdspm *hdspm)
return 2;
else
return 1;
}
return 0;
- break;
case MADI:
status2 = hdspm_read(hdspm, HDSPM_statusRegister2);
if (status2 & HDSPM_wcLock) {
if (status2 & HDSPM_wcSync)
return 2;
else
return 1;
}
return 0;
- break;
case RayDAT:
case AIO:
status = hdspm_read(hdspm, HDSPM_statusRegister);
@@ -3866,12 +3860,10 @@ static int hdspm_wc_sync_check(struct hdspm *hdspm)
return 2;
else if (status & 0x1000000)
return 1;
return 0;
- break;
-
case MADIface:
break;
}
diff --git a/sound/pci/rme9652/rme9652.c b/sound/pci/rme9652/rme9652.c
index 7ab10028d9fa..012fbec5e6a7 100644
--- a/sound/pci/rme9652/rme9652.c
+++ b/sound/pci/rme9652/rme9652.c
@@ -730,38 +730,31 @@ static inline int rme9652_spdif_sample_rate(struct snd_rme9652 *s)
rate_bits = rme9652_read(s, RME9652_status_register) & RME9652_F;
switch (rme9652_decode_spdif_rate(rate_bits)) {
case 0x7:
return 32000;
- break;
case 0x6:
return 44100;
- break;
case 0x5:
return 48000;
- break;
case 0x4:
return 88200;
- break;
case 0x3:
return 96000;
- break;
case 0x0:
return 64000;
- break;
default:
dev_err(s->card->dev,
"%s: unknown S/PDIF input rate (bits = 0x%x)\n",
s->card_name, rate_bits);
return 0;
- break;
}
}
/*-----------------------------------------------------------------------------
Control Interface
diff --git a/sound/soc/codecs/wcd-clsh-v2.c b/sound/soc/codecs/wcd-clsh-v2.c
index 1be82113c59a..817d8259758c 100644
--- a/sound/soc/codecs/wcd-clsh-v2.c
+++ b/sound/soc/codecs/wcd-clsh-v2.c
@@ -478,11 +478,10 @@ static int _wcd_clsh_ctrl_set_state(struct wcd_clsh_ctrl *ctrl, int req_state,
wcd_clsh_state_hph_l(ctrl, req_state, is_enable, mode);
break;
case WCD_CLSH_STATE_HPHR:
wcd_clsh_state_hph_r(ctrl, req_state, is_enable, mode);
break;
- break;
case WCD_CLSH_STATE_LO:
wcd_clsh_state_lo(ctrl, req_state, is_enable, mode);
break;
default:
break;
diff --git a/sound/soc/codecs/wl1273.c b/sound/soc/codecs/wl1273.c
index c56b9329240f..d8ced4559bf2 100644
--- a/sound/soc/codecs/wl1273.c
+++ b/sound/soc/codecs/wl1273.c
@@ -309,11 +309,10 @@ static int wl1273_startup(struct snd_pcm_substream *substream,
return -EINVAL;
}
break;
default:
return -EINVAL;
- break;
}
return 0;
}
diff --git a/sound/soc/intel/skylake/skl-pcm.c b/sound/soc/intel/skylake/skl-pcm.c
index bbe8d782e0af..b1ca64d2f7ea 100644
--- a/sound/soc/intel/skylake/skl-pcm.c
+++ b/sound/soc/intel/skylake/skl-pcm.c
@@ -500,11 +500,10 @@ static int skl_pcm_trigger(struct snd_pcm_substream *substream, int cmd,
*/
ret = skl_decoupled_trigger(substream, cmd);
if (ret < 0)
return ret;
return skl_run_pipe(skl, mconfig->pipe);
- break;
case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
case SNDRV_PCM_TRIGGER_SUSPEND:
case SNDRV_PCM_TRIGGER_STOP:
/*
diff --git a/sound/soc/ti/davinci-mcasp.c b/sound/soc/ti/davinci-mcasp.c
index a6b72ad53b43..2d85cc4c67fb 100644
--- a/sound/soc/ti/davinci-mcasp.c
+++ b/sound/soc/ti/davinci-mcasp.c
@@ -2383,11 +2383,10 @@ static int davinci_mcasp_probe(struct platform_device *pdev)
break;
default:
dev_err(&pdev->dev, "No DMA controller found (%d)\n", ret);
case -EPROBE_DEFER:
goto err;
- break;
}
if (ret) {
dev_err(&pdev->dev, "register PCM failed: %d\n", ret);
goto err;
1 year, 9 months
[PATCH RFC V3 0/9] PKS: Add Protection Keys Supervisor (PKS) support RFC v3
by ira.weiny@intel.com
From: Ira Weiny <ira.weiny(a)intel.com>
This RFC series has been reviewed by Dave Hansen.
Introduce a new page protection mechanism for supervisor pages, Protection Key
Supervisor (PKS).
2 use cases for PKS are being developed, trusted keys and PMEM. Trusted keys
is a newer use case which is still being explored. PMEM was submitted as part
of the RFC (v2) series[1]. However, since then it was found that some callers
of kmap() require a global implementation of PKS. Specifically some users of
kmap() expect mappings to be available to all kernel threads. While global use
of PKS is rare it needs to be included for correctness. Unfortunately the
kmap() updates required a large patch series to make the needed changes at the
various kmap() call sites so that patch set has been split out. Because the
global PKS feature is only required for that use case it will be deferred to
that set as well.[2] This patch set is being submitted as a precursor to both
of the use cases.
For an overview of the entire PKS ecosystem, a git tree including this series
and the 2 use cases can be found here:
https://github.com/weiny2/linux-kernel/tree/pks-rfc-v3
PKS enables protections on 'domains' of supervisor pages to limit supervisor
mode access to those pages beyond the normal paging protections. PKS works in
a similar fashion to user space pkeys, PKU. As with PKU, supervisor pkeys are
checked in addition to normal paging protections and Access or Writes can be
disabled via a MSR update without TLB flushes when permissions change. Also
like PKU, a page mapping is assigned to a domain by setting pkey bits in the
page table entry for that mapping.
Access is controlled through a PKRS register which is updated via WRMSR/RDMSR.
XSAVE is not supported for the PKRS MSR. Therefore the implementation
saves/restores the MSR across context switches and during exceptions. Nested
exceptions are supported by each exception getting a new PKS state.
For consistent behavior with current paging protections, pkey 0 is reserved and
configured to allow full access via the pkey mechanism, thus preserving the
default paging protections on mappings with the default pkey value of 0.
Other keys, (1-15) are allocated by an allocator which prepares us for key
contention from day one. Kernel users should be prepared for the allocator to
fail either because of key exhaustion or due to PKS not being supported on the
arch and/or CPU instance.
The following are key attributes of PKS.
1) Fast switching of permissions
1a) Prevents access without page table manipulations
1b) No TLB flushes required
2) Works on a per thread basis
PKS is available with 4 and 5 level paging. Like PKRU it consumes 4 bits from
the PTE to store the pkey within the entry.
[1] https://lore.kernel.org/lkml/20200717072056.73134-1-ira.weiny@intel.com/
[2] https://github.com/weiny2/linux-kernel/commit/f10abb0f0d7b4e14f03fc889031...
and a testing patch
https://github.com/weiny2/linux-kernel/commit/2a8e0fc7654a7c69b243d628f63...
Fenghua Yu (3):
x86/fpu: Refactor arch_set_user_pkey_access() for PKS support
x86/pks: Enable Protection Keys Supervisor (PKS)
x86/pks: Add PKS kernel API
Ira Weiny (6):
x86/pkeys: Create pkeys_common.h
x86/pks: Preserve the PKRS MSR on context switch
x86/entry: Pass irqentry_state_t by reference
x86/entry: Preserve PKRS MSR across exceptions
x86/fault: Report the PKRS state on fault
x86/pks: Add PKS test code
Documentation/core-api/protection-keys.rst | 102 ++-
arch/x86/Kconfig | 1 +
arch/x86/entry/common.c | 57 +-
arch/x86/include/asm/cpufeatures.h | 1 +
arch/x86/include/asm/idtentry.h | 29 +-
arch/x86/include/asm/msr-index.h | 1 +
arch/x86/include/asm/pgtable.h | 13 +-
arch/x86/include/asm/pgtable_types.h | 12 +
arch/x86/include/asm/pkeys.h | 15 +
arch/x86/include/asm/pkeys_common.h | 36 +
arch/x86/include/asm/processor.h | 13 +
arch/x86/include/uapi/asm/processor-flags.h | 2 +
arch/x86/kernel/cpu/common.c | 17 +
arch/x86/kernel/cpu/mce/core.c | 4 +
arch/x86/kernel/fpu/xstate.c | 22 +-
arch/x86/kernel/kvm.c | 4 +-
arch/x86/kernel/nmi.c | 7 +-
arch/x86/kernel/process.c | 21 +
arch/x86/kernel/traps.c | 21 +-
arch/x86/mm/fault.c | 86 ++-
arch/x86/mm/pkeys.c | 188 +++++-
include/linux/entry-common.h | 19 +-
include/linux/pgtable.h | 4 +
include/linux/pkeys.h | 23 +-
kernel/entry/common.c | 28 +-
lib/Kconfig.debug | 12 +
lib/Makefile | 3 +
lib/pks/Makefile | 3 +
lib/pks/pks_test.c | 690 ++++++++++++++++++++
mm/Kconfig | 2 +
tools/testing/selftests/x86/Makefile | 3 +-
tools/testing/selftests/x86/test_pks.c | 65 ++
32 files changed, 1376 insertions(+), 128 deletions(-)
create mode 100644 arch/x86/include/asm/pkeys_common.h
create mode 100644 lib/pks/Makefile
create mode 100644 lib/pks/pks_test.c
create mode 100644 tools/testing/selftests/x86/test_pks.c
--
2.28.0.rc0.12.gb6a658bd00c9
1 year, 9 months
Re: [RFC] treewide: cleanup unreachable breaks
by Tom Rix
On 10/19/20 4:05 PM, Jason Gunthorpe wrote:
> On Mon, Oct 19, 2020 at 12:42:15PM -0700, Nick Desaulniers wrote:
>> On Sat, Oct 17, 2020 at 10:43 PM Greg KH <gregkh(a)linuxfoundation.org> wrote:
>>> On Sat, Oct 17, 2020 at 09:09:28AM -0700, trix(a)redhat.com wrote:
>>>> From: Tom Rix <trix(a)redhat.com>
>>>>
>>>> This is a upcoming change to clean up a new warning treewide.
>>>> I am wondering if the change could be one mega patch (see below) or
>>>> normal patch per file about 100 patches or somewhere half way by collecting
>>>> early acks.
>>> Please break it up into one-patch-per-subsystem, like normal, and get it
>>> merged that way.
>>>
>>> Sending us a patch, without even a diffstat to review, isn't going to
>>> get you very far...
>> Tom,
>> If you're able to automate this cleanup, I suggest checking in a
>> script that can be run on a directory. Then for each subsystem you
>> can say in your commit "I ran scripts/fix_whatever.py on this subdir."
>> Then others can help you drive the tree wide cleanup. Then we can
>> enable -Wunreachable-code-break either by default, or W=2 right now
>> might be a good idea.
> I remember using clang-modernize in the past to fix issues very
> similar to this, if clang machinery can generate the warning, can't
> something like clang-tidy directly generate the patch?
Yes clang-tidy and similar are good tools.
Sometimes they change too much and your time shifts
from editing to analyzing and dropping changes.
I am looking at them for auto changing api.
When i have something greater than half baked i will post.
Tom
>
> You can send me a patch for drivers/infiniband/* as well
>
> Thanks,
> Jason
>
1 year, 9 months
negative count with static key devmap_managed_key
by Aneesh Kumar K.V
Hi Christoph,
commit 6f42193fd86e ("memremap: don't use a separate devm action for
devmap_managed_enable_get") changed the static key updates such that we
are now calling devmap_managed_enable_put() without doing the equivalent
devmap_managed_enable_get().
devmap_managed_enable_get() is only called for MEMORY_DEVICE_PRIVATE and
MEMORY_DEVICE_FS_DAX, But memunmap_pages() get called for other pgmap
types too. This result in the below. I can recreate this by repeatedly
switching between system-ram and devdax mode for devdax namespace.
[ 4399.892395] ------------[ cut here ]------------
[ 4399.892398] jump label: negative count!
[ 4399.892415] WARNING: CPU: 52 PID: 1335 at kernel/jump_label.c:235 static_key_slow_try_dec+0x88/0xa0
[ 4399.892417] Modules linked in:
[ 4399.892424] CPU: 52 PID: 1335 Comm: ndctl Not tainted 5.9.0-12063-g270315b8235e-dirty #332
[ 4399.892427] NIP: c000000000433318 LR: c000000000433314 CTR: 0000000000000000
[ 4399.892430] REGS: c000000025c1f3d0 TRAP: 0700 Not tainted (5.9.0-12063-g270315b8235e-dirty)
[ 4399.892432] MSR: 800000000282b033 <SF,VEC,VSX,EE,FP,ME,IR,DR,RI,LE> CR: 28088284 XER: 00000000
[ 4399.892456] CFAR: c00000000017bb30 IRQMASK: 0
GPR00: c000000000433314 c000000025c1f660 c000000002610c00 000000000000001b
GPR04: c00000000221aa50 0000000000000005 0000000000000027 c000000c79c0cf98
GPR08: 0000000000000023 0000000000000000 c0000000238b5480 c00000000265da28
GPR12: 0000000000008000 c00000001ec4e400 0000000000000000 0000000000000000
GPR16: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
GPR20: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
GPR24: 0000000000000000 0000000000000000 0000000000000001 0000000101204000
GPR28: c00000000896f1c0 c0000000027118b8 0000000000000001 0000000000000001
[ 4399.892530] NIP [c000000000433318] static_key_slow_try_dec+0x88/0xa0
[ 4399.892533] LR [c000000000433314] static_key_slow_try_dec+0x84/0xa0
[ 4399.892535] Call Trace:
[ 4399.892539] [c000000025c1f660] [c000000000433314] static_key_slow_try_dec+0x84/0xa0 (unreliable)
[ 4399.892546] [c000000025c1f6d0] [c000000000433664] __static_key_slow_dec_cpuslocked+0x34/0xd0
[ 4399.892551] [c000000025c1f700] [c0000000004337a4] static_key_slow_dec+0x54/0xf0
[ 4399.892557] [c000000025c1f770] [c00000000059c49c] memunmap_pages+0x36c/0x500
[ 4399.892562] [c000000025c1f820] [c000000000d91d10] devm_action_release+0x30/0x50
[ 4399.892568] [c000000025c1f840] [c000000000d92e34] release_nodes+0x2f4/0x3e0
[ 4399.892573] [c000000025c1f8f0] [c000000000d8b15c] device_release_driver_internal+0x17c/0x280
[ 4399.892579] [c000000025c1f930] [c000000000d883a4] bus_remove_device+0x124/0x210
[ 4399.892584] [c000000025c1f9b0] [c000000000d80ef4] device_del+0x1d4/0x530
[ 4399.892589] [c000000025c1fa70] [c000000000e341e8] unregister_dev_dax+0x48/0xe0
[ 4399.892594] [c000000025c1fae0] [c000000000d91d10] devm_action_release+0x30/0x50
[ 4399.892599] [c000000025c1fb00] [c000000000d92e34] release_nodes+0x2f4/0x3e0
[ 4399.892605] [c000000025c1fbb0] [c000000000d8b15c] device_release_driver_internal+0x17c/0x280
[ 4399.892610] [c000000025c1fbf0] [c000000000d87000] unbind_store+0x130/0x170
[ 4399.892615] [c000000025c1fc30] [c000000000d862a0] drv_attr_store+0x40/0x60
[ 4399.892621] [c000000025c1fc50] [c0000000006d316c] sysfs_kf_write+0x6c/0xb0
[ 4399.892626] [c000000025c1fc90] [c0000000006d2328] kernfs_fop_write+0x118/0x280
[ 4399.892631] [c000000025c1fce0] [c0000000005a79f8] vfs_write+0xe8/0x2a0
[ 4399.892636] [c000000025c1fd30] [c0000000005a7d94] ksys_write+0x84/0x140
[ 4399.892641] [c000000025c1fd80] [c00000000003a430] system_call_exception+0x120/0x270
[ 4399.892647] [c000000025c1fe20] [c00000000000c540] system_call_common+0xf0/0x27c
[ 4399.892650] Instruction dump:
[ 4399.892654] 41800018 38210070 7fe3fb78 ebe1fff8 4e800020 60000000 7c0802a6 3c62ff0f
[ 4399.892670] 38635a30 f8010080 4bd487b9 60000000 <0fe00000> e8010080 7c0803a6 4bffffc8
[ 4399.892688] CPU: 52 PID: 1335 Comm: ndctl Not tainted 5.9.0-12063-g270315b8235e-dirty #332
[ 4399.892690] Call Trace:
[ 4399.892694] [c000000025c1f170] [c000000000b49160] dump_stack+0xc4/0x114 (unreliable)
[ 4399.892701] [c000000025c1f1c0] [c00000000017ba8c] __warn+0xfc/0x130
[ 4399.892707] [c000000025c1f260] [c000000000b47f6c] report_bug+0xdc/0x1f0
[ 4399.892712] [c000000025c1f2f0] [c00000000002a4a4] program_check_exception+0x234/0x3a0
[ 4399.892717] [c000000025c1f360] [c0000000000093a4] program_check_common_virt+0x2a4/0x2f0
[ 4399.892724] --- interrupt: 700 at static_key_slow_try_dec+0x88/0xa0
LR = static_key_slow_try_dec+0x84/0xa0
[ 4399.892728] [c000000025c1f6d0] [c000000000433664] __static_key_slow_dec_cpuslocked+0x34/0xd0
[ 4399.892733] [c000000025c1f700] [c0000000004337a4] static_key_slow_dec+0x54/0xf0
[ 4399.892738] [c000000025c1f770] [c00000000059c49c] memunmap_pages+0x36c/0x500
[ 4399.892743] [c000000025c1f820] [c000000000d91d10] devm_action_release+0x30/0x50
[ 4399.892748] [c000000025c1f840] [c000000000d92e34] release_nodes+0x2f4/0x3e0
[ 4399.892754] [c000000025c1f8f0] [c000000000d8b15c] device_release_driver_internal+0x17c/0x280
[ 4399.892759] [c000000025c1f930] [c000000000d883a4] bus_remove_device+0x124/0x210
[ 4399.892764] [c000000025c1f9b0] [c000000000d80ef4] device_del+0x1d4/0x530
[ 4399.892769] [c000000025c1fa70] [c000000000e341e8] unregister_dev_dax+0x48/0xe0
[ 4399.892774] [c000000025c1fae0] [c000000000d91d10] devm_action_release+0x30/0x50
[ 4399.892779] [c000000025c1fb00] [c000000000d92e34] release_nodes+0x2f4/0x3e0
[ 4399.892784] [c000000025c1fbb0] [c000000000d8b15c] device_release_driver_internal+0x17c/0x280
[ 4399.892790] [c000000025c1fbf0] [c000000000d87000] unbind_store+0x130/0x170
[ 4399.892795] [c000000025c1fc30] [c000000000d862a0] drv_attr_store+0x40/0x60
[ 4399.892800] [c000000025c1fc50] [c0000000006d316c] sysfs_kf_write+0x6c/0xb0
[ 4399.892805] [c000000025c1fc90] [c0000000006d2328] kernfs_fop_write+0x118/0x280
[ 4399.892810] [c000000025c1fce0] [c0000000005a79f8] vfs_write+0xe8/0x2a0
[ 4399.892815] [c000000025c1fd30] [c0000000005a7d94] ksys_write+0x84/0x140
[ 4399.892820] [c000000025c1fd80] [c00000000003a430] system_call_exception+0x120/0x270
[ 4399.892826] [c000000025c1fe20] [c00000000000c540] system_call_common+0xf0/0x27c
[ 4399.892830] ---[ end trace c56bf28fafec054d ]---
1 year, 9 months