From: Alan Cox Subject: Re: question about drivers/gpu/drm/gma500/oaktrail_lvds.c Date: Sun, 8 Jul 2012 21:16:57 +0100 Message-ID: <20120708211657.50b20fc4@pyramind.ukuu.org.uk> References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from lxorguk.ukuu.org.uk (lxorguk.ukuu.org.uk [81.2.110.251]) by gabe.freedesktop.org (Postfix) with ESMTP id 4E5D69E787 for ; Sun, 8 Jul 2012 13:14:01 -0700 (PDT) In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org Errors-To: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org To: Julia Lawall Cc: dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org On Sun, 8 Jul 2012 10:39:43 +0200 (CEST) Julia Lawall wrote: > In the function oaktrail_lvds_mode_set, I don't think that the following > code makes any sense: > > /* Find the connector we're trying to set up */ > list_for_each_entry(connector, &mode_config->connector_list, head) { > if (!connector->encoder || connector->encoder->crtc != crtc) > continue; > } > > if (!connector) { > DRM_ERROR("Couldn't find connector when setting mode"); > return; > } > > drm_connector_property_get_value( > connector, > dev->mode_config.scaling_mode_property, > &v); > > The initial loop is a no-op, because it always continues. The test > !connector can never be true, because at the end of a list_for_each_entry > connector points to the list head, and calling > drm_connector_property_get_value on the list head probably does not make > sense. We test !connector->encoder rather than !connector ? Alan