From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.kernel.org ([198.145.29.99]:33912 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725760AbeKFJId (ORCPT ); Tue, 6 Nov 2018 04:08:33 -0500 Date: Mon, 5 Nov 2018 18:46:02 -0500 From: Sasha Levin To: Loic Cc: stable@vger.kernel.org, Julia.Lawall@lip6.fr, keescook@chromium.org, lee.jones@linaro.org Subject: Re: [PATCH] mfd: max8925-i2c: Drop unnecessary static Message-ID: <20181105234602.GU194472@sasha-vm> References: <20181020200741.9a5fe729f49b847e729a9575@opensec.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20181020200741.9a5fe729f49b847e729a9575@opensec.fr> Sender: stable-owner@vger.kernel.org List-ID: On Sat, Oct 20, 2018 at 08:07:41PM +0200, Loic wrote: >Hello, > >Please picked up this patch for linux 4.4 and 4.9. >Compiled/tested without problem. > >[ Upstream commit 0953075112d7626474b0bb88690f5f1ab93ec803 ] > >From: Julia Lawall >Date: Thu, 4 May 2017 22:10:54 +0200 >Subject: [PATCH] mfd: max8925-i2c: Drop unnecessary static > >Drop static on a local variable, when the variable is initialized before >any use, on every possible execution path through the function. The static >has no benefit, and dropping it reduces the code size. > >The semantic patch that fixes this problem is as follows: >(http://coccinelle.lip6.fr/) > >// >@bad exists@ >position p; >identifier x; >type T; >@@ > >static T x@p; >... >x = <+...x...+> > >@@ >identifier x; >expression e; >type T; >position p != bad.p; >@@ > >-static > T x@p; > ... when != x > when strict >?x = e; >// > >The change in code size is indicates by the following output from the size >command. > >before: > text data bss dec hex filename > 2579 240 16 2835 b13 drivers/mfd/max8925-i2c.o > >after: > text data bss dec hex filename > 2531 240 8 2779 adb drivers/mfd/max8925-i2c.o > >Signed-off-by: Julia Lawall >Acked-by: Kees Cook >Signed-off-by: Lee Jones This doesn't really fix anything, not even a harmless warning, so I'd rather leave it out. -- Thanks, Sasha