From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751830AbcACQ7u (ORCPT ); Sun, 3 Jan 2016 11:59:50 -0500 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:46781 "EHLO mail2-relais-roc.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750952AbcACQ7r (ORCPT ); Sun, 3 Jan 2016 11:59:47 -0500 X-IronPort-AV: E=Sophos;i="5.20,516,1444687200"; d="scan'208";a="195356400" Date: Sun, 3 Jan 2016 17:59:45 +0100 (CET) From: Julia Lawall X-X-Sender: jll@localhost6.localdomain6 To: SF Markus Elfring cc: rtc-linux@googlegroups.com, Alessandro Zummo , Alexandre Belloni , LKML , kernel-janitors@vger.kernel.org Subject: Re: [PATCH 7/8] rtc-ab-b5ze-s3: Delete an unnecessary variable in _abb5zes3_rtc_interrupt() In-Reply-To: <56895246.3080302@users.sourceforge.net> Message-ID: References: <566ABCD9.1060404@users.sourceforge.net> <5688DF2D.6090204@users.sourceforge.net> <5688E229.4010400@users.sourceforge.net> <56895246.3080302@users.sourceforge.net> User-Agent: Alpine 2.02 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 3 Jan 2016, SF Markus Elfring wrote: > >> Pass the address of the data structure element "time" directly in calls > >> of the function "rtc_update_irq" instead of an extra initialisation > >> for one local variable at the beginning. > > > > Why is it better? > > I suggest to refer to the data item "rtc_data->rtc" directly because > the variable "rtc" was read only in two if branches. > Does it make sense then to reduce the variable allocation? No. That is the job of the compiler. For a local variable whose address is never taken, the compiler can easily detect its live region, and place the initialization in an optimal way. julia