From patchwork Tue Apr 12 15:26:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Horman X-Patchwork-Id: 12810887 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9234CC433F5 for ; Tue, 12 Apr 2022 15:26:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344640AbiDLP2d (ORCPT ); Tue, 12 Apr 2022 11:28:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56460 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230501AbiDLP2c (ORCPT ); Tue, 12 Apr 2022 11:28:32 -0400 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2097.outbound.protection.outlook.com [40.107.236.97]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 41B7C1CFCF for ; Tue, 12 Apr 2022 08:26:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nBYSBRZNFGBFZZbxXpN+UTYf8caLNpVA1XiXk7ncv3TLEQZODbp5BlTAWjwSZ+CS/O6IxNaqXaaJ3o+/0fhhkI7KQcrancpCxth9sbY+WJmQ06fY01ersxfB2W3nu1NxdMchXkzjDNJBF42XvHo1HhckETgx1QKXUaZB+vjGQpQZUVl7gz0j0TN0KnrJ9DXU7bi8wjQE/ISqEB7mVNEa5lfsp2rj/ctx5B9UqKoWtJVoxA+rzWu4QXXmOtWZ61rybu4WqNwiVbK+70uuAHpkR9/Ag89j3dTkyrStJrRme0OJE6B4kq8yAo8HY05p+qDCCXvkx0Ka8Ic0NWrZAfjL3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=kFWAFki9nfHwTWSqjTTggSMIRCKhnNefIFJUjr+/cdI=; b=GQE0vLIgVIu3Xw8qZmHausDO3ci79WbGDTZT0vDyMUKT0wyVmOOe5d4Zn2Bh0zUy4TIlYjqY5XYGa12Ja/L4EL2Ob3W8Yon8Vfs7/GEZL7Qxl3mMsz8r268t2MklrjV/TppAjc7GcPxYqu/HLHBONiVb2Uf/iHuzbqt7UnW+ES+hi+ankQJCATyU5Vw4sY5f4IIeWPArLN8/JEZa8Q3l5EojjlVdb7AZpXIyWAqTUKu7dqIX38IqP//9T9GH4j3cB5PdPQHd+vny5FdnexUQ5/qyzbeJDrvf0zIjLdms/cTf+QfnpdlSr/D1fJnXB18sXBzk5PBet2bhpjmFEV626Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=corigine.com; dmarc=pass action=none header.from=corigine.com; dkim=pass header.d=corigine.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=corigine.onmicrosoft.com; s=selector2-corigine-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=kFWAFki9nfHwTWSqjTTggSMIRCKhnNefIFJUjr+/cdI=; b=MFYo6HpgMiqKyhiKW05AdPEaa8CUiZxEVpvaPvrYdaueB+HEfEyqpUdEczvDxZAIFYIVyaQVh1cd6My1xgzhAdjAZ1AiQJtaA0APzmOPcoRWvP+Bmo+t2+KaFgl/IcIXcgehNcHwy7VibpsGkjycf+71PgzqrQ6IgvhJ1oQYFK4= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=corigine.com; Received: from PH0PR13MB4842.namprd13.prod.outlook.com (2603:10b6:510:78::6) by SN4PR13MB5663.namprd13.prod.outlook.com (2603:10b6:806:21e::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5164.17; Tue, 12 Apr 2022 15:26:12 +0000 Received: from PH0PR13MB4842.namprd13.prod.outlook.com ([fe80::8c8a:96b7:33a6:4da5]) by PH0PR13MB4842.namprd13.prod.outlook.com ([fe80::8c8a:96b7:33a6:4da5%7]) with mapi id 15.20.5164.020; Tue, 12 Apr 2022 15:26:12 +0000 From: Simon Horman To: David Miller , Jakub Kicinski Cc: netdev@vger.kernel.org, oss-drivers@corigine.com, Dylan Muller , Simon Horman Subject: [PATCH net-next] nfp: update nfp_X logging definitions Date: Tue, 12 Apr 2022 17:26:00 +0200 Message-Id: <20220412152600.190317-1-simon.horman@corigine.com> X-Mailer: git-send-email 2.30.2 X-ClientProxiedBy: AM4PR07CA0019.eurprd07.prod.outlook.com (2603:10a6:205:1::32) To PH0PR13MB4842.namprd13.prod.outlook.com (2603:10b6:510:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0b147f0e-414a-4f0e-6bd8-08da1c98c706 X-MS-TrafficTypeDiagnostic: SN4PR13MB5663:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: CU9ZGNRdBPYqSkCHJuBvKFR6RNb+ivqsMVJEBwVyjzSr2hVl3VXmAz/KJU1P4h+UbH4o2TEEo2I1znYftbw0tFyU4ws2I8YpcQWgx2+4/3cd/ry0bUnM6oN0b/vv9htGWsoymc6hyvl/OVQVrt5K/y12NUT5D9e+qeW6eodw7H+J7VnbFYhSROeYaOc8Qi0w4DZPgGbsGHBm4hbQoC+dga30B+MCBBrbJWTlEkMdOAG1tphte6pG+fA4txf4XyHSYDpV9NWF9dvEZ2fmSoYLCWJH9jqvoKNE2wG0YGfR18XGbnLLtO3g8BeoKey+uKo2Te2aYlDiWBlVWobQhl7RpAKa+c5jNbXJg6N/tzaPchQE1riZZ4jtmge9EuU2Gv+DchT/NsGQ+GL1S1JjPgVg9futnlW0BB4bNZUrE8c8EKpJNtpENoPdPSxWwv/Mbv4fkkpqH94r7mOtSiMa8sO+o2jknVqTBW6xYSk6G5cDfm/aTfjNJMXjgGssay0OGGlv48vHlWwpKaY2S5R4fRq7vA9sZBO557E3qYBRdWd6DwxH3zsZDHSHRiFd1pAK80ZCFGZe0vGw8qnb+Q5MQeEWE/uFQfWRWHuuR71YHoDTB7B+HXD3W1iOrVVtKWkj6rOOucjYvSBhfIW3dOtkyAlh2GazgQqzZchKJ4cDKR8rQ9pQD2Hu1QcyZFsDyOmIl2T6EuGF8rFf2SAE2SioJU0pZQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR13MB4842.namprd13.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(396003)(366004)(346002)(376002)(39830400003)(136003)(83380400001)(86362001)(508600001)(2906002)(5660300002)(54906003)(1076003)(36756003)(6486002)(15650500001)(38100700002)(8936002)(6512007)(52116002)(6506007)(316002)(110136005)(66556008)(66946007)(66476007)(186003)(44832011)(2616005)(6666004)(8676002)(107886003)(4326008);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 2 X-MS-Exchange-AntiSpam-MessageData-0: W2QFMWh30nQ124G7QpFfBF3JQj2ZRugGsjdnV++OU7k+7U6bQ8Y12ukA4mIMsLGnfcsS3mxKUgcN4CJ+HFrvK3eLJlc1qjuw9g5GqTa/3UdMYx2u1I7yU2PXce5D1y42u96kxzYeVpUImJRk31Fgb+qDAOs+yfk6JXa+gDoVAI2oTpFo/1WiSHKY23SUNYGsOcQxikNnREEZ5Yj5HoGN5MFV076pxfWJDwkCz6D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uSb/lCfoiFcFqVfPD+MkPZ/4IAqIq7hdosg8n9VnVsEWwEvwn++a2OEvUeGXTEnQzZ2pUUGwm9jLmgfMSg6NyEYEqk2lizdBtXrifBVY2jU0uPJ3VbYRdypG4FhZFQ1FMgLoo+D/ju00QVhF9tf9uEFdGMJyQedHWifBRfba7sVSeyDyKZATpGt10lhjwhJ2mbfhBHjQReTrjzM9Df5Bq1GymADJzgB/OekmNDaszpxp0yjJhLbyxJ3/YEwqikMQSYhLILTFBvHzzc0eT3XKhD+hPOktHPRU8vu8FCvEbNfLNOk9ChjJxKIrhi7Ed8XatNmlJBQMGd1lJqUhDia0kY8MKMFf0pLKDsEdLZO2XgA+YXC5VED9cPeKyqtMc8XV7AEUP5fyYTEDo7Wg31zJb/G8wPDiMB+cbUS/QK5UuH+ZkHbJZu5Ndl7FgK9k4j0gMvpnAGPgM6Ka9Tj/WKZ7tck6c7jBavmKgTXyxv6byN6vWD5 X-MS-Exchange-AntiSpam-MessageData-1: FqzlFbS7arbHyTH4Blmuy3VOtpHDYoXMNlQ= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0b147f0e-414a-4f0e-6bd8-08da1c98c706 X-MS-Exchange-CrossTenant-AuthSource: PH0PR13MB4842.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Apr 2022 15:26:12.7289 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: fe128f2c-073b-4c20-818e-7246a585940c X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: UQleu+cT1FmMvDSOM28OM6HdsXdTEU6dB8ND4gyziDmUQuKXeZnROYqoPU7N+nBec87jPntgVJgh7rc6CLtQPKxmndWmhcGkvXIBr3nBI7c= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN4PR13MB5663 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Dylan Muller Previously it was not possible to determine which code path was responsible for generating a certain message after a call to the nfp_X messaging definitions for cases of duplicate strings. We therefore modify nfp_err, nfp_warn, nfp_info, nfp_dbg and nfp_printk to print the corresponding file and line number where the nfp_X definition is used. Signed-off-by: Dylan Muller Signed-off-by: Simon Horman --- .../ethernet/netronome/nfp/nfpcore/nfp_cpp.h | 26 ++++++++++++++----- 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_cpp.h b/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_cpp.h index 3d379e937184..ddb34bfb9bef 100644 --- a/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_cpp.h +++ b/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_cpp.h @@ -13,22 +13,36 @@ #include #include #include +#include #ifndef NFP_SUBSYS #define NFP_SUBSYS "nfp" #endif -#define nfp_err(cpp, fmt, args...) \ +#define string_format(x) __FILE__ ":" __stringify(__LINE__) ": " x + +#define __nfp_err(cpp, fmt, args...) \ dev_err(nfp_cpp_device(cpp)->parent, NFP_SUBSYS ": " fmt, ## args) -#define nfp_warn(cpp, fmt, args...) \ +#define __nfp_warn(cpp, fmt, args...) \ dev_warn(nfp_cpp_device(cpp)->parent, NFP_SUBSYS ": " fmt, ## args) -#define nfp_info(cpp, fmt, args...) \ +#define __nfp_info(cpp, fmt, args...) \ dev_info(nfp_cpp_device(cpp)->parent, NFP_SUBSYS ": " fmt, ## args) -#define nfp_dbg(cpp, fmt, args...) \ +#define __nfp_dbg(cpp, fmt, args...) \ dev_dbg(nfp_cpp_device(cpp)->parent, NFP_SUBSYS ": " fmt, ## args) +#define __nfp_printk(level, cpp, fmt, args...) \ + dev_printk(level, nfp_cpp_device(cpp)->parent, \ + NFP_SUBSYS ": " fmt, ## args) + +#define nfp_err(cpp, fmt, args...) \ + __nfp_err(cpp, string_format(fmt), ## args) +#define nfp_warn(cpp, fmt, args...) \ + __nfp_warn(cpp, string_format(fmt), ## args) +#define nfp_info(cpp, fmt, args...) \ + __nfp_info(cpp, string_format(fmt), ## args) +#define nfp_dbg(cpp, fmt, args...) \ + __nfp_dbg(cpp, string_format(fmt), ## args) #define nfp_printk(level, cpp, fmt, args...) \ - dev_printk(level, nfp_cpp_device(cpp)->parent, \ - NFP_SUBSYS ": " fmt, ## args) + __nfp_printk(level, cpp, string_format(fmt), ## args) #define PCI_64BIT_BAR_COUNT 3