Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1376936pxb; Fri, 1 Apr 2022 11:41:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxjNEczFCzDI1EpbeoqVyuSPi4AWYAkv278WrrFJC7BVY7EaLnl9otG9zsTj8k/3KgrnRd4 X-Received: by 2002:a17:906:c145:b0:6da:aaaf:770c with SMTP id dp5-20020a170906c14500b006daaaaf770cmr1001566ejc.504.1648838490335; Fri, 01 Apr 2022 11:41:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648838490; cv=none; d=google.com; s=arc-20160816; b=GQAIWEGvcerVCHIYNJgsg2GVyW6YufmwzKHeQJ9qqA5iJgo1CTZbidsZy9VySXxYQh jp2N7OlOqQx74o6YRPJspKRgiP06HQlmznLhjoF1e3dRn0oR0aJ6sFu7BZEU5Gu+0fuf JQW0/XYcjewQJ4UwpqCL+WTK4hANdqXnJoTspDsgy9HlerXHoWdeWlaVIRVPkHpLxdV5 mfviglCGNHWYsxdJVuDCZCYWaiyaS6t5/cJ7PmPqUP0RYEiv6gef5WL6CW/AUNACi8XU e2B5H6vkess2RKj2NJmFjnscmJ6SRJFTsc/KwJjeS400mCXrMUKxRTQXmdschNgQwfsg rXxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=7vUviIqjagA800+Kfi0dOW+YwFLrbsBNlctvy9tVv7U=; b=B7opehXv+mdmlXoKeBBgINtH5vIqeXm/XTSHXB/oV4Gkcv9L3TdcwIFIjCXgiEEScL P8FBCjNrZYrlEffS3iR8t3YWAU2XenkWgXWaIzJlYd2XgJC+QvwAVNhYHEBJ0u7SfRpQ rMzvnlF9VKPAVf7V2K6TK44eAfioui5kAPrzXfvLvWjtuu1tNTXDWiCDxM4JGQwdGrX3 uXB0gGuVVgmdA2U4xi22MFwXiPlW94iB7kKY8JZ6HzHD36ZaeIZuiBCiuLMoNh0qL1pw 82GqOw1VGSjCfeJvpVvNFWa9v6qJBRbfk3jCeEZ6MRH1ZW4dK03htuTsN+ABzZddrBhb gBGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="W+mLW/+G"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ec22-20020a170906b6d600b006df76385e49si1863219ejb.745.2022.04.01.11.41.05; Fri, 01 Apr 2022 11:41:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="W+mLW/+G"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243671AbiDAKMt (ORCPT + 99 others); Fri, 1 Apr 2022 06:12:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41376 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235557AbiDAKMt (ORCPT ); Fri, 1 Apr 2022 06:12:49 -0400 Received: from mail-pj1-x1035.google.com (mail-pj1-x1035.google.com [IPv6:2607:f8b0:4864:20::1035]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DF8B218EE99 for ; Fri, 1 Apr 2022 03:10:59 -0700 (PDT) Received: by mail-pj1-x1035.google.com with SMTP id c15-20020a17090a8d0f00b001c9c81d9648so2087202pjo.2 for ; Fri, 01 Apr 2022 03:10:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=7vUviIqjagA800+Kfi0dOW+YwFLrbsBNlctvy9tVv7U=; b=W+mLW/+G5TCFCm8phJQTLqsU1G+jYZcSAuGIyNiP4vmyj1z2hWptUMeTeomzOsGpZb rjt4CwUXHo/T15YP09eGJhZtTPgkAlLzuPBjYmMcTk8ENK862rbA/kcMnJBLPlJ6OdGf rZ4aP2Zcxg/qArrSrc7E12SIh6d+B715a78/W9wysAMoRHSfj42A/Osgv2GX67TQQJ8b vSSd/8/CeHXMUw5x0cXic+cbSIfTDGny0+7aF8iu65d5RBIXjO7hjIYOZJRyuLVOhp+T rHTKL/5V5vYjiQys+sRlJIJjFJ00fNcD5Dm2byGiv8LyPbR+e6YCczyR0tI5hHNWc3IO zUFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=7vUviIqjagA800+Kfi0dOW+YwFLrbsBNlctvy9tVv7U=; b=ZePknkEnHYKqlL/C2Kt0LfQarRuKj3j5eDME6xZsr4QZkLfQ9Vb61X0RjV+rTENcl7 Fl82SdxXnXp7GHC0Xgkj/qNfq2nhRkF96pqqh6AciFBSDEDkCxexK4siewvpLNBmKQSP HVDZ2biZT/Hg0CPxl9VfctMB842eSLo3txlwSvBCybF8yDZIg1cmP8zGebcqhm5FO/lv yAClCB31HB/9IBYAFSuaQoTu6BcCMi5hS/jX/3D4MqFO/21PbxlIxeiTJIXk6a21KH/N 5R/JRUnG3lrdwAGwBg6a0ys8xWp+l2m4Bw/aVmLpf6PhQNakqvV+hKhVfbTDani5qy3u /p/A== X-Gm-Message-State: AOAM532ftw8tVoeoLI0P9iw/EYufuFighfKZIiJEtKoHKi8LIUPOKgmC QpfCDNcdnzygTdx1yMGqedn8QOjd450ZsdJTg6+xU3k2 X-Received: by 2002:a17:90b:3850:b0:1c6:572e:f39a with SMTP id nl16-20020a17090b385000b001c6572ef39amr11010201pjb.233.1648807859421; Fri, 01 Apr 2022 03:10:59 -0700 (PDT) MIME-Version: 1.0 References: <20220330120246.25580-1-xiam0nd.tong@gmail.com> <20220330120246.25580-6-xiam0nd.tong@gmail.com> In-Reply-To: <20220330120246.25580-6-xiam0nd.tong@gmail.com> From: Patrik Jakobsson Date: Fri, 1 Apr 2022 12:10:48 +0200 Message-ID: Subject: Re: [PATCH 5/5] gma500: fix a missing break in psb_driver_load To: Xiaomeng Tong Cc: David Airlie , Daniel Vetter , Zhao Yakui , Dave Airlie , dri-devel , linux-kernel Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 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. > --- > 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 >