[PATCH 3/8] staging: dwc2: rename DWC2_PARAM_TEST to DWC2_OUT_OF_BOUNDS

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



DWC2_PARAM_TEST is not a very good name for this macro, so rename
it to DWC2_OUT_OF_BOUNDS

Signed-off-by: Paul Zimmerman <paulz@xxxxxxxxxxxx>
---
 drivers/staging/dwc2/core.c | 32 ++++++++++++++++----------------
 1 file changed, 16 insertions(+), 16 deletions(-)

diff --git a/drivers/staging/dwc2/core.c b/drivers/staging/dwc2/core.c
index 6d001b5..fc034ba 100644
--- a/drivers/staging/dwc2/core.c
+++ b/drivers/staging/dwc2/core.c
@@ -1912,7 +1912,7 @@ void dwc2_flush_rx_fifo(struct dwc2_hsotg *hsotg)
 	udelay(1);
 }
 
-#define DWC2_PARAM_TEST(a, b, c)	((a) < (b) || (a) > (c))
+#define DWC2_OUT_OF_BOUNDS(a, b, c)	((a) < (b) || (a) > (c))
 
 /* Parameter access functions */
 int dwc2_set_param_otg_cap(struct dwc2_hsotg *hsotg, int val)
@@ -2026,7 +2026,7 @@ int dwc2_set_param_host_support_fs_ls_low_power(struct dwc2_hsotg *hsotg,
 {
 	int retval = 0;
 
-	if (DWC2_PARAM_TEST(val, 0, 1)) {
+	if (DWC2_OUT_OF_BOUNDS(val, 0, 1)) {
 		if (val >= 0) {
 			dev_err(hsotg->dev,
 				"Wrong value for host_support_fs_low_power\n");
@@ -2209,8 +2209,8 @@ int dwc2_set_param_phy_type(struct dwc2_hsotg *hsotg, int val)
 #endif
 	int retval = 0;
 
-	if (DWC2_PARAM_TEST(val, DWC2_PHY_TYPE_PARAM_FS,
-			    DWC2_PHY_TYPE_PARAM_ULPI)) {
+	if (DWC2_OUT_OF_BOUNDS(val, DWC2_PHY_TYPE_PARAM_FS,
+			       DWC2_PHY_TYPE_PARAM_ULPI)) {
 		if (val >= 0) {
 			dev_err(hsotg->dev, "Wrong value for phy_type\n");
 			dev_err(hsotg->dev, "phy_type must be 0, 1 or 2\n");
@@ -2272,7 +2272,7 @@ int dwc2_set_param_speed(struct dwc2_hsotg *hsotg, int val)
 	int valid = 1;
 	int retval = 0;
 
-	if (DWC2_PARAM_TEST(val, 0, 1)) {
+	if (DWC2_OUT_OF_BOUNDS(val, 0, 1)) {
 		if (val >= 0) {
 			dev_err(hsotg->dev, "Wrong value for speed parameter\n");
 			dev_err(hsotg->dev, "max_speed parameter must be 0 or 1\n");
@@ -2304,8 +2304,8 @@ int dwc2_set_param_host_ls_low_power_phy_clk(struct dwc2_hsotg *hsotg, int val)
 	int valid = 1;
 	int retval = 0;
 
-	if (DWC2_PARAM_TEST(val, DWC2_HOST_LS_LOW_POWER_PHY_CLK_PARAM_48MHZ,
-			    DWC2_HOST_LS_LOW_POWER_PHY_CLK_PARAM_6MHZ)) {
+	if (DWC2_OUT_OF_BOUNDS(val, DWC2_HOST_LS_LOW_POWER_PHY_CLK_PARAM_48MHZ,
+			       DWC2_HOST_LS_LOW_POWER_PHY_CLK_PARAM_6MHZ)) {
 		if (val >= 0) {
 			dev_err(hsotg->dev,
 				"Wrong value for host_ls_low_power_phy_clk parameter\n");
@@ -2340,7 +2340,7 @@ int dwc2_set_param_phy_ulpi_ddr(struct dwc2_hsotg *hsotg, int val)
 {
 	int retval = 0;
 
-	if (DWC2_PARAM_TEST(val, 0, 1)) {
+	if (DWC2_OUT_OF_BOUNDS(val, 0, 1)) {
 		if (val >= 0) {
 			dev_err(hsotg->dev, "Wrong value for phy_ulpi_ddr\n");
 			dev_err(hsotg->dev, "phy_upli_ddr must be 0 or 1\n");
@@ -2358,7 +2358,7 @@ int dwc2_set_param_phy_ulpi_ext_vbus(struct dwc2_hsotg *hsotg, int val)
 {
 	int retval = 0;
 
-	if (DWC2_PARAM_TEST(val, 0, 1)) {
+	if (DWC2_OUT_OF_BOUNDS(val, 0, 1)) {
 		if (val >= 0) {
 			dev_err(hsotg->dev,
 				"Wrong value for phy_ulpi_ext_vbus\n");
@@ -2411,7 +2411,7 @@ int dwc2_set_param_ulpi_fs_ls(struct dwc2_hsotg *hsotg, int val)
 {
 	int retval = 0;
 
-	if (DWC2_PARAM_TEST(val, 0, 1)) {
+	if (DWC2_OUT_OF_BOUNDS(val, 0, 1)) {
 		if (val >= 0) {
 			dev_err(hsotg->dev, "Wrong value for ulpi_fs_ls\n");
 			dev_err(hsotg->dev, "ulpi_fs_ls must be 0 or 1\n");
@@ -2429,7 +2429,7 @@ int dwc2_set_param_ts_dline(struct dwc2_hsotg *hsotg, int val)
 {
 	int retval = 0;
 
-	if (DWC2_PARAM_TEST(val, 0, 1)) {
+	if (DWC2_OUT_OF_BOUNDS(val, 0, 1)) {
 		if (val >= 0) {
 			dev_err(hsotg->dev, "Wrong value for ts_dline\n");
 			dev_err(hsotg->dev, "ts_dline must be 0 or 1\n");
@@ -2450,7 +2450,7 @@ int dwc2_set_param_i2c_enable(struct dwc2_hsotg *hsotg, int val)
 #endif
 	int retval = 0;
 
-	if (DWC2_PARAM_TEST(val, 0, 1)) {
+	if (DWC2_OUT_OF_BOUNDS(val, 0, 1)) {
 		if (val >= 0) {
 			dev_err(hsotg->dev, "Wrong value for i2c_enable\n");
 			dev_err(hsotg->dev, "i2c_enable must be 0 or 1\n");
@@ -2489,7 +2489,7 @@ int dwc2_set_param_en_multiple_tx_fifo(struct dwc2_hsotg *hsotg, int val)
 	int valid = 1;
 	int retval = 0;
 
-	if (DWC2_PARAM_TEST(val, 0, 1)) {
+	if (DWC2_OUT_OF_BOUNDS(val, 0, 1)) {
 		if (val >= 0) {
 			dev_err(hsotg->dev,
 				"Wrong value for en_multiple_tx_fifo,\n");
@@ -2521,7 +2521,7 @@ int dwc2_set_param_reload_ctl(struct dwc2_hsotg *hsotg, int val)
 	int valid = 1;
 	int retval = 0;
 
-	if (DWC2_PARAM_TEST(val, 0, 1)) {
+	if (DWC2_OUT_OF_BOUNDS(val, 0, 1)) {
 		if (val >= 0) {
 			dev_err(hsotg->dev,
 				"'%d' invalid for parameter reload_ctl\n", val);
@@ -2561,7 +2561,7 @@ int dwc2_set_param_otg_ver(struct dwc2_hsotg *hsotg, int val)
 {
 	int retval = 0;
 
-	if (DWC2_PARAM_TEST(val, 0, 1)) {
+	if (DWC2_OUT_OF_BOUNDS(val, 0, 1)) {
 		if (val >= 0) {
 			dev_err(hsotg->dev,
 				"'%d' invalid for parameter otg_ver\n", val);
@@ -2740,7 +2740,7 @@ int dwc2_set_param_uframe_sched(struct dwc2_hsotg *hsotg, int val)
 {
 	int retval = 0;
 
-	if (DWC2_PARAM_TEST(val, 0, 1)) {
+	if (DWC2_OUT_OF_BOUNDS(val, 0, 1)) {
 		if (val >= 0) {
 			dev_err(hsotg->dev,
 				"'%d' invalid for parameter uframe_sched\n",
-- 
1.8.5.rc3

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux