From patchwork Tue Feb 20 15:30:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Thompson X-Patchwork-Id: 13564161 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 1471FC48BC3 for ; Tue, 20 Feb 2024 15:30:23 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4A45C10E4B0; Tue, 20 Feb 2024 15:30:22 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="PFNqDx3s"; dkim-atps=neutral Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) by gabe.freedesktop.org (Postfix) with ESMTPS id 40F0610E4B0 for ; Tue, 20 Feb 2024 15:30:19 +0000 (UTC) Received: by mail-wm1-f54.google.com with SMTP id 5b1f17b1804b1-4127077ee20so4171755e9.1 for ; Tue, 20 Feb 2024 07:30:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708443017; x=1709047817; darn=lists.freedesktop.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Jrtujh/LnXfvYMR2N2cwo9zSO80+VM2HiXhsn02tIjQ=; b=PFNqDx3sJMuz3GAz5LD+iYULrQAgbaKdjYOit4LsbXoqmtcz4OluiNIuIchI97P0z7 ab+5P6dgc5kJeBbn3zGG8+rfLXsTZNTMU/3V54dEYIw7tqvjdVzxnAVyC02QvfxBClri r1UxUOFofuXzE0SkBKS3UwZzDTW7Kb1jw4SgVTH/3l0w5MK934V4bysQ1wcm5uFYt2+g i/RlJfhzxE64zG6Sf7qayxQuQ78l/9SkYEIPLs3JaYmOkPCrZMdu713DpMi5Z0AhQ11O 30G4C0uHtEH9a0zXgLeItsre1XO9U3xoxo61ya0Md0UVnRIuldtn3/rLAHjYrjBtJphc TU1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708443017; x=1709047817; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Jrtujh/LnXfvYMR2N2cwo9zSO80+VM2HiXhsn02tIjQ=; b=kEB3COg5fw601XDrKbTJvFKoZdDCE8jxqwmh/f0whBqBo2nMQ9C8xnqEOy3nQ91EPJ 7MK0N6WPZHrm//bNrb/2AOBWWw636QSaMYAsFdBfA/E6iH1uXQ86QkgYMQqNfF3X8gw4 NcwpCKUw14mdJRB6FLFnOLUvIBi4j6+IKuBvP9FHIID1udLLMRcjgLQuK9O/Aj6sVGeo TdP35gnPlLOAD3sgQfaN1Cy7g1XX0AmZtesnX2PuBRIgkQUTvcRxyxFfOy2DbA+oNXQ1 UmXApaqGI9lwYCbvM3MSAnSxffMJg4kjN4DCHPOhg/XT8eRYcprV7R1mRKaPkDeq/gIF m8Ag== X-Forwarded-Encrypted: i=1; AJvYcCWiC7x6X31yuoVebmXTTtqpl34UZ9zbUYyOu5APSojD3Ru896VRB4oIliD517tesOkyDaeLzWQ6t7/e5FL2N17sSLcHZtsMLgkV9tP8Bz/Y X-Gm-Message-State: AOJu0YwaY7o178bBBnMmLEI5wmocW/cEd8ZjEc5ADnb1wt+Sl/eanmSU xMWjA61ashPl4b5C0jfG+FPIqnG4yzQn53MLsC4gg1PCag7U/w+K5lD1/qq12Ls= X-Google-Smtp-Source: AGHT+IFm14DobYCPmbNLGol/rwT+mRhKjIrwciaLuFCcheE5WveQ1xwJForozYxveJbElFbLbjVPiA== X-Received: by 2002:a05:600c:45c7:b0:412:63fc:1c4b with SMTP id s7-20020a05600c45c700b0041263fc1c4bmr4848698wmo.10.1708443017431; Tue, 20 Feb 2024 07:30:17 -0800 (PST) Received: from aspen.lan (aztw-34-b2-v4wan-166919-cust780.vm26.cable.virginm.net. [82.37.195.13]) by smtp.gmail.com with ESMTPSA id m4-20020a05600c280400b0040fe308ff25sm14691564wmb.24.2024.02.20.07.30.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Feb 2024 07:30:16 -0800 (PST) From: Daniel Thompson To: Lee Jones , Jingoo Han Cc: Daniel Thompson , Luca Weiss , dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/4] backlight: da9052: Fully initialize backlight_properties during probe Date: Tue, 20 Feb 2024 15:30:05 +0000 Message-ID: <20240220153010.76238-2-daniel.thompson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240220153010.76238-1-daniel.thompson@linaro.org> References: <20240220153010.76238-1-daniel.thompson@linaro.org> MIME-Version: 1.0 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: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" props is stack allocated and the fields that are not explcitly set by the probe function need to be zeroed or we'll get undefined behaviour (especially so power/blank states)! Fixes: 6ede3d832aaa ("backlight: add driver for DA9052/53 PMIC v1") Signed-off-by: Daniel Thompson --- drivers/video/backlight/da9052_bl.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/video/backlight/da9052_bl.c b/drivers/video/backlight/da9052_bl.c index 1cdc8543310b4..b8ff7046510eb 100644 --- a/drivers/video/backlight/da9052_bl.c +++ b/drivers/video/backlight/da9052_bl.c @@ -117,6 +117,7 @@ static int da9052_backlight_probe(struct platform_device *pdev) wleds->led_reg = platform_get_device_id(pdev)->driver_data; wleds->state = DA9052_WLEDS_OFF; + memset(&props, 0, sizeof(struct backlight_properties)); props.type = BACKLIGHT_RAW; props.max_brightness = DA9052_MAX_BRIGHTNESS; From patchwork Tue Feb 20 15:30:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Thompson X-Patchwork-Id: 13564162 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 8262CC48BC3 for ; Tue, 20 Feb 2024 15:30:25 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B0CFB10E4B6; Tue, 20 Feb 2024 15:30:22 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="WpBG2cHx"; dkim-atps=neutral Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) by gabe.freedesktop.org (Postfix) with ESMTPS id D9F1410E4B0 for ; Tue, 20 Feb 2024 15:30:20 +0000 (UTC) Received: by mail-wm1-f42.google.com with SMTP id 5b1f17b1804b1-4127109699dso3369295e9.2 for ; Tue, 20 Feb 2024 07:30:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708443019; x=1709047819; darn=lists.freedesktop.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Dg9eYBATJE28KVVYL5JHYrMeYFjWDGTymWB+eHLR51Y=; b=WpBG2cHxh0WVWaHj8nUBp+CBDAXSymqw8zgzSvyqFI2uA4hsVF5jWNYvC3N7wSUtNr IOyI6u0ozaun3B4N9kFQ2grUVlb/5JxM89noZpiOPGm5ucVpqBtDXXSwkbQPHI5AG0sH iiLVjjFcUa1zIW/q022/uJmbXCPyk3yz9vMhmTWmrKbZA3bc+lotEy7EikrBUcz9ytpJ +dAzBpC9Kjysg1Ykgahchys8K6wYySal3FRD/jxDG0H2Dna3SI/RaEx4a9uNjUhvZu1w s4FeqvOcFs8wJJcdckSTNF2uat+lJkTLh1/yFznalgRD1Jqdi+19A7qmG2ZYf4T0YuRx gdIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708443019; x=1709047819; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Dg9eYBATJE28KVVYL5JHYrMeYFjWDGTymWB+eHLR51Y=; b=SbO2rE3GfgQC5vgccW2XY1PyTXtUm9D75iM4CmHFxmW6KwPxZQ13jkfKYQR2w3AtcN YVcJ8l27i3WkH+VQlgaLGX5yyi8dflGC7Lfyi66cmSqCCPCGw3Isp09QbCt062SSWQMe gp/xRlWwutRPjJBX1FDM8QdpKG3sphnXMIj4l6CC8qDYcmHmwx5IQHIPK5aOdvrRfuCN ya6z9xOYDLdfirFgIX4v69UrDVrbHEcf+nQUqMIhFBpdBjWW390Y+itV2z6Rvslb/2tm xBx0Z4tyQa3YIkUnZeyhYKG6J2HADjgf6YzGyU5vQ6Uy41I2lACT+twzpuTeRJtPGWxI 4Pqw== X-Forwarded-Encrypted: i=1; AJvYcCUfqie5EwAX9CPbxBoFZqKCipbRLF9fIy8iR+TJ8HYCPwfFf6TIHIdTEI/86a8+gP7nkSm54Q4gl6ieW4BFGShbIoV65PIt45BWo1+Lznhi X-Gm-Message-State: AOJu0YwsH/AVyijU/azRs67p7mRKp/g0omjX++8KQCl68lBi+UyhQscz z5dp4qyEDwEY8VyVbR5zgSoynEPU1V4yVugaK0IXbPiLs/IedL0l8MMIBFT/ARA= X-Google-Smtp-Source: AGHT+IGVWP1PsTIPuhfoCEDD9mFLoVD1M1jFW0GdMz0Ht5jy2dnUwgwZCQxJtaVq+F+uxqiSbUMY5A== X-Received: by 2002:a05:600c:1d04:b0:412:62ec:672e with SMTP id l4-20020a05600c1d0400b0041262ec672emr4734507wms.30.1708443019097; Tue, 20 Feb 2024 07:30:19 -0800 (PST) Received: from aspen.lan (aztw-34-b2-v4wan-166919-cust780.vm26.cable.virginm.net. [82.37.195.13]) by smtp.gmail.com with ESMTPSA id m4-20020a05600c280400b0040fe308ff25sm14691564wmb.24.2024.02.20.07.30.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Feb 2024 07:30:17 -0800 (PST) From: Daniel Thompson To: Lee Jones , Jingoo Han Cc: Daniel Thompson , Luca Weiss , dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/4] backlight: lm3639: Fully initialize backlight_properties during probe Date: Tue, 20 Feb 2024 15:30:06 +0000 Message-ID: <20240220153010.76238-3-daniel.thompson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240220153010.76238-1-daniel.thompson@linaro.org> References: <20240220153010.76238-1-daniel.thompson@linaro.org> MIME-Version: 1.0 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: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" props is stack allocated and the fields that are not explcitly set by the probe function need to be zeroed or we'll get undefined behaviour (especially so power/blank states)! Fixes: 0f59858d5119 ("backlight: add new lm3639 backlight driver") Signed-off-by: Daniel Thompson --- drivers/video/backlight/lm3639_bl.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/video/backlight/lm3639_bl.c b/drivers/video/backlight/lm3639_bl.c index 5246c171497d6..564f62acd7211 100644 --- a/drivers/video/backlight/lm3639_bl.c +++ b/drivers/video/backlight/lm3639_bl.c @@ -338,6 +338,7 @@ static int lm3639_probe(struct i2c_client *client) } /* backlight */ + memset(&props, 0, sizeof(struct backlight_properties)); props.type = BACKLIGHT_RAW; props.brightness = pdata->init_brt_led; props.max_brightness = pdata->max_brt_led; From patchwork Tue Feb 20 15:30:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Thompson X-Patchwork-Id: 13564164 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 9F7C7C48BC3 for ; Tue, 20 Feb 2024 15:30:30 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 64C2610E4BD; Tue, 20 Feb 2024 15:30:29 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="hWQTbzaV"; dkim-atps=neutral Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) by gabe.freedesktop.org (Postfix) with ESMTPS id 901F710E4B6 for ; Tue, 20 Feb 2024 15:30:22 +0000 (UTC) Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-4127008decdso5077995e9.1 for ; Tue, 20 Feb 2024 07:30:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708443021; x=1709047821; darn=lists.freedesktop.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=CcW5EHUKgbIlTJ9AkvlcTH/1qNEKLD/WUfYuV6zpMeg=; b=hWQTbzaVwTL3GFXPgFanfLqo5wfuozki2oLYBjP+qOT2Y94l+x5U0iiHbwCsjo8mrT VldAYCUvsecBb88RTiS0ZpjZQDgEmM5I6jE297mRvIVrLqQ8tlxDfsYmBEPFNfbOEpVa v5r+K3QI9l7192jXHVkIz8Q11yDO62A7icqbrXn5yA8MSzpbzy/cRR+b8siymag5Omjr pfL/i3kc4sHYbzNwlC/JHwNYODo66ouLEk9HCPuc06fDccVXT/s0nnNhdG4d99WaCGEI qu8Zc3PvN/UuUzG1SE6ZXgXW4ohQC0BY961+5B6zhXhrkUXuqaRTU+H9Ek3yFuP+4s3a g3Cg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708443021; x=1709047821; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=CcW5EHUKgbIlTJ9AkvlcTH/1qNEKLD/WUfYuV6zpMeg=; b=DGooFvD9OSRlYLEFdmFBTqx9XClyOVg2bhcE1x57nA983Snb0VGo0dAZ7V3KbQ00a2 P5I7CYJ+MVzspw+im2DFPcLoMWZZJqqtaNjO792Qt51JlE1fpfx9MePxNl3Q9teQEiEx Nf9eqK7KjhkUZ3zKwk1RDVSazoHylkkCytvag3ZqRMFK9DQSBFA+xaS5OGtYxSdj3aWx 4vbtBzYHdV0YfDduPUewe72W9pgKhrX8N2dIfPMpJ2eMkQwlG8NQAl+hPh+8nAuCLEQJ ZJT9hTndPapFzXoS0DYJGL4Urp28Krpk9o+8anMzSpmFjeVrtfQ0tovu5b0z6OsAezG3 ktJg== X-Forwarded-Encrypted: i=1; AJvYcCUt4zOdTjgoBoJ23jy7mYCVwCtg8KIC/pKYYKq5kPfur8Gq+Cl6aT0OzatT3lO1e7jAcNtfO7tU3+rc4OXY63Sn57qw9NtNc47Ne27NkO1h X-Gm-Message-State: AOJu0YwpXSe8cdus8i9oiQnTgIBNz9aPZ6XaNwqeJVTMtlSTQJr3sl/e n7T0BBSsFIysisFCVjjGvWwykHQM4ovkqOyWe4Gg6BdBfysXK0qjdfkg3iooY2I= X-Google-Smtp-Source: AGHT+IFRnEcCOrYMH/Z6LuCcovUr2mE5uwVOXe9d/ihECMTEDLLMcUoqMuZPky/aASEJWkUNQz7xAQ== X-Received: by 2002:a05:600c:1e01:b0:412:5f1f:fd0e with SMTP id ay1-20020a05600c1e0100b004125f1ffd0emr6114959wmb.0.1708443020878; Tue, 20 Feb 2024 07:30:20 -0800 (PST) Received: from aspen.lan (aztw-34-b2-v4wan-166919-cust780.vm26.cable.virginm.net. [82.37.195.13]) by smtp.gmail.com with ESMTPSA id m4-20020a05600c280400b0040fe308ff25sm14691564wmb.24.2024.02.20.07.30.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Feb 2024 07:30:19 -0800 (PST) From: Daniel Thompson To: Lee Jones , Jingoo Han Cc: Daniel Thompson , Luca Weiss , dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/4] backlight: lp8788: Fully initialize backlight_properties during probe Date: Tue, 20 Feb 2024 15:30:07 +0000 Message-ID: <20240220153010.76238-4-daniel.thompson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240220153010.76238-1-daniel.thompson@linaro.org> References: <20240220153010.76238-1-daniel.thompson@linaro.org> MIME-Version: 1.0 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: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" props is stack allocated and the fields that are not explcitly set by the probe function need to be zeroed or we'll get undefined behaviour (especially so power/blank states)! Fixes: c5a51053cf3b ("backlight: add new lp8788 backlight driver") Signed-off-by: Daniel Thompson --- drivers/video/backlight/lp8788_bl.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/video/backlight/lp8788_bl.c b/drivers/video/backlight/lp8788_bl.c index d1a14b0db265b..31f97230ee506 100644 --- a/drivers/video/backlight/lp8788_bl.c +++ b/drivers/video/backlight/lp8788_bl.c @@ -191,6 +191,7 @@ static int lp8788_backlight_register(struct lp8788_bl *bl) int init_brt; char *name; + memset(&props, 0, sizeof(struct backlight_properties)); props.type = BACKLIGHT_PLATFORM; props.max_brightness = MAX_BRIGHTNESS; From patchwork Tue Feb 20 15:30:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Thompson X-Patchwork-Id: 13564163 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id C201AC5475B for ; Tue, 20 Feb 2024 15:30:29 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 03F9110E4BC; Tue, 20 Feb 2024 15:30:29 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="s8oFi/BX"; dkim-atps=neutral Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0640D10E4BD for ; Tue, 20 Feb 2024 15:30:24 +0000 (UTC) Received: by mail-wm1-f42.google.com with SMTP id 5b1f17b1804b1-4126f8c6b3cso4982605e9.0 for ; Tue, 20 Feb 2024 07:30:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708443022; x=1709047822; darn=lists.freedesktop.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=YwLWP4/vhF0uIJPtwS5+bkpQQd9v2zac6pd8EH25YT0=; b=s8oFi/BXPQxFSCnNvZwoxs9cOTQ1kuSaQFL2NnuLQy3yOzh1La+CwZV9niVNzBWOKr PUxoNVrJsCm3apOKh0Cjq4sKkqQEG1Q/3KRQHweKTOw+YWp3zmFdyjl+E3WI1UeW5sng MViFlzCG16nLB0a78wnxH0R5GZU0z/rtMgXuLCbwvrzIkGDqlUY16aaIx0zE2EfW9cnt tj7s1VWPof6t/oVdkUhiQC0Rr2pSTmksl+Wnc24JRzGxKRYcwDeP9WXPDvlrLETPYKQB ER/amzQRY2+wF7OXAhKvMROrzDCWeRhi980CEDEsBXGlChUdK4STsF4k9IS4DNLjuDNo zrtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708443022; x=1709047822; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=YwLWP4/vhF0uIJPtwS5+bkpQQd9v2zac6pd8EH25YT0=; b=CXMz6yMrPCwTjSJWpxIFx0SNHXFpkPQYq44DFWW0OqlKWK0is75EaDxGlEF6sCuCow WqbQdYdA71ZSCjQKFp+ZRM++C5vJ3u1kX9U6/HKRCT4Hxl1w66LkFzhP8KqrKI3nh2eN DVyY5heDthOmfiqmCsiYLIHRR3lF9nAYwinNCHBeu1+uRcqOs3stoYPh0Gtcl1NX/LFG N5czyIh364No+KMOtEsRWjsxYI9rgyaTJuV2WtEmMaua+OeQ0p//lTYamWs6q8sTYpQp PRs8u0owvF2r3R+1vmlZOgnViYoo4qtBicqxACsuoeCUxZ5ZcQjFq2/iKOvmXhhYN4B6 OsmQ== X-Forwarded-Encrypted: i=1; AJvYcCUN1Yx9eGDLi6ctoRN2dQzaD+qwHIX47dG1eBimKT6JVya88J5YOm9tU6PsmMVmXc+LoxL8RSzXhDoYaCFE+SFtjsnEjRnNUwpKft9ng3Uq X-Gm-Message-State: AOJu0YyeIRow/TWr/JXDUfSgIVvx+GMNqY4h5kq8PA38zWxzaCUQRGou 4tiZa1SNHGP5Nctv6d6y1MiMOih+0XqErMf8zhU04Jl5c9/wchPhVruYWhWhca5XD1o4qeUbn+8 zN+s= X-Google-Smtp-Source: AGHT+IEGWcSQbhDlP9tq4t7O/sVQt2zHCnqWm9u68HuVcuEt7FNSTdwzCSXTgIgXE/i7RnLhBW0X2w== X-Received: by 2002:a05:600c:2805:b0:411:a5f9:26f5 with SMTP id m5-20020a05600c280500b00411a5f926f5mr13067635wmb.38.1708443022356; Tue, 20 Feb 2024 07:30:22 -0800 (PST) Received: from aspen.lan (aztw-34-b2-v4wan-166919-cust780.vm26.cable.virginm.net. [82.37.195.13]) by smtp.gmail.com with ESMTPSA id m4-20020a05600c280400b0040fe308ff25sm14691564wmb.24.2024.02.20.07.30.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Feb 2024 07:30:21 -0800 (PST) From: Daniel Thompson To: Lee Jones , Jingoo Han Cc: Daniel Thompson , Luca Weiss , dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 4/4] backlight: mp3309c: Fully initialize backlight_properties during probe Date: Tue, 20 Feb 2024 15:30:08 +0000 Message-ID: <20240220153010.76238-5-daniel.thompson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240220153010.76238-1-daniel.thompson@linaro.org> References: <20240220153010.76238-1-daniel.thompson@linaro.org> MIME-Version: 1.0 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: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" props is stack allocated and, although this driver initializes all the fields that are not "owned" by the framework, we'd still like to ensure it is zeroed to avoid problems from this driver if the fields change. Signed-off-by: Daniel Thompson --- drivers/video/backlight/mp3309c.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/video/backlight/mp3309c.c b/drivers/video/backlight/mp3309c.c index 34d71259fac1d..cdf302d6f1cb5 100644 --- a/drivers/video/backlight/mp3309c.c +++ b/drivers/video/backlight/mp3309c.c @@ -373,6 +373,7 @@ static int mp3309c_probe(struct i2c_client *client) chip->pdata = pdata; /* Backlight properties */ + memset(&props, 0, sizeof(struct backlight_properties)); props.brightness = pdata->default_brightness; props.max_brightness = pdata->max_brightness; props.scale = BACKLIGHT_SCALE_LINEAR;