Skip to contentSkip to conversation

checkpatch fixes

PATCH In review Tobin C Harding 2 participants 2 messages May 16, 2016 – May 17, 2016

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 checkpatch fixes

Fix a couple of checkpatch errors and a bunch of warnings.

---

Two occurences of (foo != NULL) changed to (!foo) even though not picked up by checkpatch.pl

 drivers/gpu/drm/gma500/cdv_intel_lvds.c | 39 +++++++++++++++------------------
 1 file changed, 18 insertions(+), 21 deletions(-)
drivers/gpu/drm/gma500/cdv_intel_lvds.c +18 -21
index 813ef23..34f695c 100644
@@ -229,6 +229,7 @@ static void cdv_intel_lvds_set_power(struct drm_device *dev,
 static void cdv_intel_lvds_encoder_dpms(struct drm_encoder *encoder, int mode)
 {
 	struct drm_device *dev = encoder->dev;
+
 	if (mode == DRM_MODE_DPMS_ON)
 		cdv_intel_lvds_set_power(dev, encoder, true);
 	else
@@ -284,7 +285,7 @@ static bool cdv_intel_lvds_mode_fixup(struct drm_encoder *encoder,
 			    head) {
 		if (tmp_encoder != encoder
 		    && tmp_encoder->crtc == encoder->crtc) {
-			printk(KERN_ERR "Can't enable LVDS and another "
+			pr_err("Can't enable LVDS and another "
 			       "encoder on the same pipe\n");
 			return false;
 		}
@@ -296,7 +297,7 @@ static bool cdv_intel_lvds_mode_fixup(struct drm_encoder *encoder,
 	 * with the panel scaling set up to source from the H/VDisplay
 	 * of the original mode.
 	 */
-	if (panel_fixed_mode != NULL) {
+	if (panel_fixed_mode) {
 		adjusted_mode->hdisplay = panel_fixed_mode->hdisplay;
 		adjusted_mode->hsync_start = panel_fixed_mode->hsync_start;
 		adjusted_mode->hsync_end = panel_fixed_mode->hsync_end;
@@ -410,7 +411,8 @@ static int cdv_intel_lvds_get_modes(struct drm_connector *connector)
 	struct psb_intel_mode_device *mode_dev = &dev_priv->mode_dev;
 	int ret;
 
-	ret = psb_intel_ddc_get_modes(connector, &gma_encoder->i2c_bus->adapter);
+	ret = psb_intel_ddc_get_modes(connector,
+				      &gma_encoder->i2c_bus->adapter);
 
 	if (ret)
 		return ret;
@@ -423,7 +425,7 @@ static int cdv_intel_lvds_get_modes(struct drm_connector *connector)
 	connector->display_info.max_vfreq = 200;
 	connector->display_info.min_hfreq = 0;
 	connector->display_info.max_hfreq = 200;
-	if (mode_dev->panel_fixed_mode != NULL) {
+	if (mode_dev->panel_fixed_mode) {
 		struct drm_display_mode *mode =
 		    drm_mode_duplicate(dev, mode_dev->panel_fixed_mode);
 		drm_mode_probed_add(connector, mode);
@@ -503,7 +505,7 @@ static int cdv_intel_lvds_set_property(struct drm_connector *connector,
 							value))
 			return -1;
 		else
-                        gma_backlight_set(encoder->dev, value);
+			gma_backlight_set(encoder->dev, value);
 	} else if (!strcmp(property->name, "DPMS") && encoder) {
 		const struct drm_encoder_helper_funcs *helpers =
 					encoder->helper_private;
@@ -574,7 +576,7 @@ static bool lvds_is_present_in_vbt(struct drm_device *dev,
 			continue;
 
 		if (child->i2c_pin)
-		    *i2c_pin = child->i2c_pin;
+			*i2c_pin = child->i2c_pin;
 
 		/* However, we cannot trust the BIOS writers to populate
 		 * the VBT correctly.  Since LVDS requires additional
@@ -624,13 +626,11 @@ void cdv_intel_lvds_init(struct drm_device *dev,
 		return;
 	}
 
-	gma_encoder = kzalloc(sizeof(struct gma_encoder),
-				    GFP_KERNEL);
+	gma_encoder = kzalloc(sizeof(struct gma_encoder), GFP_KERNEL);
 	if (!gma_encoder)
 		return;
 
-	gma_connector = kzalloc(sizeof(struct gma_connector),
-				      GFP_KERNEL);
+	gma_connector = kzalloc(sizeof(struct gma_connector), GFP_KERNEL);
 	if (!gma_connector)
 		goto failed_connector;
 
@@ -665,7 +665,7 @@ void cdv_intel_lvds_init(struct drm_device *dev,
 	connector->interlace_allowed = false;
 	connector->doublescan_allowed = false;
 
-	/*Attach connector properties*/
+	/* Attach connector properties */
 	drm_object_attach_property(&connector->base,
 				      dev->mode_config.scaling_mode_property,
 				      DRM_MODE_SCALE_FULLSCREEN);
@@ -677,12 +677,10 @@ void cdv_intel_lvds_init(struct drm_device *dev,
 	 * Set up I2C bus
 	 * FIXME: distroy i2c_bus when exit
 	 */
-	gma_encoder->i2c_bus = psb_intel_i2c_create(dev,
-							 GPIOB,
-							 "LVDSBLC_B");
+	gma_encoder->i2c_bus = psb_intel_i2c_create(dev, GPIOB,	"LVDSBLC_B");
+						    
 	if (!gma_encoder->i2c_bus) {
-		dev_printk(KERN_ERR,
-			&dev->pdev->dev, "I2C bus registration failed.\n");
+		dev_err(&dev->pdev->dev, "I2C bus registration failed.\n");
 		goto failed_blc_i2c;
 	}
 	gma_encoder->i2c_bus->slave_addr = 0x2C;
@@ -703,8 +701,7 @@ void cdv_intel_lvds_init(struct drm_device *dev,
 							 GPIOC,
 							 "LVDSDDC_C");
 	if (!gma_encoder->ddc_bus) {
-		dev_printk(KERN_ERR, &dev->pdev->dev,
-			   "DDC bus registration " "failed.\n");
+		dev_err(&dev->pdev->dev, "DDC bus registration failed.\n");
 		goto failed_ddc;
 	}
 
@@ -779,15 +776,15 @@ out:
 
 failed_find:
 	mutex_unlock(&dev->mode_config.mutex);
-	printk(KERN_ERR "Failed find\n");
+	pr_err("Failed find\n");
 	if (gma_encoder->ddc_bus)
 		psb_intel_i2c_destroy(gma_encoder->ddc_bus);
 failed_ddc:
-	printk(KERN_ERR "Failed DDC\n");
+	pr_err("Failed DDC\n");
 	if (gma_encoder->i2c_bus)
 		psb_intel_i2c_destroy(gma_encoder->i2c_bus);
 failed_blc_i2c:
-	printk(KERN_ERR "Failed BLC\n");
+	pr_err("Failed BLC\n");
 	drm_encoder_cleanup(encoder);
 	drm_connector_cleanup(connector);
 	kfree(lvds_priv);
Signature · 6 lines
2.8.2

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#1 lore raw
Quoted 3 lines · Tobin C Harding

Fix a couple of checkpatch errors and a bunch of warnings.

Patch needs a drm/gma500: prefix in the summary. Also please list in the commit message itself what kinds of warnings exactly you've fixed. Most maintainers also want that you split the patch up into one addressing each issue separately (e.g. one for whitespace, one for printk, one for != NULL removal).
-Daniel

Quoted 151 lines

---

Two occurences of (foo != NULL) changed to (!foo) even though not picked up by checkpatch.pl

 drivers/gpu/drm/gma500/cdv_intel_lvds.c | 39 +++++++++++++++------------------
 1 file changed, 18 insertions(+), 21 deletions(-)
drivers/gpu/drm/gma500/cdv_intel_lvds.c +18 -21
index 813ef23..34f695c 100644
@@ -229,6 +229,7 @@ static void cdv_intel_lvds_set_power(struct drm_device *dev,
 static void cdv_intel_lvds_encoder_dpms(struct drm_encoder *encoder, int mode)
 {
 	struct drm_device *dev = encoder->dev;
+
 	if (mode == DRM_MODE_DPMS_ON)
 		cdv_intel_lvds_set_power(dev, encoder, true);
 	else
@@ -284,7 +285,7 @@ static bool cdv_intel_lvds_mode_fixup(struct drm_encoder *encoder,
 			    head) {
 		if (tmp_encoder != encoder
 		    && tmp_encoder->crtc == encoder->crtc) {
-			printk(KERN_ERR "Can't enable LVDS and another "
+			pr_err("Can't enable LVDS and another "
 			       "encoder on the same pipe\n");
 			return false;
 		}
@@ -296,7 +297,7 @@ static bool cdv_intel_lvds_mode_fixup(struct drm_encoder *encoder,
 	 * with the panel scaling set up to source from the H/VDisplay
 	 * of the original mode.
 	 */
-	if (panel_fixed_mode != NULL) {
+	if (panel_fixed_mode) {
 		adjusted_mode->hdisplay = panel_fixed_mode->hdisplay;
 		adjusted_mode->hsync_start = panel_fixed_mode->hsync_start;
 		adjusted_mode->hsync_end = panel_fixed_mode->hsync_end;
@@ -410,7 +411,8 @@ static int cdv_intel_lvds_get_modes(struct drm_connector *connector)
 	struct psb_intel_mode_device *mode_dev = &dev_priv->mode_dev;
 	int ret;
 
-	ret = psb_intel_ddc_get_modes(connector, &gma_encoder->i2c_bus->adapter);
+	ret = psb_intel_ddc_get_modes(connector,
+				      &gma_encoder->i2c_bus->adapter);
 
 	if (ret)
 		return ret;
@@ -423,7 +425,7 @@ static int cdv_intel_lvds_get_modes(struct drm_connector *connector)
 	connector->display_info.max_vfreq = 200;
 	connector->display_info.min_hfreq = 0;
 	connector->display_info.max_hfreq = 200;
-	if (mode_dev->panel_fixed_mode != NULL) {
+	if (mode_dev->panel_fixed_mode) {
 		struct drm_display_mode *mode =
 		    drm_mode_duplicate(dev, mode_dev->panel_fixed_mode);
 		drm_mode_probed_add(connector, mode);
@@ -503,7 +505,7 @@ static int cdv_intel_lvds_set_property(struct drm_connector *connector,
 							value))
 			return -1;
 		else
-                        gma_backlight_set(encoder->dev, value);
+			gma_backlight_set(encoder->dev, value);
 	} else if (!strcmp(property->name, "DPMS") && encoder) {
 		const struct drm_encoder_helper_funcs *helpers =
 					encoder->helper_private;
@@ -574,7 +576,7 @@ static bool lvds_is_present_in_vbt(struct drm_device *dev,
 			continue;
 
 		if (child->i2c_pin)
-		    *i2c_pin = child->i2c_pin;
+			*i2c_pin = child->i2c_pin;
 
 		/* However, we cannot trust the BIOS writers to populate
 		 * the VBT correctly.  Since LVDS requires additional
@@ -624,13 +626,11 @@ void cdv_intel_lvds_init(struct drm_device *dev,
 		return;
 	}
 
-	gma_encoder = kzalloc(sizeof(struct gma_encoder),
-				    GFP_KERNEL);
+	gma_encoder = kzalloc(sizeof(struct gma_encoder), GFP_KERNEL);
 	if (!gma_encoder)
 		return;
 
-	gma_connector = kzalloc(sizeof(struct gma_connector),
-				      GFP_KERNEL);
+	gma_connector = kzalloc(sizeof(struct gma_connector), GFP_KERNEL);
 	if (!gma_connector)
 		goto failed_connector;
 
@@ -665,7 +665,7 @@ void cdv_intel_lvds_init(struct drm_device *dev,
 	connector->interlace_allowed = false;
 	connector->doublescan_allowed = false;
 
-	/*Attach connector properties*/
+	/* Attach connector properties */
 	drm_object_attach_property(&connector->base,
 				      dev->mode_config.scaling_mode_property,
 				      DRM_MODE_SCALE_FULLSCREEN);
@@ -677,12 +677,10 @@ void cdv_intel_lvds_init(struct drm_device *dev,
 	 * Set up I2C bus
 	 * FIXME: distroy i2c_bus when exit
 	 */
-	gma_encoder->i2c_bus = psb_intel_i2c_create(dev,
-							 GPIOB,
-							 "LVDSBLC_B");
+	gma_encoder->i2c_bus = psb_intel_i2c_create(dev, GPIOB,	"LVDSBLC_B");
+						    
 	if (!gma_encoder->i2c_bus) {
-		dev_printk(KERN_ERR,
-			&dev->pdev->dev, "I2C bus registration failed.\n");
+		dev_err(&dev->pdev->dev, "I2C bus registration failed.\n");
 		goto failed_blc_i2c;
 	}
 	gma_encoder->i2c_bus->slave_addr = 0x2C;
@@ -703,8 +701,7 @@ void cdv_intel_lvds_init(struct drm_device *dev,
 							 GPIOC,
 							 "LVDSDDC_C");
 	if (!gma_encoder->ddc_bus) {
-		dev_printk(KERN_ERR, &dev->pdev->dev,
-			   "DDC bus registration " "failed.\n");
+		dev_err(&dev->pdev->dev, "DDC bus registration failed.\n");
 		goto failed_ddc;
 	}
 
@@ -779,15 +776,15 @@ out:
 
 failed_find:
 	mutex_unlock(&dev->mode_config.mutex);
-	printk(KERN_ERR "Failed find\n");
+	pr_err("Failed find\n");
 	if (gma_encoder->ddc_bus)
 		psb_intel_i2c_destroy(gma_encoder->ddc_bus);
 failed_ddc:
-	printk(KERN_ERR "Failed DDC\n");
+	pr_err("Failed DDC\n");
 	if (gma_encoder->i2c_bus)
 		psb_intel_i2c_destroy(gma_encoder->i2c_bus);
 failed_blc_i2c:
-	printk(KERN_ERR "Failed BLC\n");
+	pr_err("Failed BLC\n");
 	drm_encoder_cleanup(encoder);
 	drm_connector_cleanup(connector);
 	kfree(lvds_priv);
Signature · 6 lines
2.8.2

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel