From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751657AbdJ2NbC (ORCPT ); Sun, 29 Oct 2017 09:31:02 -0400 Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]:39314 "EHLO mail3-relais-sop.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751387AbdJ2NbA (ORCPT ); Sun, 29 Oct 2017 09:31:00 -0400 X-IronPort-AV: E=Sophos;i="5.44,314,1505772000"; d="scan'208";a="242734174" Date: Sun, 29 Oct 2017 21:30:48 +0800 (CST) From: Julia Lawall X-X-Sender: jll@hadrien To: Colin King cc: Fabien Dessenne , Mauro Carvalho Chehab , linux-media@vger.kernel.org, kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] [media] bdisp: remove redundant assignment to pix In-Reply-To: <20171029132105.6444-1-colin.king@canonical.com> Message-ID: References: <20171029132105.6444-1-colin.king@canonical.com> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 29 Oct 2017, Colin King wrote: > From: Colin Ian King > > Pointer pix is being initialized to a value and a little later > being assigned the same value again. Remove the redundant second > duplicate assignment. Cleans up the clang warning: > > drivers/media/platform/sti/bdisp/bdisp-v4l2.c:726:26: warning: Value > stored to 'pix' during its initialization is never read > > Signed-off-by: Colin Ian King > --- > drivers/media/platform/sti/bdisp/bdisp-v4l2.c | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/drivers/media/platform/sti/bdisp/bdisp-v4l2.c b/drivers/media/platform/sti/bdisp/bdisp-v4l2.c > index 939da6da7644..14e99aeae140 100644 > --- a/drivers/media/platform/sti/bdisp/bdisp-v4l2.c > +++ b/drivers/media/platform/sti/bdisp/bdisp-v4l2.c > @@ -731,7 +731,6 @@ static int bdisp_g_fmt(struct file *file, void *fh, struct v4l2_format *f) > return PTR_ERR(frame); > } > > - pix = &f->fmt.pix; Why not keep this one and drop the first one? Maybe it would be nice to keep all the initializations related to pix together? julia > pix->width = frame->width; > pix->height = frame->height; > pix->pixelformat = frame->fmt->pixelformat; > -- > 2.14.1 > > -- > To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html >