Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp5179677ybi; Tue, 28 May 2019 08:48:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqzIUykyAr5hQrNpVNm21jEZ07qO3oODu134jXxZrm/q1uq3Gu+KFtxStlXcE5WY3SFwMAGS X-Received: by 2002:a17:902:27a8:: with SMTP id d37mr27297090plb.150.1559058510680; Tue, 28 May 2019 08:48:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559058510; cv=none; d=google.com; s=arc-20160816; b=szT3rZc/I36SRZIulD52dCap/3Qc8CdDQWhE/xgknO9XhsvdYjuopKGP1Ld4O8gCWZ tvqu8tLbHgWFtMY20YAQuucbQJmerRQcPUEPRPoOSVLt6JHRyJc6gRnr+cqpSICw9/2r 6g2ccsZNjM1Kh03GFPuYUClvO0IujOmesrVpCR6U0NAXCDjGKXArqtOyXMvlKQtxO0n8 O8xdXDib4qg5BnobPHf3eCeWMCg3lZAQaqx9bNtB21O3vp8Wze4BZ5jzP0zCAFxbDJHg fsdgXf2U+lctTqsIY/N3QlzllTyEXSA44MDv6pc/Px7pj5Grtetbig9Q2rKrGbAvTDe/ fbjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-language:accept-language:message-id:date:thread-index :thread-topic:subject:to:from:dkim-signature; bh=qbiz4Czne7iJ7Mzu+5mtJcKxG5nvXVf2cqYt6HZzeDs=; b=Uu4h0LqE4/n/gFQOGihJXuuQjcKcn6m9tlGXyjCC90x5fDyfhKTePG5nrKScJrFwdr S8DZjeUNRUAvr/RD38DClYPwhKNskXgAgI5kUTyGQmppya+AD33TYwD6agwVBBCpZ7Zo p3DG5u5W0LPlxqvLW7wFfpln2R5i3y68Qtu2EImfEDetDfv1iW+cvTzb2zYFM1RFNCXg 2KddknYcrgMG7JdQ/ck9Fr6s4XEjL8i56tj3i9XlzJjk1X166e6qJqe74zlsUlWVD+Ok +KCmEp12lG3piOcMjprzKgRQIdK/2fgNdW+FWJL2hAFn5pByWl+PS60QyoINXxho36RF yHRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@insidesecure.onmicrosoft.com header.s=selector1-insidesecure-onmicrosoft-com header.b=r4UUAwYy; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-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 i2si10155224pgl.282.2019.05.28.08.48.09; Tue, 28 May 2019 08:48:30 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@insidesecure.onmicrosoft.com header.s=selector1-insidesecure-onmicrosoft-com header.b=r4UUAwYy; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726683AbfE1PrO (ORCPT + 99 others); Tue, 28 May 2019 11:47:14 -0400 Received: from mail-eopbgr50105.outbound.protection.outlook.com ([40.107.5.105]:52100 "EHLO EUR03-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726243AbfE1PrO (ORCPT ); Tue, 28 May 2019 11:47:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=insidesecure.onmicrosoft.com; s=selector1-insidesecure-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=qbiz4Czne7iJ7Mzu+5mtJcKxG5nvXVf2cqYt6HZzeDs=; b=r4UUAwYyIWhzOvw1uJFo8jNfWM4egeh+YOZPxGJLQ2ro/CDMDi1GWaKxpWExtciperKIdkQ8iKzJbo5re3gjpP8Vhpwio7e8HaHA6LILUrE7nENrfl7yZuYoSbVCN/gFz1Y7/OW4ROLAlMuakFB/iXHHSxzv/d1Mc7GjtI9HcKA= Received: from AM6PR09MB3523.eurprd09.prod.outlook.com (10.255.99.206) by AM6PR09MB3009.eurprd09.prod.outlook.com (10.255.96.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1922.21; Tue, 28 May 2019 15:47:11 +0000 Received: from AM6PR09MB3523.eurprd09.prod.outlook.com ([fe80::8c11:e692:3a44:a3a9]) by AM6PR09MB3523.eurprd09.prod.outlook.com ([fe80::8c11:e692:3a44:a3a9%6]) with mapi id 15.20.1922.021; Tue, 28 May 2019 15:47:11 +0000 From: Pascal Van Leeuwen To: "linux-crypto@vger.kernel.org" Subject: Conding style question regarding configuration Thread-Topic: Conding style question regarding configuration Thread-Index: AdUVadXkEfSYWnL2TvyyCw6EdJwBbw== Date: Tue, 28 May 2019 15:47:10 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=pvanleeuwen@insidesecure.com; x-originating-ip: [188.204.2.113] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 9bb9a465-a36c-4fe2-3c44-08d6e383bf69 x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(2017052603328)(7193020);SRVR:AM6PR09MB3009; x-ms-traffictypediagnostic: AM6PR09MB3009: x-ms-exchange-purlcount: 1 x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:7219; x-forefront-prvs: 00514A2FE6 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(376002)(366004)(39850400004)(346002)(396003)(136003)(189003)(199004)(26005)(99286004)(66066001)(186003)(8676002)(53936002)(86362001)(6916009)(102836004)(2906002)(8936002)(7696005)(316002)(6506007)(81156014)(5660300002)(9686003)(81166006)(52536014)(25786009)(76116006)(66556008)(64756008)(66946007)(66476007)(66446008)(73956011)(2501003)(6116002)(5640700003)(55016002)(74316002)(6436002)(7736002)(71190400001)(305945005)(33656002)(71200400001)(14454004)(486006)(476003)(14444005)(256004)(2351001)(478600001)(15974865002)(68736007)(3846002)(21314003)(18886075002);DIR:OUT;SFP:1102;SCL:1;SRVR:AM6PR09MB3009;H:AM6PR09MB3523.eurprd09.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: insidesecure.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: AqMZa5+0dXc+ppQ30sZpNJzDwPx7t2Sb/b0nu6G2yawIpZ1SDFwpmgReeJriapf+fVKipUdTxeHRLYn9s1TGoO9a10ZzSzP/ryq9scE7oZhVOC5FayruUzjL5rz9uPQ/2EVaohYx/hqgitD0jYPz2RfubfdTCoAPkZ3yZ/REKuzebV3Y5mfjhm1MHgkOWGNsWlxK4OGuxOm3YEHg0jRU8NfJZfVaTb420BWH8myfWBotIoKjQmkSOFMNcCIbt0+v5Vs1mIcwu/3K8mwmbFqqmm3AhoeggXtSq+LQISoIQf9Jsi83C2xYnC64t/oOKQH5YXrgKgtklhxOiXQScTduYerJWmLwwJX4v0i43Yt94P/X/qhKKu6fJpRAaxEYgQld9D13sMLIOCZQmRXfBUjFOF+eqbc0PQ00SRwdJwDEW8U= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: insidesecure.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9bb9a465-a36c-4fe2-3c44-08d6e383bf69 X-MS-Exchange-CrossTenant-originalarrivaltime: 28 May 2019 15:47:10.9730 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3c07df58-7760-4e85-afd5-84803eac70ce X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: pvanleeuwen@insidesecure.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR09MB3009 Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Hi, Quick question regarding how to configure out code depending on a CONFIG_xx= x=20 switch. As far as I understood so far, the proper way to do this is not by doing an #ifdef but by using a regular if with IS_ENABLED like so: if (IS_ENABLED(CONFIG_PCI)) { }=20 Such that the compiler can still check the code even if the switch is=20 disabled. Now that all works fine and dandy for statements within a function, but how do you configure out, say, global variable definitions referencing types that are tied to this configuration switch? Or should I just leave them in, depending on the compiler to optimize them away? Obviously the code depends on those variables again, so if it's not done consistently the compiler will complain somehow if the switch is not=20 defined ... Also, with if (IS_ENABLED()) I cannot remove my function prototypes, just the function body. Is that really how it's supposed to be done? Regards, Pascal van Leeuwen Silicon IP Architect, Multi-Protocol Engines @ Inside Secure www.insidesecure.com