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=-3.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no 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 B9DAAC433FE for ; Sat, 12 Dec 2020 18:50:32 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 4E4872076A for ; Sat, 12 Dec 2020 18:50:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4E4872076A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=perches.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Date:To:From: Subject:Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=xOxTRcbLrSUEmSvvx4X2JUw7HgRIb//DdOQbxIjqp2E=; b=lr49LRUfGJPQAMfyO0X/eun/x 61BbL909rNrZqMJj2zR1cPogxqvFHt9SrrHbTZOj0bR4Ny4rI6FfUP4xO9QHA+I/3Y1lr7sQzOF/c mDIccEk5E/7FoA6Ix+I48CCeMgkVyKQSa+LChM5LHabo90UU7QaLKagAjq8BhOyd+of72d7u+JpWf rO8G9aVQZe5znyQu9qEVQ/ASsiQGu3XAOhOUf/O1Ohp+9wHiPFtNRaEm4meRsQ2zWC/Q11BM01hA4 UKvnH3Z8T8e2uL9/9WI0pUQVtuz2hcZ1wIHNRwEumnEDzx9Zl4JjVM1GHDccZ6vQ5btV3003LTuXK tNACtFR0g==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ko9x2-0000ti-A0; Sat, 12 Dec 2020 18:49:04 +0000 Received: from smtprelay0132.hostedemail.com ([216.40.44.132] helo=smtprelay.hostedemail.com) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1ko9wz-0000tP-F3 for linux-arm-kernel@lists.infradead.org; Sat, 12 Dec 2020 18:49:02 +0000 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay04.hostedemail.com (Postfix) with ESMTP id B983F180A7FE4; Sat, 12 Dec 2020 18:48:58 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-HE-Tag: hour92_2d166912740b X-Filterd-Recvd-Size: 2591 Received: from XPS-9350.home (unknown [47.151.137.21]) (Authenticated sender: joe@perches.com) by omf04.hostedemail.com (Postfix) with ESMTPA; Sat, 12 Dec 2020 18:48:56 +0000 (UTC) Message-ID: <03bb4d4436ca7022effbf23551ada24ff9eeb4c6.camel@perches.com> Subject: Re: mmc: atmel-mci: Reduce scope for the variable =?UTF-8?Q?=E2=80=9Cslot=E2=80=9D?= in atmci_request_end() From: Joe Perches To: Alexandre Belloni Date: Sat, 12 Dec 2020 10:48:55 -0800 In-Reply-To: <20201212131727.GL1781038@piout.net> References: <466b4c6d-032f-fbcc-58ac-75f6f39d734f@web.de> <20201210151035.GC1578121@piout.net> <20201210170723.GD1578121@piout.net> <2667790c-fad2-aaa9-36e8-6be66949ac8d@web.de> <20201210182150.GE1578121@piout.net> <4c0d8efe-de25-f168-8b8d-b7f1ede6c6b1@web.de> <20201211080301.GC1781038@piout.net> <031a64e4261e1543a136d737436abefd63dbaee1.camel@perches.com> <20201212131727.GL1781038@piout.net> User-Agent: Evolution 3.38.1-1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201212_134901_565794_913EB495 X-CRM114-Status: GOOD ( 11.73 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ulf Hansson , kernel-janitors@vger.kernel.org, linux-mmc@vger.kernel.org, LKML , Ludovic Desroches , Markus Elfring , Dan Carpenter , Colin Ian King , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Sat, 2020-12-12 at 14:17 +0100, Alexandre Belloni wrote: > On 12/12/2020 01:16:39-0800, Joe Perches wrote: > > In this case Alexandre it seems true, but in the generic case > > it may be false. It may depend on stack size and location. > > > > For instance, with large structs declared either at the top > > of a function or in separate branches within the function: > > I think you realize your example is way more complicated than > initializing basic type variable to 0 or NULL which has probably been > optimized forever. Maybe. Markus does a lot of what most (or perhaps some) consider thoughtless. A generic point might be maximizing the local scope of declarations. Maximizing the local scope can make reading easier as the type of an automatic used for a temporary purpose can be found closer to the code that uses it. This is especially true for long line-count functions. IMO: it's a reasonable goal though in this instance perhaps unnecessary. cheers, Joe _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel