]> granicus.if.org Git - strace/blobdiff - ubi.c
Update copyright headers
[strace] / ubi.c
diff --git a/ubi.c b/ubi.c
index 1c12a23e743fd16017b6b8928b8b35b00732d8dc..a3422538904e862c337dd664ec6d963cfe9509fd 100644 (file)
--- a/ubi.c
+++ b/ubi.c
@@ -1,44 +1,19 @@
 /*
  * Copyright (c) 2012 Mike Frysinger <vapier@gentoo.org>
- * Copyright (c) 2012-2017 The strace developers.
+ * Copyright (c) 2012-2018 The strace developers.
  *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. The name of the author may not be used to endorse or promote products
- *    derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * SPDX-License-Identifier: LGPL-2.1-or-later
  */
 
 #include "defs.h"
 
-#include <linux/ioctl.h>
+#ifdef HAVE_STRUCT_UBI_ATTACH_REQ_MAX_BEB_PER1024
 
-/* The UBI api changes, so we have to keep a local copy */
-#include <linux/version.h>
-#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 7, 0)
-# include "ubi-user.h"
-#else
+# include <linux/ioctl.h>
 # include <mtd/ubi-user.h>
-#endif
 
-#include "xlat/ubi_volume_types.h"
-#include "xlat/ubi_volume_props.h"
+# include "xlat/ubi_volume_types.h"
+# include "xlat/ubi_volume_props.h"
 
 int
 ubi_ioctl(struct tcb *const tcp, const unsigned int code,
@@ -183,12 +158,12 @@ ubi_ioctl(struct tcb *const tcp, const unsigned int code,
                printnum_int(tcp, arg, "%d");
                break;
 
-#ifdef UBI_IOCVOLCRBLK
+# ifdef UBI_IOCVOLCRBLK
        case UBI_IOCVOLCRBLK:
-#endif
-#ifdef UBI_IOCVOLRMBLK
+# endif
+# ifdef UBI_IOCVOLRMBLK
        case UBI_IOCVOLRMBLK:
-#endif
+# endif
                /* no arguments */
                break;
 
@@ -198,3 +173,5 @@ ubi_ioctl(struct tcb *const tcp, const unsigned int code,
 
        return RVAL_IOCTL_DECODED;
 }
+
+#endif /* HAVE_STRUCT_UBI_ATTACH_REQ_MAX_BEB_PER1024 */