From b0c3e121396d9ea04a9a37923f89bceaca3f0e8b Mon Sep 17 00:00:00 2001
From: Daniel Agar <daniel@agar.ca>
Date: Sat, 3 Nov 2018 14:22:30 -0400
Subject: [PATCH] delete unused IOCTL ACCELIOCGSCALE

---
 src/drivers/drv_accel.h                     | 3 ---
 src/drivers/imu/adis16448/adis16448.cpp     | 5 -----
 src/drivers/imu/adis16477/ADIS16477.cpp     | 5 -----
 src/drivers/imu/bma180/bma180.cpp           | 5 -----
 src/drivers/imu/bmi055/BMI055_accel.cpp     | 5 -----
 src/drivers/imu/bmi160/bmi160.cpp           | 5 -----
 src/drivers/imu/fxos8701cq/fxos8701cq.cpp   | 5 -----
 src/drivers/imu/lsm303d/lsm303d.cpp         | 5 -----
 src/drivers/imu/mpu6000/mpu6000.cpp         | 5 -----
 src/drivers/imu/mpu9250/mpu9250.cpp         | 5 -----
 src/modules/simulator/accelsim/accelsim.cpp | 5 -----
 src/modules/simulator/gyrosim/gyrosim.cpp   | 5 -----
 12 files changed, 58 deletions(-)

diff --git a/src/drivers/drv_accel.h b/src/drivers/drv_accel.h
index 6f7c679792..0f6269b5f1 100644
--- a/src/drivers/drv_accel.h
+++ b/src/drivers/drv_accel.h
@@ -82,9 +82,6 @@ struct accel_calibration_s {
 /** set the accel scaling constants to the structure pointed to by (arg) */
 #define ACCELIOCSSCALE		_ACCELIOC(5)
 
-/** get the accel scaling constants into the structure pointed to by (arg) */
-#define ACCELIOCGSCALE		_ACCELIOC(6)
-
 /** set the accel measurement range to handle at least (arg) g */
 #define ACCELIOCSRANGE		_ACCELIOC(7)
 
diff --git a/src/drivers/imu/adis16448/adis16448.cpp b/src/drivers/imu/adis16448/adis16448.cpp
index 4181aa2dd5..1d94b27623 100644
--- a/src/drivers/imu/adis16448/adis16448.cpp
+++ b/src/drivers/imu/adis16448/adis16448.cpp
@@ -1086,11 +1086,6 @@ ADIS16448::ioctl(struct file *filp, int cmd, unsigned long arg)
 			}
 		}
 
-	case ACCELIOCGSCALE:
-		/* copy scale out */
-		memcpy((struct accel_calibration_s *) arg, &_accel_scale, sizeof(_accel_scale));
-		return OK;
-
 	case ACCELIOCSRANGE:
 		return -EINVAL;
 
diff --git a/src/drivers/imu/adis16477/ADIS16477.cpp b/src/drivers/imu/adis16477/ADIS16477.cpp
index 3bbd653ae2..c5bb8d3470 100644
--- a/src/drivers/imu/adis16477/ADIS16477.cpp
+++ b/src/drivers/imu/adis16477/ADIS16477.cpp
@@ -425,11 +425,6 @@ ADIS16477::ioctl(struct file *filp, int cmd, unsigned long arg)
 			}
 		}
 
-	case ACCELIOCGSCALE:
-		/* copy scale out */
-		memcpy((struct accel_calibration_s *) arg, &_accel_scale, sizeof(_accel_scale));
-		return OK;
-
 	case ACCELIOCSRANGE:
 		return -EINVAL;
 
diff --git a/src/drivers/imu/bma180/bma180.cpp b/src/drivers/imu/bma180/bma180.cpp
index 319a6bb97a..3202788374 100644
--- a/src/drivers/imu/bma180/bma180.cpp
+++ b/src/drivers/imu/bma180/bma180.cpp
@@ -481,11 +481,6 @@ BMA180::ioctl(struct file *filp, int cmd, unsigned long arg)
 		memcpy(&_accel_scale, (struct accel_calibration_s *) arg, sizeof(_accel_scale));
 		return OK;
 
-	case ACCELIOCGSCALE:
-		/* copy scale out */
-		memcpy((struct accel_calibration_s *) arg, &_accel_scale, sizeof(_accel_scale));
-		return OK;
-
 	case ACCELIOCSRANGE:
 		return set_range(arg);
 
diff --git a/src/drivers/imu/bmi055/BMI055_accel.cpp b/src/drivers/imu/bmi055/BMI055_accel.cpp
index 24f701e417..77c7a799ad 100644
--- a/src/drivers/imu/bmi055/BMI055_accel.cpp
+++ b/src/drivers/imu/bmi055/BMI055_accel.cpp
@@ -432,11 +432,6 @@ BMI055_accel::ioctl(struct file *filp, int cmd, unsigned long arg)
 			}
 		}
 
-	case ACCELIOCGSCALE:
-		/* copy scale out */
-		memcpy((struct accel_calibration_s *) arg, &_accel_scale, sizeof(_accel_scale));
-		return OK;
-
 	case ACCELIOCSRANGE:
 		return set_accel_range(arg);
 
diff --git a/src/drivers/imu/bmi160/bmi160.cpp b/src/drivers/imu/bmi160/bmi160.cpp
index ace9a2b776..2e38756675 100644
--- a/src/drivers/imu/bmi160/bmi160.cpp
+++ b/src/drivers/imu/bmi160/bmi160.cpp
@@ -668,11 +668,6 @@ BMI160::ioctl(struct file *filp, int cmd, unsigned long arg)
 			}
 		}
 
-	case ACCELIOCGSCALE:
-		/* copy scale out */
-		memcpy((struct accel_calibration_s *) arg, &_accel_scale, sizeof(_accel_scale));
-		return OK;
-
 	case ACCELIOCSRANGE:
 		return set_accel_range(arg);
 
diff --git a/src/drivers/imu/fxos8701cq/fxos8701cq.cpp b/src/drivers/imu/fxos8701cq/fxos8701cq.cpp
index 570c7997e9..1d63441938 100644
--- a/src/drivers/imu/fxos8701cq/fxos8701cq.cpp
+++ b/src/drivers/imu/fxos8701cq/fxos8701cq.cpp
@@ -907,11 +907,6 @@ FXOS8701CQ::ioctl(struct file *filp, int cmd, unsigned long arg)
 		/* convert to m/s^2 and return rounded in G */
 		return (unsigned long)((_accel_range_m_s2) / CONSTANTS_ONE_G + 0.5f);
 
-	case ACCELIOCGSCALE:
-		/* copy scale out */
-		memcpy((struct accel_calibration_s *) arg, &_accel_scale, sizeof(_accel_scale));
-		return OK;
-
 	default:
 		/* give it to the superclass */
 		return SPI::ioctl(filp, cmd, arg);
diff --git a/src/drivers/imu/lsm303d/lsm303d.cpp b/src/drivers/imu/lsm303d/lsm303d.cpp
index ca8b0b9e01..7c694d76b4 100644
--- a/src/drivers/imu/lsm303d/lsm303d.cpp
+++ b/src/drivers/imu/lsm303d/lsm303d.cpp
@@ -919,11 +919,6 @@ LSM303D::ioctl(struct file *filp, int cmd, unsigned long arg)
 		/* convert to m/s^2 and return rounded in G */
 		return (unsigned long)((_accel_range_m_s2) / CONSTANTS_ONE_G + 0.5f);
 
-	case ACCELIOCGSCALE:
-		/* copy scale out */
-		memcpy((struct accel_calibration_s *) arg, &_accel_scale, sizeof(_accel_scale));
-		return OK;
-
 	default:
 		/* give it to the superclass */
 		return SPI::ioctl(filp, cmd, arg);
diff --git a/src/drivers/imu/mpu6000/mpu6000.cpp b/src/drivers/imu/mpu6000/mpu6000.cpp
index 73bcd7bcc0..616b1e06ce 100644
--- a/src/drivers/imu/mpu6000/mpu6000.cpp
+++ b/src/drivers/imu/mpu6000/mpu6000.cpp
@@ -1385,11 +1385,6 @@ MPU6000::ioctl(struct file *filp, int cmd, unsigned long arg)
 			}
 		}
 
-	case ACCELIOCGSCALE:
-		/* copy scale out */
-		memcpy((struct accel_calibration_s *) arg, &_accel_scale, sizeof(_accel_scale));
-		return OK;
-
 	case ACCELIOCSRANGE:
 		return set_accel_range(arg);
 
diff --git a/src/drivers/imu/mpu9250/mpu9250.cpp b/src/drivers/imu/mpu9250/mpu9250.cpp
index 130c961394..493993988b 100644
--- a/src/drivers/imu/mpu9250/mpu9250.cpp
+++ b/src/drivers/imu/mpu9250/mpu9250.cpp
@@ -845,11 +845,6 @@ MPU9250::ioctl(struct file *filp, int cmd, unsigned long arg)
 			}
 		}
 
-	case ACCELIOCGSCALE:
-		/* copy scale out */
-		memcpy((struct accel_calibration_s *) arg, &_accel_scale, sizeof(_accel_scale));
-		return OK;
-
 	case ACCELIOCSRANGE:
 		return set_accel_range(arg);
 
diff --git a/src/modules/simulator/accelsim/accelsim.cpp b/src/modules/simulator/accelsim/accelsim.cpp
index 12c99c48bf..2b5f542a25 100644
--- a/src/modules/simulator/accelsim/accelsim.cpp
+++ b/src/modules/simulator/accelsim/accelsim.cpp
@@ -591,11 +591,6 @@ ACCELSIM::devIOCTL(unsigned long cmd, unsigned long arg)
 		/* convert to m/s^2 and return rounded in G */
 		return (unsigned long)((_accel_range_m_s2) / CONSTANTS_ONE_G + 0.5f);
 
-	case ACCELIOCGSCALE:
-		/* copy scale out */
-		memcpy((struct accel_calibration_s *) arg, &(_accel_scale), sizeof(_accel_scale));
-		return OK;
-
 	default:
 		/* give it to the superclass */
 		return VirtDevObj::devIOCTL(cmd, arg);
diff --git a/src/modules/simulator/gyrosim/gyrosim.cpp b/src/modules/simulator/gyrosim/gyrosim.cpp
index ecfcd78bed..4298e00817 100644
--- a/src/modules/simulator/gyrosim/gyrosim.cpp
+++ b/src/modules/simulator/gyrosim/gyrosim.cpp
@@ -718,11 +718,6 @@ GYROSIM::devIOCTL(unsigned long cmd, unsigned long arg)
 			}
 		}
 
-	case ACCELIOCGSCALE:
-		/* copy scale out */
-		memcpy((struct accel_calibration_s *) arg, &_accel_scale, sizeof(_accel_scale));
-		return OK;
-
 	case ACCELIOCSRANGE:
 		return set_accel_range(arg);
 
-- 
GitLab