From patchwork Wed Nov 1 20:06:41 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Lengfeld X-Patchwork-Id: 833114 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-i2c-owner@vger.kernel.org; receiver=) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3yS0bl1PhKz9t2M for ; Thu, 2 Nov 2017 07:45:39 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755224AbdKAUph (ORCPT ); Wed, 1 Nov 2017 16:45:37 -0400 Received: from stcim.de ([78.46.90.227]:58360 "EHLO stcim.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755173AbdKAUph (ORCPT ); Wed, 1 Nov 2017 16:45:37 -0400 X-Greylist: delayed 2330 seconds by postgrey-1.27 at vger.kernel.org; Wed, 01 Nov 2017 16:45:37 EDT Received: from xdsl-81-173-181-95.netcologne.de ([81.173.181.95] helo=localhost.localdomain) by stcim with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_CBC_SHA256:128) (Exim 4.89) (envelope-from ) id 1e9zHg-0001Hz-96; Wed, 01 Nov 2017 21:06:44 +0100 From: Stefan Lengfeld To: linux-i2c@vger.kernel.org, wsa@the-dreams.de Subject: [PATCH] i2c: use macro IS_ENABLED in header i2c.h Date: Wed, 1 Nov 2017 21:06:41 +0100 Message-Id: <20171101200641.11323-1-contact@stefanchrist.eu> X-Mailer: git-send-email 2.13.5 Sender: linux-i2c-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org From: Stefan Lengfeld Using the macro IS_ENABLED to check the option CONFIG_I2C=(y|m) makes the code nicer. No functional change. Signed-off-by: Stefan Lengfeld --- include/linux/i2c.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/linux/i2c.h b/include/linux/i2c.h index d501d3956f13..9245a269d160 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h @@ -55,7 +55,7 @@ typedef int (*i2c_slave_cb_t)(struct i2c_client *, enum i2c_slave_event, u8 *); struct module; struct property_entry; -#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) +#if IS_ENABLED(CONFIG_I2C) /* * The master routines are the ones normally used to transmit data to devices * on a bus (or read from them). Apart from two basic transfer functions to @@ -352,7 +352,7 @@ struct i2c_board_info { .type = dev_type, .addr = (dev_addr) -#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) +#if IS_ENABLED(CONFIG_I2C) /* Add-on boards should register/unregister their devices; e.g. a board * with integrated I2C, a config eeprom, sensors, and a codec that's * used in conjunction with the primary hardware. @@ -704,7 +704,7 @@ i2c_unlock_adapter(struct i2c_adapter *adapter) /* administration... */ -#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) +#if IS_ENABLED(CONFIG_I2C) extern int i2c_add_adapter(struct i2c_adapter *); extern void i2c_del_adapter(struct i2c_adapter *); extern int i2c_add_numbered_adapter(struct i2c_adapter *);