Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755701AbbLAJjA (ORCPT ); Tue, 1 Dec 2015 04:39:00 -0500 Received: from mail-bn1on0064.outbound.protection.outlook.com ([157.56.110.64]:35712 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753948AbbLAJi4 (ORCPT ); Tue, 1 Dec 2015 04:38:56 -0500 Authentication-Results: spf=pass (sender IP is 137.71.25.57) smtp.mailfrom=analog.com; gmail.com; dkim=none (message not signed) header.d=none;gmail.com; dmarc=bestguesspass action=none header.from=analog.com; Reply-To: Subject: Re: [PATCH] backlight: adp8860: fix another uninitialized variable use References: <3284846.T0rzz6n1As@wuerfel> To: Arnd Bergmann , Lee Jones CC: Jingoo Han , , , From: Michael Hennerich Organization: Analog Devices Inc. Message-ID: <565D6937.90503@analog.com> Date: Tue, 1 Dec 2015 10:32:39 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <3284846.T0rzz6n1As@wuerfel> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1;BY2FFO11FD017;1:VSVUOi5zVN22l5rsF9H/tknyZfiPjspQYvfGI+HmkUiniAzs6QGhUMpheNTj8JlPl7vsBO4GvojSVgazbCSpKfQFVARdqOYqv3yqUrBQ1nOR9bke4357NSX3uAvmMnURNkUVzFbXFd4vMTnK6qpvTV5aCr1rKVKYqXZxLptvjxIeuNlpVMyzEaETXegyoUXnIrRwAHujFKE8Mex62QwOPWWoXvzgRBT62ngvwrMF+2K6c0VwVTHmNH5fCdhZ0zrBhjX9Gns97z0TcGFs/I5wCib2xU3tQhxG6QDOfzx0MvT7y//o3pEkYVJO6jcAoJoCx99ie936egMgTAyY8+ph14tcDlymWYeojCiVve+Ovv2GsMUB6CS6SbmKFenRZgig+pLUSkja2pgW0AbRutfk/QcDSWbPLBpUU3ys4sT+Wyc= X-Forefront-Antispam-Report: CIP:137.71.25.57;CTRY:US;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10009020)(6009001)(2980300002)(438002)(377454003)(199003)(24454002)(189002)(479174004)(19580395003)(19580405001)(87936001)(106466001)(23676002)(43066003)(189998001)(65816999)(54356999)(5001970100001)(76176999)(5001770100001)(50986999)(2950100001)(83506001)(575784001)(86362001)(53806999)(4001350100001)(47776003)(50466002)(6806005)(77096005)(64126003)(33656002)(586003)(1096002)(1220700001)(5008740100001)(65956001)(230700001)(36756003)(65806001);DIR:OUT;SFP:1101;SCL:1;SRVR:SN2PR03MB048;H:nwd2mta2.analog.com;FPR:;SPF:Pass;PTR:nwd2mail11.analog.com;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: 1;SN2PR03MB048;2:bJ/XzdlQ8UXXXtCo0vOlPi1wu6qLZLfADFhtRSc5e/7CesqwuoRTW7Y6X+RRRzn6x4urYFDx35+lS/NV+zEeScFC8OHTMXCNxaAeHrp6XGY+O0O3PCdR44+1TDMbDpMASjz+bP4wL++qnAkze8SLHg==;3:nKbRaTEa69JwrHVkih4x4naVwgVBy4FLQQPzr53Okr/gUgCFqSTz/y0Fgz28zRaxGhL1OYZoly5DBfFp/gyh4O7nITrUuM4fZvBFmHo/o/ZAmBe7tdn616QVKdThiRmSoJLeISDY4Iw0v9YOdIVsMYG7aMTC9XSdk+wocYem+dkqNMLtwuocGzvVVCWva2OD6Dt/k9J9dJefgEax98voaqlHjBj6L2Y9j9DCDyfhL+dIg41ZdpKJWCUDBzFk/NCd;25:4jGnYx6vxMO0ufSG88OA5vvUcnObGVdjRiDzzN1em783n58E+GVyGj1DHE9yEtnMsCENrQSfYQYMLh4UBYuwYypWmODGjpkTGzMkzXrnG2Pfen/WmR2oUX6r1WV33HYfgL3MvnWHo5Nwr7t/uAmvx+5G9km8o82V79us9Peu0lvl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TqqnIDV4GRT7R001Uqlg1my+MHdm9Qz4sOBRLH1hwcujzfEfOjN6/nK+RVNRnnFXa3YwTghS9RkemmzFql X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(232431446821674); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(2401047)(520078)(8121501046)(5005006)(3002001)(10201501046);SRVR:SN2PR03MB048;BCL:0;PCL:0;RULEID:;SRVR:SN2PR03MB048; X-Forefront-PRVS: 07778E4001 X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtTTjJQUjAzTUIwNDg7MjM6QStMbkc3MG4xQXJKa1JScTI4Q21MNU94Qk5I?= =?utf-8?B?UTR2eFlhZ1V0V3E1SXBSVVU3VlN5QnllZ0lPNzVVTXVEczltQ0lFTFF3OHZt?= =?utf-8?B?OHJnRGlwUFVGOWh6K0FTSkxLZmtGS2o4cjZsd2R1dEVEckNBVnVEc2tmWXha?= =?utf-8?B?RzMyRGxvZEt2Q1ZMNGEwalJ3K01kOUVJdTA4ZHJnWFEwcUtxdnBmOVdER09P?= =?utf-8?B?Tzl1QTJrVmZxbVZaYzZpVFJZRStSaVpIYlRyZEl0b1J2N1pjb2FOdDBqQ0xV?= =?utf-8?B?QlBxZTVpUUFRUnM1WFJ5WDVENTFZMXFIdjh6Q3IwSUhpbU03blBUQUhzb3ly?= =?utf-8?B?dWlMMEd5V3UwTzdtU2QrVWhvYndXZ0pTZVBodHZJTVRscEFobHlvcExLWnV5?= =?utf-8?B?eEpqbFRsTUlFWW1pOWhMZEoweXNYa1I5ZVpMUVMycVR4Tk1WeXdYYkhvREFk?= =?utf-8?B?M1p6R3NZZHI0L1hHVkUrWEVuaW84Sk15MmJvK0RMTXYwaDBDSUcwNnNzRzFW?= =?utf-8?B?RklKUUJRUzZCc29RaXVIWGhjMGRjVUNQem9OV0hOTG5wYnFZd0xBZmlkN3k2?= =?utf-8?B?NkVBVUp3NGtVdkNXTGFoYzcyTEYrN29EM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change-Diagnostics: 1;SN2PR03MB048;5:NThNfVNlv+UbpTUri+mgH5C0SSXQmbBYQ/Ribu5DHMzZIYoEw8LnKzMhvlALUOrlIMe3BZHT6EKCstr7iBq6P5zkUWrWRo0YtzPk1z/6Iv2YIPocK9x8Ypzv/cq3f7khV3qNoJBdEKBVMc8qTguHYA==;24:lwBpPA7lUaIoee25vFdr9zdpZNbK+RfsicSE0h/oFtjyJOr0s/JUSoQx9LXQthYce1nyNZZ7dA4yzh6Fay0RWrt0dbqaaXE+VzeIoWUu/lQ= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: analog.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Dec 2015 09:38:52.9922 (UTC) X-MS-Exchange-CrossTenant-Id: eaa689b4-8f87-40e0-9c6f-7228de4d754a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=eaa689b4-8f87-40e0-9c6f-7228de4d754a;Ip=[137.71.25.57];Helo=[nwd2mta2.analog.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN2PR03MB048 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2135 Lines: 58 On 11/30/2015 12:24 PM, Arnd Bergmann wrote: > A recent patch I did fixed two potential uses of uninitialized > variables in the adp8870 and adp8860 drivers. Unfortunately, > I missed another one: > > drivers/video/backlight/adp8860_bl.c: In function 'adp8860_bl_ambient_light_level_show': > drivers/video/backlight/adp8860_bl.c:570:11: warning: 'reg_val' may be used uninitialized in this function > > This does the same change as before in one additional function, > and also changes the check for the return value in a way that > avoids another false positive warning with a similar message. > > Signed-off-by: Arnd Bergmann Acked-by: Michael Hennerich > Fixes: 6be3a5a9cd91 ("backlight: adp88x0: Fix uninitialized variable use") > --- > Sorry for missing this third hunk the first time around. > > diff --git a/drivers/video/backlight/adp8860_bl.c b/drivers/video/backlight/adp8860_bl.c > index f0d4c0324580..510e559c060e 100644 > --- a/drivers/video/backlight/adp8860_bl.c > +++ b/drivers/video/backlight/adp8860_bl.c > @@ -566,11 +566,13 @@ static ssize_t adp8860_bl_ambient_light_level_show(struct device *dev, > > mutex_lock(&data->lock); > error = adp8860_read(data->client, ADP8860_PH1LEVL, ®_val); > - ret_val = reg_val; > - error |= adp8860_read(data->client, ADP8860_PH1LEVH, ®_val); > + if (!error) { > + ret_val = reg_val; > + error = adp8860_read(data->client, ADP8860_PH1LEVH, ®_val); > + } > mutex_unlock(&data->lock); > > - if (error < 0) > + if (error) > return error; > > /* Return 13-bit conversion value for the first light sensor */ > -- Greetings, Michael -- Analog Devices GmbH Wilhelm-Wagenfeld-Str. 6 80807 Muenchen Sitz der Gesellschaft: Muenchen; Registergericht: Muenchen HRB 40368; Geschaeftsfuehrer:Dr.Carsten Suckrow, Thomas Wessel, William A. Martin, Margaret Seif -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/