Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965124AbaLKQgt (ORCPT ); Thu, 11 Dec 2014 11:36:49 -0500 Received: from www.linutronix.de ([62.245.132.108]:58787 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933436AbaLKQgr (ORCPT ); Thu, 11 Dec 2014 11:36:47 -0500 Date: Thu, 11 Dec 2014 17:36:08 +0100 (CET) From: Thomas Gleixner To: Yinghai Lu cc: Jiang Liu , "H. Peter Anvin" , Bjorn Helgaas , "Rafael J. Wysocki" , Borislav Petkov , Randy Dunlap , Ingo Molnar , Joerg Roedel , Tony Luck , Konrad Rzeszutek Wilk , Greg Kroah-Hartman , Benjamin Herrenschmidt , Linux Kernel Mailing List , Linus Torvalds , "linux-tip-commits@vger.kernel.org" Subject: Re: [tip:x86/apic] x86, PCI, ACPI: Kill private function resource_to_addr() in arch/x86/pci/acpi.c In-Reply-To: Message-ID: References: <1414387308-27148-5-git-send-email-jiang.liu@linux.intel.com> User-Agent: Alpine 2.11 (DEB 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 10 Dec 2014, Yinghai Lu wrote: > On Wed, Dec 10, 2014 at 12:15 PM, Thomas Gleixner wrote: > >> - struct resource r = { > >> - .flags = 0 > >> - }; > >> + struct resource r; > >> > >> + memset(&r, 0, sizeof(r)); > > > > What's the point of this change? Both initialize r to 0. memset() > > generates better code, but that's irrelevant for the problem at hand. > > late there is > > info->res[info->res_num] = r; > > don't want the random pointer in r get copied. Did you actually read what I wrote? struct resource r = { .flags = 0 }; initializes r completely to 0. So how do you get a random pointer in r? Thanks, tglx -- 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/