summaryrefslogtreecommitdiff
path: root/scripts/atomic/chkdup.sh
blob: 04bb4f5c5c34336aab91d467bc1fbf086dfa2976 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/sh
# SPDX-License-Identifier: GPL-2.0
#
# Check to see if the specified atomic is already in use.  This is
# done by keeping filenames in the temporary directory specified by the
# environment variable T.
#
# Usage:
#	chkdup.sh name fallback
#
# The "name" argument is the name of the function to be generated, and
# the "fallback" argument is the name of the fallback script that is
# doing the generation.
#
# If the function is a duplicate, output a comment saying so and
# exit with non-zero (error) status.  Otherwise exit successfully
#
# If the function is a duplicate, output a comment saying so and
# exit with non-zero (error) status.  Otherwise exit successfully.

if test -f ${T}/${1}
then
	echo // Fallback ${2} omitting duplicate "${1}()" kernel-doc header.
	exit 1
fi
touch ${T}/${1}
exit 0