Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp3451244pxb; Mon, 4 Apr 2022 17:23:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzF1QbRH3SmeRrh3AHLy3BMImpcpFkhZd+4Ov7az3hqikNpG4DZ+psxZD7yNdxHKvDUJI/Z X-Received: by 2002:a65:6082:0:b0:382:712b:56c7 with SMTP id t2-20020a656082000000b00382712b56c7mr628917pgu.563.1649118235841; Mon, 04 Apr 2022 17:23:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649118235; cv=none; d=google.com; s=arc-20160816; b=WG+BLJhiQWDG6fitXd7FoBtybQuNYsmA5ScsfjTtMiWCpKN632iBa/YhPjhSMKZf6w 7z5j153MLYdrJb8SyoPKgdLx0jyIu913g1y9YocQbL1KXfj144k64lqzF9Vft45VGU0k FieFXiPSTYD93PtuN4TKC5bX1t22mJmSHmWcNLAjdHsdBA79I8wvFIYAdXsXUb4ivEOq SpT9VgH6M8MtvIoJFzDNxS6FhAc1JN6bzHrWg63bq61S6LxMpX7kF4i+IN0nOa/uEm7f IJz/CRrS/FnwWUcSI7P2pnXnTBwmXNoioPHMuXR8HM8VyHxye6rBsdFvfsS+UuX40N0Y RT5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dkim-signature; bh=OEhuS+fxsVCDNNS1MKILSv4OXms02eQi0iGfBJLmlCc=; b=BBqr0gTG2mE4SBaFuGnpx1LTrsQm+rRU5x7xQZMFyLwW5qmh8ZR2iZkNCRUp/3NzDN VbkA4gJygCPnIrWL/p9Dw3zeLXetHXhvzsN0MeAzgKqlYUbMKpatBoswyPpi4H7hJmVu XoVYeWE5bY+fWp0iKbQ1MEO7q20IM7lzlX3jH7Ug5ovSYrlcjBzQ9W885KkeeR7N4WLr IQT4CpYgyim/5n9VlfXJ8Da/J6cqBK4a/dwDFiK/9ZFhbfdr+DOJ7kN3fvgIFWKeLUiK edXHqNtV2YWDlZc/vgFnvsW0o69UEcl8mqwDuc3U4Fp3n6/pQ5om+4UPFJ0fdyUteju7 +dPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="Mx/784l+"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id k9-20020a056a00168900b004fa3a8e00a8si12897700pfc.351.2022.04.04.17.23.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Apr 2022 17:23:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="Mx/784l+"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C32277CB28; Mon, 4 Apr 2022 16:48:20 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345398AbiDALS0 (ORCPT + 99 others); Fri, 1 Apr 2022 07:18:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32862 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345431AbiDALSA (ORCPT ); Fri, 1 Apr 2022 07:18:00 -0400 Received: from mail-pj1-x1033.google.com (mail-pj1-x1033.google.com [IPv6:2607:f8b0:4864:20::1033]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A68B518383A for ; Fri, 1 Apr 2022 04:16:10 -0700 (PDT) Received: by mail-pj1-x1033.google.com with SMTP id cm17so2153083pjb.2 for ; Fri, 01 Apr 2022 04:16:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=OEhuS+fxsVCDNNS1MKILSv4OXms02eQi0iGfBJLmlCc=; b=Mx/784l+9YYlEEqw3tkMkrhp/CWEf9Pyp7wfMbV9tAivm7X2pHJ+motN03vf5CHEIo 4tR3Fa1ZoNDkpcv0q5wF9OdG17Btvg/OaIzlM088QYylOEyxgvL1IoYBJn/n0hgdoLrn z/cUGx8kEvx1/cGPJj025ci8+sYK8KIX1vSv5uca0rE8R/BdzgOWpk7fEt2Cwbn30bf+ nQJ6t9nm7UUaTVlukBVuzDQyE3vB2l6ZJiL9NobmJo3E3AH5xcQxyLXhmVVRxZuu3yt/ WgBWLtUV2KvCUChEuwNOwVxp7TeF/GLs0xxeZoTj/Vmeo623jZIFREAwE/AdjmqFevGw tWow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=OEhuS+fxsVCDNNS1MKILSv4OXms02eQi0iGfBJLmlCc=; b=p76SxToPXbfwQoFUrzsaFgwg1gKSh75v3/gcX1NQFEdeRusKX0f8M/6KRKKvWeMhrs jbJae/KO1//aPHIVO+DUp/uP84/yEfjcuMDHuc/U0hZqyDpWG4K3ojTH4zRLXncBatrD eyYntFsuFQAlH+LXk8PmXCdDojBNM0Irxg4JDVekHKyHiCingf1U8UCdYxdA+21OoTNd GrbFvHAN3sOd0iguAolCgBNHd4co3ifvcj2TKK116ZZoAqXz6tpOnbwGKAHhEmUgywRJ S11f7fiankSpf1xaN6DjpGg7nI/2II/9yDzet8AaXvHNiGm/sgXHt9CF/2AXDveYSgps PV+A== X-Gm-Message-State: AOAM530ZitlTps0zPzKPhnVTqU09Nipdj9VNHOy8d9/h2yM/8oG/qN3y ZRk+bG4F+vp4aY3GIOMaBsI= X-Received: by 2002:a17:90b:4d08:b0:1c7:7567:9f6b with SMTP id mw8-20020a17090b4d0800b001c775679f6bmr11520261pjb.134.1648811770163; Fri, 01 Apr 2022 04:16:10 -0700 (PDT) Received: from ubuntu.huawei.com ([119.3.119.18]) by smtp.googlemail.com with ESMTPSA id ij17-20020a17090af81100b001c67c964d93sm13383703pjb.2.2022.04.01.04.16.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Apr 2022 04:16:09 -0700 (PDT) From: Xiaomeng Tong To: patrik.r.jakobsson@gmail.com Cc: airlied@linux.ie, airlied@redhat.com, daniel@ffwll.ch, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, xiam0nd.tong@gmail.com, yakui.zhao@intel.com Subject: Re: [PATCH 5/5] gma500: fix a missing break in psb_driver_load Date: Fri, 1 Apr 2022 19:16:04 +0800 Message-Id: <20220401111604.8106-1-xiam0nd.tong@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: References: X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 1 Apr 2022 12:10:48 +0200, Patrik Jakobsson wrote: > On Wed, Mar 30, 2022 at 2:03 PM Xiaomeng Tong wrote: > > > > Instead of exiting the loop as expected when an entry is found, the > > list_for_each_entry() continues until the traversal is complete. To > > avoid potential executing 'ret = gma_backlight_init(dev);' repeatly, > > add a break after the switch statement. > > > > Fixes: 5c49fd3aa0ab0 ("gma500: Add the core DRM files and headers") > > Signed-off-by: Xiaomeng Tong > > This is incorrect. If we always break on the first iteration we will > only run gma_backlight_init() if the first connector is LVDS or MIPI. > This might not be the case and gma_backlight_init() will never run. > The other loops you have been looking at have an "if (xxx != yyy) > continue;" statement at the top which skips all the unwanted entries > but this loop does not. > Yes, your are correct. But it still need to break the loop when found it. So it is better to add if(!ret) break; after the switch statment. I will resend another patch if it is necessary. > > --- > > drivers/gpu/drm/gma500/psb_drv.c | 2 ++ > > 1 file changed, 2 insertions(+) > > > > diff --git a/drivers/gpu/drm/gma500/psb_drv.c b/drivers/gpu/drm/gma500/psb_drv.c > > index 65cf1c79dd7c..d65a68811bf7 100644 > > --- a/drivers/gpu/drm/gma500/psb_drv.c > > +++ b/drivers/gpu/drm/gma500/psb_drv.c > > @@ -398,6 +398,8 @@ static int psb_driver_load(struct drm_device *dev, unsigned long flags) > > ret = gma_backlight_init(dev); > > break; > > } > > + > > + break; > > } > > > > if (ret) > > -- > > 2.17.1 > > -- Xiaomeng Tong