From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932402AbbCLQkl (ORCPT ); Thu, 12 Mar 2015 12:40:41 -0400 Received: from mail-bl2on0112.outbound.protection.outlook.com ([65.55.169.112]:53184 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753493AbbCLQkg (ORCPT ); Thu, 12 Mar 2015 12:40:36 -0400 Message-ID: <1426178426.30327.117.camel@freescale.com> Subject: Re: [PATCH 18/22] usb: gadget: serial: %pF is only for function pointers From: Scott Wood To: Fabio Estevam CC: , linux-kernel , "USB list" , Felipe Balbi Date: Thu, 12 Mar 2015 11:40:26 -0500 In-Reply-To: References: <1426130037-17956-1-git-send-email-scottwood@freescale.com> <1426130037-17956-18-git-send-email-scottwood@freescale.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.12.10-0ubuntu1~14.10.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Originating-IP: [2601:2:5800:3f7:12bf:48ff:fe84:c9a0] X-ClientProxiedBy: BN3PR09CA0014.namprd09.prod.outlook.com (25.160.111.152) To BN1PR0301MB0722.namprd03.prod.outlook.com (25.160.78.141) Authentication-Results: gmail.com; dkim=none (message not signed) header.d=none; X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BN1PR0301MB0722; X-Forefront-Antispam-Report: BMV:1;SFV:NSPM;SFS:(10019020)(6009001)(377424004)(377454003)(24454002)(51704005)(62966003)(77156002)(50986999)(76176999)(46102003)(40100003)(2950100001)(36756003)(42186005)(122386002)(110136001)(47776003)(33646002)(50226001)(103116003)(50466002)(5820100001)(23676002)(19580405001)(19580395003)(86362001)(1411001)(87976001)(92566002);DIR:OUT;SFP:1102;SCL:1;SRVR:BN1PR0301MB0722;H:[IPv6:2601:2:5800:3f7:12bf:48ff:fe84:c9a0];FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(5002009)(5005006);SRVR:BN1PR0301MB0722;BCL:0;PCL:0;RULEID:;SRVR:BN1PR0301MB0722; X-Forefront-PRVS: 05134F8B4F X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Mar 2015 16:40:32.5388 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN1PR0301MB0722 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2015-03-12 at 12:51 -0300, Fabio Estevam wrote: > On Thu, Mar 12, 2015 at 12:13 AM, Scott Wood wrote: > > Use %pS for actual addresses, otherwise you'll get bad output > > on arches like ppc64 where %pF expects a function descriptor. > > From Documentation/printk-formats.txt: > > "On ia64, ppc64 and parisc64 architectures function pointers are > actually function descriptors which must first be resolved. The 'F' and > 'f' specifiers perform this resolution and then provide the same > functionality as the 'S' and 's' specifiers." > > ,so current code should work fine on ppc64, right? No. __builtin_return_address() returns a pointer to an instruction, not a function pointer descriptor. If you use %pF on the former, it'll print instruction opcodes as if they were the address. -Scott