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 autolearn=unavailable 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 4C9CBC43461 for ; Tue, 6 Apr 2021 08:51:46 +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 EFF99613C0 for ; Tue, 6 Apr 2021 08:51:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EFF99613C0 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org 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 488466E0A0; Tue, 6 Apr 2021 08:51:45 +0000 (UTC) Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com [IPv6:2a00:1450:4864:20::536]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1259E6E0A0 for ; Tue, 6 Apr 2021 08:51:43 +0000 (UTC) Received: by mail-ed1-x536.google.com with SMTP id o19so15577176edc.3 for ; Tue, 06 Apr 2021 01:51:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=+76LEhmQVtVbwUuq2qvswXIMQNELjwa8jYT8LCkNp0c=; b=WvVa+ovd5StppJREwAr3JiPc2mlSsQbd5suTkS1Au/QZZj3L38tBsrNfhD138VVWk9 jC2x2lMbs5yA7DAzlNHjS5LyubDXQcDfarR/VwksA6QvIVnh2akqy6TJxhPMDZFkbRl2 Re6bhZZfyeudUfXg/bOMkINySRPr70RRgG5bjuYRRFS5T68bysvRpkKb2pspN/Db9VWg AcSyRVWwn3P+fiNH60tEVJRHygrwm1BJRmYFk1xZ478DzjPs8u3MTR0YIj2cxVB1JPzm tE5cWIH7CNzvnRyRY2g1d4HTBil2JdXSRopDKOlpHxBTR/TFciko8e6mZ04z9fGzF9et dwxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=+76LEhmQVtVbwUuq2qvswXIMQNELjwa8jYT8LCkNp0c=; b=ujF5/gm8J5YRqA1qHVj1kfiTv/5PpZnZmwvcTKxoNDj/Rvfx7ovx7DUkjJYdXwyNmH 8nAsUrIVmZsraer/or+9/WbV6Q7nBe+PgxqgmM+oAA863koVumceM6QVdTo0ZAl3yN2N /BdfRhXtCK9Pwexes3HRV/1qaSwqo1Y3gg5ki1yQ/+0MTMjT2n+/3qzrE2zagzKMJXuU UR153GmdVZkDyN3vm4X7W5jypbUEsOLrqYh0GqhLMSu8wIfqignRfFTSTxL43+pfaCXm 57c1eMklWziLbK/UecEg7qaV0OLdPdynwtzaeM52NQWf51tlcs82X5PgcZpZ8eWp1Iwd tyzA== X-Gm-Message-State: AOAM530i/dsiXkdZ2GT/7E5UP63dnkK8FUfRSKy9vc5ke/IPgOwyXvUC 3OF+ZBWvRiOp0Dkkk1prZehXFw== X-Google-Smtp-Source: ABdhPJynT1SrcWhMhtjcMzeeIqE/f6+E7hQFk+hzymJ7Sy/E1j8F1S3HLkRGIbRau4xfLmAp5pZewA== X-Received: by 2002:aa7:d687:: with SMTP id d7mr35827939edr.118.1617699102678; Tue, 06 Apr 2021 01:51:42 -0700 (PDT) Received: from holly.lan (cpc141216-aztw34-2-0-cust174.18-1.cable.virginm.net. [80.7.220.175]) by smtp.gmail.com with ESMTPSA id w1sm5393531edt.89.2021.04.06.01.51.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Apr 2021 01:51:42 -0700 (PDT) Date: Tue, 6 Apr 2021 09:51:40 +0100 From: Daniel Thompson To: Zheng Yongjun Subject: Re: [PATCH -next] backlight: backlight: Use DEFINE_MUTEX() for mutex lock Message-ID: <20210406085140.b7zffcrkdquxxsxs@holly.lan> References: <20210405101440.14937-1-zhengyongjun3@huawei.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210405101440.14937-1-zhengyongjun3@huawei.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: linux-fbdev@vger.kernel.org, Jingoo Han , kernel-janitors@vger.kernel.org, dri-devel@lists.freedesktop.org, Hulk Robot , Lee Jones Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Mon, Apr 05, 2021 at 06:14:40PM +0800, Zheng Yongjun wrote: > mutex lock can be initialized automatically with DEFINE_MUTEX() > rather than explicitly calling mutex_init(). > > Reported-by: Hulk Robot > Signed-off-by: Zheng Yongjun This patch looks like a resend of this one (but with a different revision number): https://lkml.org/lkml/2020/12/24/229 A resend should always maintain the version number and be clearly marked as a resend. In this case, there is also a pending review comment that you have ignored. Given I also clarified when you asked (off-list) for additional details I'm very surprised to see this patch circulated again without modification. I have repeated the feedback below. > --- > drivers/video/backlight/backlight.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/drivers/video/backlight/backlight.c b/drivers/video/backlight/backlight.c > index 537fe1b376ad..d7a09c422547 100644 > --- a/drivers/video/backlight/backlight.c > +++ b/drivers/video/backlight/backlight.c > @@ -64,7 +64,7 @@ > */ > > static struct list_head backlight_dev_list; > -static struct mutex backlight_dev_list_mutex; > +static DEFINE_MUTEX(backlight_dev_list_mutex); > static struct blocking_notifier_head backlight_notifier; > > static const char *const backlight_types[] = { > @@ -757,7 +757,6 @@ static int __init backlight_class_init(void) > backlight_class->dev_groups = bl_device_groups; > backlight_class->pm = &backlight_class_dev_pm_ops; > INIT_LIST_HEAD(&backlight_dev_list); > - mutex_init(&backlight_dev_list_mutex); > BLOCKING_INIT_NOTIFIER_HEAD(&backlight_notifier); On Mon, 4 Jan 2021 at 14:19, Daniel Thompson wrote: : the purpose of backlight_dev_list_mutex is (as the name suggests) to : protect backlight_dev_list. It makes no sense to initialize these : variables from different places within the code. It just makes it : harder to reason about the lifetimes of the variables. : : To be clear, switching over to static initializers is a good change, : but please change all three in one patch. Daniel. _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel