From patchwork Mon Aug 3 17:01:52 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 6931271 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 0713BC05AC for ; Mon, 3 Aug 2015 17:02:05 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E0FF32063F for ; Mon, 3 Aug 2015 17:02:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0237720641 for ; Mon, 3 Aug 2015 17:02:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753294AbbHCRCB (ORCPT ); Mon, 3 Aug 2015 13:02:01 -0400 Received: from mail-bn1bon0090.outbound.protection.outlook.com ([157.56.111.90]:12256 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753164AbbHCRB7 (ORCPT ); Mon, 3 Aug 2015 13:01:59 -0400 Received: from BLUPR02CA056.namprd02.prod.outlook.com (10.160.23.174) by BN1PR0201MB0740.namprd02.prod.outlook.com (10.160.169.27) with Microsoft SMTP Server (TLS) id 15.1.225.19; Mon, 3 Aug 2015 17:01:55 +0000 Received: from BN1BFFO11FD036.protection.gbl (2a01:111:f400:7c10::1:177) by BLUPR02CA056.outlook.office365.com (2a01:111:e400:8ad::46) with Microsoft SMTP Server (TLS) id 15.1.225.19 via Frontend Transport; Mon, 3 Aug 2015 17:01:55 +0000 Authentication-Results: spf=pass (sender IP is 63.163.107.173) smtp.mailfrom=sandisk.com; mellanox.com; dkim=none (message not signed) header.d=none; Received-SPF: Pass (protection.outlook.com: domain of sandisk.com designates 63.163.107.173 as permitted sender) receiver=protection.outlook.com; client-ip=63.163.107.173; helo=milsmgep12.sandisk.com; Received: from milsmgep12.sandisk.com (63.163.107.173) by BN1BFFO11FD036.mail.protection.outlook.com (10.58.144.99) with Microsoft SMTP Server id 15.1.243.9 via Frontend Transport; Mon, 3 Aug 2015 17:01:52 +0000 Received: from MILHUBIP04.sdcorp.global.sandisk.com ( [172.22.12.162]) by milsmgep12.sandisk.com (Symantec Messaging Gateway) with SMTP id B5.BA.06265.08E9FB55; Mon, 3 Aug 2015 10:01:52 -0700 (PDT) Received: from milsmgip12.sandisk.com (10.177.8.100) by MILHUBIP04.sdcorp.global.sandisk.com (10.177.9.97) with Microsoft SMTP Server id 14.3.224.2; Mon, 3 Aug 2015 10:01:16 -0700 X-AuditID: ac160a69-f790f6d000001879-cc-55bf9e80d9f0 Received: from [10.60.52.33] ( [10.177.8.100]) by milsmgip12.sandisk.com (Symantec Messaging Gateway) with SMTP id FF.36.04661.08E9FB55; Mon, 3 Aug 2015 10:01:52 -0700 (PDT) To: Doug Ledford CC: Sagi Grimberg , "linux-rdma@vger.kernel.org" From: Bart Van Assche Subject: [PATCH] IB/core, cma: Make __attribute_const__ declarations sparse-friendly Message-ID: <55BF9E80.3030306@sandisk.com> Date: Mon, 3 Aug 2015 10:01:52 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrOLMWRmVeSWpSXmKPExsWyRoxnkW7DvP2hBu+OKFi8PP+B1eLZoV4W ixttD9gcmD2eTT/M5PF+31U2j8+b5AKYo7hsUlJzMstSi/TtErgyrndtZix4JFGx5mIbYwPj F5EuRk4OCQETiRkfjrFB2GISF+6tB7K5OIQETjBKXL8xnRHC2c4o0T9tKyNMx6GGDVBVmxgl ehbfBEuICKhJbHq1iB3EZhZIljiy5DYziM0mYCTx7f1MFhBbWCBM4s3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1LS76a2JtZwr3C0+CBv+v55e q8RSnJFoqMVcVJwIAKY2oyHhAQAA X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD036; 1:okLo7nwt3E6jjpD3yqtVoTTZ6r70pqcKo5Pp41DerYLQyaIYWmGl8vb/YKi7Osl6KaGiip5+qG2Fo9bB0zkRpIAHWWnpVi+lREkTNeX2b6gCssVjkeywwdrXrCVkP45DxYRhYcIShYpSRdmSTPbM0R1rn5aR3IG+kwgcRJnfD1cjUv6xl2ZS6o5bOg90NDuz2CGZ8NP+u3TSHFB1GyxfQ1OmdJl6RJUUFdldSaAdzMTApe86/YTwV4FvAnoVhjg+YcB2AWcWpLd56CMGAiU5M18DKX2mhjjgQ0v0zDw9O0YUyIZ9o1DH1PhK6Ex9mnW8qdkniQZBKVLkoBHwpegVNA== X-Forefront-Antispam-Report: CIP:63.163.107.173; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(2980300002)(438002)(189002)(199003)(189998001)(87936001)(86362001)(50986999)(54356999)(65806001)(65956001)(87266999)(65816999)(47776003)(33656002)(46102003)(64706001)(80316001)(50466002)(19580395003)(83506001)(23676002)(19580405001)(110136002)(77096005)(81156007)(4001540100001)(229853001)(5001960100002)(68736005)(69596002)(5001830100001)(106466001)(5001860100001)(97736004)(62966003)(36756003)(77156002)(4001350100001)(92566002)(59896002)(64126003); DIR:OUT; SFP:1101; SCL:1; SRVR:BN1PR0201MB0740; H:milsmgep12.sandisk.com; FPR:; SPF:Pass; PTR:ErrorRetry; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1PR0201MB0740; 2:OWqzfcgGmShztyJ9htCkBfsVvrKC5weqRy5TTxOmQizDVn2wPuNsAnWjF2A1tK1dYzJRovimCR7bawoSpysA/+OeT/Mkwwd4WOIT9WYSBfr+FXS3QR5euq03HZ3NPvy3Ywr+QWlqMVFsFFjo0rq6SdsjKM09Vpq5yNXG7om7Fic=; 3:bJgGuhev0EgYXGMdfZwm+nD/Yi5AgeKeljd5NPwK6/5soK527W4Q3/9YY80+v5xOJxWTbHV5BbCKkArDVufvwxLpxYefKEjQmTZhMhgLsxDCDnbbiVjPty+hfmCmXsSL2d2rOFTsH1r85biqqqsZhREy3KjRBvD0cRfrVVNIGL0l1NvRzbWA5D4ILk7/j1Ms2rWxy64uthtoCl9ll82SnID3zc0EIYAzcF4YKVui1EpJYh7pW3ag8JafCdifHsi0; 25:il0qMpHb6XP2qz+Z40Dq88AvNFU869RObAXdc2cnoszfQlV3USe05rY94O9WCh4fdjDnxrFce3NiqPZoMYxZjE97G2tsn9RitcCt5KNn5fXWU63gkqVu0rulKZbk0v7Ia23NkJeLwo9VDPI6SUOwCP5jGGzIErNaOXy4wcWuuqXhB8GHxbkZO5zsRGS83+0mlS9KUBdQO89NRFXIVkeF9v8qJPOiR3cIeGp48VhUvrMxlj8V3u7ryG4yq3hslQppPkGCTTk9CtfQ9DNyG22ajQ== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BN1PR0201MB0740; X-Microsoft-Exchange-Diagnostics: 1; BN1PR0201MB0740; 20:05NMdY9og56DxD+utkviGEmHvn35S9IdPIXIljXmYrU0mcXxDmDchAh/QJbXHBt+gyPOVnmOzYI9WMvuqkCHCPkrKqZozwx2MDG//ut8R3gse237uvF+MMtHAUTDggunFHrCZyQLqAU1Y0X7HGh2o/eSG62CYn+qU2uvRNE+TH4pmlRiLoGjkKqKjz9eoJGrp4NjsyaRdjIHXNrzYhd+Z+kxvy48P5g+rVaQNi2Ca+KulAwMZbmN0h2Ohl5j+fXlh/XO7MgrcKKXl51YMEKhSt8/J6k3Wpkz07guN7kcXplLguQQMrsvJB2ZnOzaRPmN1ehBHLI33W5RzEL4f6oT/2xaQRklaMbREo0iOIKtd+duVfvO03wBPlbL+1GrYLpPi5IGksjkfTMRKFMtvCPSeFhMPQgjRYmP5YuhxLW8INttPWaWgDK5zjv2zJu587hLr1vOPFQMceHB/IKZLh/K/2INI9l6cpcLTLQypZabAsWIqUYy62fWUXMUvJmPyuH6; 4:nKDh9T1V1r5fvIo3rlm7jgYkpQvYJ59KnpaOINxnMJ6X9M0Tufy9C06WRIEohSXbBmQKAk3aOrfxq5Y2ucOvY4LVHJgQMz6NB2GqJ9Rep9NcjJM7UcN0YDfbItwO33eA+1xRnU1Eo5RSYBsWs/yVfHcgUpSu0sAmy88vdd+GdoUBVhTnMoC7s4xnX0I1ea0J3Y610VJCxjMGyAZp3hL6CMPpPrLTycLEdZdRA2TlLtBDzyK+8RD/t46k3hvaUbxKceSRhW4Thh9iXjU7UyA4RqFDe4MsuclddywXZ9UQtDM= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(5005006)(3002001); SRVR:BN1PR0201MB0740; BCL:0; PCL:0; RULEID:; SRVR:BN1PR0201MB0740; X-Forefront-PRVS: 0657D528EC X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtCTjFQUjAyMDFNQjA3NDA7MjM6SzFTR0JVZjBsSUx4OHhCVUl0UFZ6dEFy?= =?utf-8?B?SE5icE55K214RVdjQ1dGMWdaWWVuV0hTakovMjk3RGliN3I4ek1BMXA4RVhF?= =?utf-8?B?UTNaU0dYMEs2SGtzNCt5MXRPQUcvcnBuVjF2a3ZVTFNRQ0xEUnliUW5BSTll?= =?utf-8?B?VHBEd00xSVlZZ3FtRVNBcU1DR0k1THNqQXRzOFRXei9vaVZYb2tvU3ZhNnNP?= =?utf-8?B?ZVdiK3lnaXU0RFcyYS9aMEpLY0lIMGpYcWxsTjJDOUZReEtSd1VOR1BrZWho?= =?utf-8?B?Z0xYYW94U2RIT3dVNkFKdWRPUGUwTVBuYzcxM0FPYlNJNUREeklrN0t3MGdx?= =?utf-8?B?RWJlLzUrOFVQeEovdUV6aGJ3U1c0R2VKUUJFdHE3b25SMW1oM0g2blBuK0c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lbGVkOUNVbHlRbmZQRGtXQmVL?= =?utf-8?B?dWlEN1lkMnQ2cEovNlBRNCsrOFdKM1lWOG9aU3NWREFsejE1ZUxaZE5rdGx1?= =?utf-8?B?M3J5ZTdhZTNITUE3WFkwc2s0bVBtR0hRdCtjOU9pZnZneWgzMG1lM004Qy94?= =?utf-8?B?aXUyaHpTNXV1SXFrYzJjTFljN2p5UFFUYXRoWmhBMGxGZEgrMHZ5S1RFeThP?= =?utf-8?B?SWR0d2NvODNyVThEM0tiOFlSWG9zQyt3SWFSTEdjdFpFYWY4a2gyU0Q5VW5J?= =?utf-8?Q?zbK?= X-Microsoft-Exchange-Diagnostics: 1; BN1PR0201MB0740; 5:H20U6r94SQcOOkAvh+EcTvhOJByXE3IlT6ken1B5WtZA0p6e37oiJg23X2OFPmn5CzP+4nGndeRxQlxa1bT+q1J2necxNZSQleDiZ2HzAByWB6cMQT543F/pJG0Wm25X/WnU+THTunyLmK5DL2BfEA==; 24:IjFX8A0yBTfRNpwX8yDacyY2boiI99BWnnmpo5uQ8ShinRrmvDkigoqUT9E4DBQnAqHLtls7OudIp0kaMU2bFVXkXz30LNHk1pdYMsbxRLE=; 20:NKfINTjVnxsGW4VvT7YrggXJKxeT91hptL4pgccv7zukzoY2UHbMthof2tuHpcJncroPhwTJ8+vELB8LGZvVL2j+6LVz0li9DVzRIOZXi4X7AHupc4NywLsdlAbHCODfPA2sILeH68uPKEufliAyyaoQ1BpNHmjSgtN5R5TIoZU= X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Aug 2015 17:01:52.9974 (UTC) X-MS-Exchange-CrossTenant-Id: fcd9ea9c-ae8c-460c-ab3c-3db42d7ac64d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=fcd9ea9c-ae8c-460c-ab3c-3db42d7ac64d; Ip=[63.163.107.173]; Helo=[milsmgep12.sandisk.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN1PR0201MB0740 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Move the __attribute_const__ declarations such that sparse understands that these apply to the function itself and not to the return type. This avoids that sparse reports error messages like the following: drivers/infiniband/core/verbs.c:73:12: error: symbol 'ib_event_msg' redeclared with different type (originally declared at include/rdma/ib_verbs.h:470) - different modifiers Fixes: 2b1b5b601230 ("IB/core, cma: Nice log-friendly string helpers") Signed-off-by: Bart Van Assche Cc: Sagi Grimberg Reviewed-by: Sagi Grimberg --- drivers/infiniband/core/cma.c | 2 +- drivers/infiniband/core/verbs.c | 4 ++-- include/rdma/ib_verbs.h | 4 ++-- include/rdma/rdma_cm.h | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c index 143ded2..a7c1788 100644 --- a/drivers/infiniband/core/cma.c +++ b/drivers/infiniband/core/cma.c @@ -84,7 +84,7 @@ static const char * const cma_events[] = { [RDMA_CM_EVENT_TIMEWAIT_EXIT] = "timewait exit", }; -const char *rdma_event_msg(enum rdma_cm_event_type event) +const char *__attribute_const__ rdma_event_msg(enum rdma_cm_event_type event) { size_t index = event; diff --git a/drivers/infiniband/core/verbs.c b/drivers/infiniband/core/verbs.c index 2e5fd89..50fe99f 100644 --- a/drivers/infiniband/core/verbs.c +++ b/drivers/infiniband/core/verbs.c @@ -70,7 +70,7 @@ static const char * const ib_events[] = { [IB_EVENT_GID_CHANGE] = "GID changed", }; -const char *ib_event_msg(enum ib_event_type event) +const char *__attribute_const__ ib_event_msg(enum ib_event_type event) { size_t index = event; @@ -104,7 +104,7 @@ static const char * const wc_statuses[] = { [IB_WC_GENERAL_ERR] = "general error", }; -const char *ib_wc_status_msg(enum ib_wc_status status) +const char *__attribute_const__ ib_wc_status_msg(enum ib_wc_status status) { size_t index = status; diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h index a2c328b..1d07ba7 100644 --- a/include/rdma/ib_verbs.h +++ b/include/rdma/ib_verbs.h @@ -467,7 +467,7 @@ enum ib_event_type { IB_EVENT_GID_CHANGE, }; -__attribute_const__ const char *ib_event_msg(enum ib_event_type event); +const char *__attribute_const__ ib_event_msg(enum ib_event_type event); struct ib_event { struct ib_device *device; @@ -718,7 +718,7 @@ enum ib_wc_status { IB_WC_GENERAL_ERR }; -__attribute_const__ const char *ib_wc_status_msg(enum ib_wc_status status); +const char *__attribute_const__ ib_wc_status_msg(enum ib_wc_status status); enum ib_wc_opcode { IB_WC_SEND, diff --git a/include/rdma/rdma_cm.h b/include/rdma/rdma_cm.h index c92522c..31afb5c 100644 --- a/include/rdma/rdma_cm.h +++ b/include/rdma/rdma_cm.h @@ -62,7 +62,7 @@ enum rdma_cm_event_type { RDMA_CM_EVENT_TIMEWAIT_EXIT }; -__attribute_const__ const char *rdma_event_msg(enum rdma_cm_event_type event); +const char *__attribute_const__ rdma_event_msg(enum rdma_cm_event_type event); enum rdma_port_space { RDMA_PS_SDP = 0x0001,