From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 14993C433EF for ; Mon, 4 Jul 2022 10:21:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:In-Reply-To:References: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=29fV8YMDKLuqpQln0QnD6J9BtmJ76AnEuQtMDfi2nn8=; b=Nml/rUgbLPbqrC n6TMb8AFujWww3/r3xm0ymF5iVdlkn0IMYYZxunDakU8rZkmnaRP8zXHHkA29oYjvGP5gwBM1OkDz DlgvtrGK6ZK4DUeYDeD8okdpHl9N/1kBqig3oeCJx3yiaQyP/5GVooAdB3BHuHRQOY8L+D3LZTcui GQ+1Vfn+T5UWRpJFdMyor8u9CkSozhh5gR5oOQmtA7P23W22Hl2gBDRv7NpSHFsw8hma8uPnOUuGt jWp34iX4+vZp1oMCu1FuwfNYVakfy6hbk0D1YR5H7ASD+KgWSq75amcJCMwKKaJFoU3ViCTUOGIvn xijgspHot74ynXMvT8ow==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o8JC7-006uZ7-Ag; Mon, 04 Jul 2022 10:20:43 +0000 Received: from eu-smtp-delivery-151.mimecast.com ([185.58.85.151]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o8J7V-006rIq-K0 for linux-arm-kernel@lists.infradead.org; Mon, 04 Jul 2022 10:15:59 +0000 Received: from AcuMS.aculab.com (156.67.243.121 [156.67.243.121]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id uk-mta-214-MQlTZlhANB2wfXkNFnzPHQ-1; Mon, 04 Jul 2022 11:15:50 +0100 X-MC-Unique: MQlTZlhANB2wfXkNFnzPHQ-1 Received: from AcuMS.Aculab.com (fd9f:af1c:a25b:0:994c:f5c2:35d6:9b65) by AcuMS.aculab.com (fd9f:af1c:a25b:0:994c:f5c2:35d6:9b65) with Microsoft SMTP Server (TLS) id 15.0.1497.36; Mon, 4 Jul 2022 11:15:48 +0100 Received: from AcuMS.Aculab.com ([fe80::994c:f5c2:35d6:9b65]) by AcuMS.aculab.com ([fe80::994c:f5c2:35d6:9b65%12]) with mapi id 15.00.1497.036; Mon, 4 Jul 2022 11:15:48 +0100 From: David Laight To: 'Andy Shevchenko' , Wolfram Sang , Michael Walle , Krzysztof Kozlowski , Sam Protsenko , Lucas De Marchi , "linux-i2c@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-samsung-soc@vger.kernel.org" , "linux-renesas-soc@vger.kernel.org" Subject: RE: [PATCH v1 2/2] i2c: Introduce i2c_str_read_write() and make use of it Thread-Topic: [PATCH v1 2/2] i2c: Introduce i2c_str_read_write() and make use of it Thread-Index: AQHYjhwAwyV0nbqJdEeAmmpcjNypRK1uAQFQ Date: Mon, 4 Jul 2022 10:15:48 +0000 Message-ID: References: <20220702135925.73406-1-andriy.shevchenko@linux.intel.com> <20220702135925.73406-2-andriy.shevchenko@linux.intel.com> In-Reply-To: <20220702135925.73406-2-andriy.shevchenko@linux.intel.com> Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.202.205.107] MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=C51A453 smtp.mailfrom=david.laight@aculab.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: aculab.com Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220704_031557_969134_174BF5BF X-CRM114-Status: GOOD ( 10.37 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alexandre Belloni , Wolfram Sang , Krzysztof Kozlowski , Till Harbaum , Alim Akhtar , Codrin Ciubotariu , Claudiu Beznea Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Andy Shevchenko > Sent: 02 July 2022 14:59 > > str_read_write() returns a string literal "read" or "write" based > on the value. It also allows to unify usage of a such in the kernel. > > For i2c case introduce a wrapper that takes struct i2c_msg as parameter. > ... > > - DEB2("=== SLAVE ADDRESS %#04x+%c=%#04x\n", > - msg->addr, msg->flags & I2C_M_RD ? 'R' : 'W', addr); > + DEB2("=== SLAVE ADDRESS %#04x+%s=%#04x\n", msg->addr, i2c_str_read_write(msg), addr); You should ask yourself whether this actually makes the code more readable. Imagine someone who is scan-reading the code to see what it does. They're not going to be impressed when they've chased through two searches to find out the code does. David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales) _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel