From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1726DC63777 for ; Tue, 1 Dec 2020 00:23:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A03B420809 for ; Tue, 1 Dec 2020 00:23:34 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="t1TvD1Ha" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388336AbgLAAXe (ORCPT ); Mon, 30 Nov 2020 19:23:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55586 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388331AbgLAAXe (ORCPT ); Mon, 30 Nov 2020 19:23:34 -0500 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B75DAC0613CF for ; Mon, 30 Nov 2020 16:22:53 -0800 (PST) Received: from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi [62.78.145.57]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id B457745D; Tue, 1 Dec 2020 01:22:51 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1606782171; bh=Kneg9nNkvX3Ek8BPh/XyI0mn11bKL4QfpqWbZj8Y2us=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=t1TvD1HabTRAZCk1E94vRyRg1rx0UG+q5RpuEJ5Bo391yxUd8SOFyEex+7R/9F9hh G4NZNXUJGb8/TAuG8JqbXIwTjD5J9zoosQx5fbpz0GBcwpXOtKHNBLF9xKTXhGb8ox Yy1Wiy3uFNuVrF/rsADY3cHHmoHDlcSvgEUdAGiA= Date: Tue, 1 Dec 2020 02:22:43 +0200 From: Laurent Pinchart To: Tomi Valkeinen Cc: Sebastian Reichel , Nikhil Devshatwar , linux-omap@vger.kernel.org, dri-devel@lists.freedesktop.org, Sekhar Nori , Tony Lindgren , hns@goldelico.com Subject: Re: [PATCH v4 68/80] drm/panel: panel-dsi-cm: remove extra 'if' Message-ID: <20201201002243.GM25713@pendragon.ideasonboard.com> References: <20201124124538.660710-1-tomi.valkeinen@ti.com> <20201124124538.660710-69-tomi.valkeinen@ti.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20201124124538.660710-69-tomi.valkeinen@ti.com> Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org Hi Tomi, Thank you for the patch. On Tue, Nov 24, 2020 at 02:45:26PM +0200, Tomi Valkeinen wrote: > We have a useless 'if' in the dsicm_bl_update_status(), a left over from > the conversion to DRM model. Drop the if. > > Signed-off-by: Tomi Valkeinen > --- > drivers/gpu/drm/panel/panel-dsi-cm.c | 10 ++++------ > 1 file changed, 4 insertions(+), 6 deletions(-) > > diff --git a/drivers/gpu/drm/panel/panel-dsi-cm.c b/drivers/gpu/drm/panel/panel-dsi-cm.c > index 1e7f73340736..c17ed728c695 100644 > --- a/drivers/gpu/drm/panel/panel-dsi-cm.c > +++ b/drivers/gpu/drm/panel/panel-dsi-cm.c > @@ -194,7 +194,7 @@ static int dsicm_set_update_window(struct panel_drv_data *ddata) > static int dsicm_bl_update_status(struct backlight_device *dev) > { > struct panel_drv_data *ddata = dev_get_drvdata(&dev->dev); > - int r = 0; > + int r; > int level; > > if (dev->props.fb_blank == FB_BLANK_UNBLANK && > @@ -207,11 +207,9 @@ static int dsicm_bl_update_status(struct backlight_device *dev) > > mutex_lock(&ddata->lock); > > - if (ddata->enabled) { > - if (!r) > - r = dsicm_dcs_write_1( > - ddata, MIPI_DCS_SET_DISPLAY_BRIGHTNESS, level); > - } > + if (ddata->enabled) > + r = dsicm_dcs_write_1(ddata, MIPI_DCS_SET_DISPLAY_BRIGHTNESS, > + level); If !ddata->enabled, won't r be uninitialized ? > > mutex_unlock(&ddata->lock); > -- Regards, Laurent Pinchart From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1B2BBC63777 for ; Tue, 1 Dec 2020 00:22:56 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 912B0207FF for ; Tue, 1 Dec 2020 00:22:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="t1TvD1Ha" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 912B0207FF Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ideasonboard.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id ECCAE89DF7; Tue, 1 Dec 2020 00:22:54 +0000 (UTC) Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by gabe.freedesktop.org (Postfix) with ESMTPS id 268ED89DF7 for ; Tue, 1 Dec 2020 00:22:53 +0000 (UTC) Received: from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi [62.78.145.57]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id B457745D; Tue, 1 Dec 2020 01:22:51 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1606782171; bh=Kneg9nNkvX3Ek8BPh/XyI0mn11bKL4QfpqWbZj8Y2us=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=t1TvD1HabTRAZCk1E94vRyRg1rx0UG+q5RpuEJ5Bo391yxUd8SOFyEex+7R/9F9hh G4NZNXUJGb8/TAuG8JqbXIwTjD5J9zoosQx5fbpz0GBcwpXOtKHNBLF9xKTXhGb8ox Yy1Wiy3uFNuVrF/rsADY3cHHmoHDlcSvgEUdAGiA= Date: Tue, 1 Dec 2020 02:22:43 +0200 From: Laurent Pinchart To: Tomi Valkeinen Subject: Re: [PATCH v4 68/80] drm/panel: panel-dsi-cm: remove extra 'if' Message-ID: <20201201002243.GM25713@pendragon.ideasonboard.com> References: <20201124124538.660710-1-tomi.valkeinen@ti.com> <20201124124538.660710-69-tomi.valkeinen@ti.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20201124124538.660710-69-tomi.valkeinen@ti.com> X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Tony Lindgren , hns@goldelico.com, Sekhar Nori , Sebastian Reichel , dri-devel@lists.freedesktop.org, linux-omap@vger.kernel.org, Nikhil Devshatwar Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Hi Tomi, Thank you for the patch. On Tue, Nov 24, 2020 at 02:45:26PM +0200, Tomi Valkeinen wrote: > We have a useless 'if' in the dsicm_bl_update_status(), a left over from > the conversion to DRM model. Drop the if. > > Signed-off-by: Tomi Valkeinen > --- > drivers/gpu/drm/panel/panel-dsi-cm.c | 10 ++++------ > 1 file changed, 4 insertions(+), 6 deletions(-) > > diff --git a/drivers/gpu/drm/panel/panel-dsi-cm.c b/drivers/gpu/drm/panel/panel-dsi-cm.c > index 1e7f73340736..c17ed728c695 100644 > --- a/drivers/gpu/drm/panel/panel-dsi-cm.c > +++ b/drivers/gpu/drm/panel/panel-dsi-cm.c > @@ -194,7 +194,7 @@ static int dsicm_set_update_window(struct panel_drv_data *ddata) > static int dsicm_bl_update_status(struct backlight_device *dev) > { > struct panel_drv_data *ddata = dev_get_drvdata(&dev->dev); > - int r = 0; > + int r; > int level; > > if (dev->props.fb_blank == FB_BLANK_UNBLANK && > @@ -207,11 +207,9 @@ static int dsicm_bl_update_status(struct backlight_device *dev) > > mutex_lock(&ddata->lock); > > - if (ddata->enabled) { > - if (!r) > - r = dsicm_dcs_write_1( > - ddata, MIPI_DCS_SET_DISPLAY_BRIGHTNESS, level); > - } > + if (ddata->enabled) > + r = dsicm_dcs_write_1(ddata, MIPI_DCS_SET_DISPLAY_BRIGHTNESS, > + level); If !ddata->enabled, won't r be uninitialized ? > > mutex_unlock(&ddata->lock); > -- Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel