Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp3791275imm; Mon, 2 Jul 2018 05:46:10 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeCr721LmrFjqVc1e9AHFodMQGuBAZuwgNrpDznkzwWcgLJXih6wW6qJbnSTdWpZ94pMBTr X-Received: by 2002:a65:4b04:: with SMTP id r4-v6mr16055775pgq.175.1530535570190; Mon, 02 Jul 2018 05:46:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530535570; cv=none; d=google.com; s=arc-20160816; b=eXTDMI/qLWP7oXRRaRytqmgcV5OhnTpkzy336tCNHzBAFcC+oZIqeb812V8dAf039b JgMmolTJUC81GBdW0hp8gCBGZdbZmXnA2suA/v8HojO1FJUWLeFv+pQtpcyzFG4rryns JFJUpZgpIUQyFhc/NJaK5VFTmh0y4ENtzsEPIVXOYTdk/DN057DIiUWEtcFUQC5eR5Pl Z0G1eNg7xdv8oIs5zYrnmZ1Cxa4WXVIHv2zRfGyNONXy3Ook4WVCS0O7/MTBEKpNAobY EGwxt0lVyss+xewy9S9IPQK8r0gM+f7mhv4nGOBfA63pbS41zayiCC1xO+lEN80LhdKw VqhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:message-id :in-reply-to:subject:cc:to:from:date:arc-authentication-results; bh=oHM2Pt0L5g+sSaATyiFXAPb8janrlRIpKWtzWFYTcV0=; b=Uc+0BY5Dlkx/qwzqsv2octFdYkbvtj68dn1PfMeSFcQAENdHeCTRx8+WkIW+2IKQzI B6gy1U7KA5UG5QcStyU40yK1egf10ZSF8NvmFppA7vESJMza19NYg0AJvC1bUC9DAM3n 02DmbR+zi6kuwenjEXDofXL91psU3wD7rDt6ZmF3VXcHDGeACH8hvM/wXJ2Y0s6EokPS CHlg6olubKzdBt2gnwNeYI+gUKZu0A6qHvaRjjweAWcFCKpvyl0yt8VmYqLPqVzoMu5f wem4DpZrxxGiGCqHcC1lNCI1TwftqQ9ipODVOnAm7n/fosy5vxPJrhqqOKqG8YjHxsi4 1Htg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p12-v6si17640724pll.142.2018.07.02.05.45.54; Mon, 02 Jul 2018 05:46:10 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964887AbeGBMGZ (ORCPT + 99 others); Mon, 2 Jul 2018 08:06:25 -0400 Received: from kvm5.telegraphics.com.au ([98.124.60.144]:52436 "EHLO kvm5.telegraphics.com.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753987AbeGBMGW (ORCPT ); Mon, 2 Jul 2018 08:06:22 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by kvm5.telegraphics.com.au (Postfix) with ESMTP id E9CF829553; Mon, 2 Jul 2018 08:06:19 -0400 (EDT) Date: Mon, 2 Jul 2018 22:07:29 +1000 (AEST) From: Finn Thain To: Mathieu Malaterre cc: Benjamin Herrenschmidt , Michael Schmitz , linux-m68k@lists.linux-m68k.org, linuxppc-dev , LKML Subject: Re: [PATCH v4 01/11] macintosh/via-pmu: Fix section mismatch warning In-Reply-To: Message-ID: References: <720e9899186bed184fb9b5cce070e2dc519f9665.1530519301.git.fthain@telegraphics.com.au> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2 Jul 2018, Mathieu Malaterre wrote: > On Mon, Jul 2, 2018 at 10:25 AM Finn Thain > wrote: > > > > The pmu_init() function has the __init qualifier, but the ops struct > > that holds a pointer to it does not. This causes a build warning. The > > driver works fine because the pointer is only dereferenced early. > > > > The function is so small that there's negligible benefit from using > > the __init qualifier. Remove it to fix the warning, consistent with > > the other ADB drivers. > > Would you mind copy/pasting the warning you are seeing. > > Make sure you have: > > 58935176ad17 powerpc/via-pmu: Fix section mismatch warning > > Thanks > It's true, the section mismatch warning from 'make' has disappeared since I wrote this patch, but that doesn't mean it is wrong. Before this patch: $ powerpc-linux-gnu-objdump -xda vmlinux |egrep -w "via_pmu_driver|pmu_init" c0711c84 l F .init.text 0000001c pmu_init c05eb408 g O .rodata 00000028 via_pmu_driver c0711c84 : $ After: $ powerpc-linux-gnu-objdump -xda vmlinux |egrep -w "via_pmu_driver|pmu_init" c038e42c l F .text 0000001c pmu_init c05e1e58 g O .rodata 00000028 via_pmu_driver c038e42c : $ I gather that commit 58935176ad17 ("powerpc/via-pmu: Fix section mismatch warning") has moved via_pmu_driver from .data to .rodata, but I'm afraid I don't see the point of that change. The commit log entry doesn't explain it either. If .rodata is not discarded then the dangling pointer remains, right? --