check_format: Verify #include syntax

Change-Id: I63b877a6543293e1a5c349bcb4460b79c81ca8cd
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/c/441968
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
This commit is contained in:
Ben Walker 2019-01-24 11:47:12 -07:00 committed by Jim Harris
parent 47fadb7f9b
commit 9fd924cb40
10 changed files with 42 additions and 31 deletions

View File

@ -34,11 +34,11 @@
#ifndef SPDK_FTL_H
#define SPDK_FTL_H
#include <spdk/stdinc.h>
#include <spdk/nvme.h>
#include <spdk/nvme_ocssd.h>
#include <spdk/uuid.h>
#include <spdk/thread.h>
#include "spdk/stdinc.h"
#include "spdk/nvme.h"
#include "spdk/nvme_ocssd.h"
#include "spdk/uuid.h"
#include "spdk/thread.h"
struct spdk_ftl_dev;

View File

@ -47,7 +47,7 @@ extern "C" {
* Include a header with these additional features on Linux only.
*/
#ifndef __FreeBSD__
#include <spdk/queue_extras.h>
#include "spdk/queue_extras.h"
#endif
#ifdef __cplusplus

View File

@ -34,10 +34,10 @@
#ifndef SPDK_BDEV_FTL_H
#define SPDK_BDEV_FTL_H
#include <spdk/stdinc.h>
#include <spdk/nvme.h>
#include <spdk/bdev_module.h>
#include <spdk/ftl.h>
#include "spdk/stdinc.h"
#include "spdk/nvme.h"
#include "spdk/bdev_module.h"
#include "spdk/ftl.h"
#define FTL_MAX_CONTROLLERS 64
#define FTL_MAX_BDEVS (FTL_MAX_CONTROLLERS * 128)

View File

@ -31,10 +31,10 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <spdk/rpc.h>
#include <spdk/util.h>
#include <spdk/bdev_module.h>
#include <spdk_internal/log.h>
#include "spdk/rpc.h"
#include "spdk/util.h"
#include "spdk/bdev_module.h"
#include "spdk_internal/log.h"
#include "bdev_ftl.h"
struct rpc_construct_ftl {

View File

@ -31,11 +31,11 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <spdk/stdinc.h>
#include <spdk/nvme_spec.h>
#include <spdk/nvme_ocssd_spec.h>
#include <spdk/thread.h>
#include <spdk/ftl.h>
#include "spdk/stdinc.h"
#include "spdk/nvme_spec.h"
#include "spdk/nvme_ocssd_spec.h"
#include "spdk/thread.h"
#include "spdk/ftl.h"
#include "ftl_anm.h"
#include "ftl_core.h"

View File

@ -34,7 +34,7 @@
#ifndef FTL_ANM_H
#define FTL_ANM_H
#include <spdk/thread.h>
#include "spdk/thread.h"
#include "ftl_ppa.h"
struct ftl_nvme_ctrlr;

View File

@ -31,12 +31,12 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <spdk/stdinc.h>
#include <spdk/nvme.h>
#include <spdk/io_channel.h>
#include <spdk/bdev_module.h>
#include <spdk_internal/log.h>
#include <spdk/ftl.h>
#include "spdk/stdinc.h"
#include "spdk/nvme.h"
#include "spdk/io_channel.h"
#include "spdk/bdev_module.h"
#include "spdk_internal/log.h"
#include "spdk/ftl.h"
#include "ftl_core.h"
#include "ftl_anm.h"
#include "ftl_io.h"

View File

@ -31,9 +31,9 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <spdk/likely.h>
#include <spdk_internal/log.h>
#include <spdk/ftl.h>
#include "spdk/likely.h"
#include "spdk_internal/log.h"
#include "spdk/ftl.h"
#include "ftl_reloc.h"
#include "ftl_core.h"
#include "ftl_io.h"

View File

@ -34,8 +34,8 @@
#ifndef FTL_RELOC_H
#define FTL_RELOC_H
#include <spdk/stdinc.h>
#include <spdk/ftl.h>
#include "spdk/stdinc.h"
#include "spdk/ftl.h"
struct ftl_reloc;
struct ftl_band;

View File

@ -180,6 +180,17 @@ else
fi
rm -f scripts/posix.log
echo -n "Checking #include style..."
git grep -I -i --line-number "#include <spdk/" -- '*.[ch]' > scripts/includes.log || true
if [ -s scripts/includes.log ]; then
echo "Incorrect #include syntax. #includes of spdk/ files should use quotes."
cat scripts/includes.log
rc=1
else
echo " OK"
fi
rm -f scripts/includes.log
if hash pycodestyle 2>/dev/null; then
PEP8=pycodestyle
elif hash pep8 2>/dev/null; then