From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Wolfram Sang <wsa@the-dreams.de>
Cc: Akinobu Mita <akinobu.mita@gmail.com>,
linux-media@vger.kernel.org, linux-i2c@vger.kernel.org,
Peter Rosin <peda@axentia.se>,
Sebastian Reichel <sebastian.reichel@collabora.co.uk>,
Jacopo Mondi <jacopo+renesas@jmondi.org>,
Hans Verkuil <hans.verkuil@cisco.com>,
Sakari Ailus <sakari.ailus@linux.intel.com>,
Mauro Carvalho Chehab <mchehab@s-opensource.com>
Subject: Re: [PATCH -next v3 1/2] i2c: add SCCB helpers
Date: Tue, 10 Jul 2018 15:16:21 +0300 [thread overview]
Message-ID: <30027540.g4E5J49NzT@avalon> (raw)
In-Reply-To: <20180710120747.s7yg36moaw2xsrim@tetsubishi>
Hi Wolfram,
On Tuesday, 10 July 2018 15:07:47 EEST Wolfram Sang wrote:
> >> +static inline int sccb_read_byte(struct i2c_client *client, u8 addr)
> >> +{
> >> + int ret;
> >> + union i2c_smbus_data data;
> >> +
> >> + i2c_lock_bus(client->adapter, I2C_LOCK_SEGMENT);
> >> +
> >> + ret = __i2c_smbus_xfer(client->adapter, client->addr, client->flags,
> >> + I2C_SMBUS_WRITE, addr, I2C_SMBUS_BYTE, NULL);
> >> + if (ret < 0)
> >> + goto out;
> >> +
> >> + ret = __i2c_smbus_xfer(client->adapter, client->addr, client->flags,
> >> + I2C_SMBUS_READ, 0, I2C_SMBUS_BYTE, &data);
> >> +out:
> >> + i2c_unlock_bus(client->adapter, I2C_LOCK_SEGMENT);
> >> +
> >> + return ret < 0 ? ret : data.byte;
> >> +}
> >
> > I think I mentioned in a previous review of this patch that the function
> > is too big to be a static inline. It should instead be moved to a .c file.
>
> Can be argued.
Especially if sccb_read_byte() is called in multiple places in a driver, not
just once in a read helper, as you've advised for patch 2/2 in this series :-)
> I assume just removing the 'inline' won't do it for you?
Just removing the inline keyword will create many instances of the function,
even when not used. I think it will also cause the compiler to emit warnings
for unused functions. I don't think that's a good idea.
> I'd be fine with that, there are not many SCCB useres out there...
>
> But if you insist on drivers/i2c/i2c-sccb.c, then it should be a
> seperate module, I'd think?
Given how small the functions are, I wouldn't request that, as it would
introduce another Kconfig symbol, but I'm not opposed to such a new module
either.
--
Regards,
Laurent Pinchart
next prev parent reply other threads:[~2018-07-10 12:15 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-09 15:41 [PATCH -next v3 0/2] introduce SCCB helpers Akinobu Mita
2018-07-09 15:41 ` [PATCH -next v3 1/2] i2c: add " Akinobu Mita
2018-07-09 16:11 ` Wolfram Sang
2018-07-10 10:50 ` Laurent Pinchart
2018-07-10 12:07 ` Wolfram Sang
2018-07-10 12:16 ` Laurent Pinchart [this message]
2018-07-10 13:02 ` Wolfram Sang
2018-07-09 15:41 ` [PATCH -next v3 2/2] media: ov772x: use " Akinobu Mita
2018-07-09 16:14 ` Wolfram Sang
2018-07-09 21:23 ` Sebastian Reichel
2018-07-10 16:36 ` Akinobu Mita
2018-07-10 20:59 ` Wolfram Sang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=30027540.g4E5J49NzT@avalon \
--to=laurent.pinchart@ideasonboard.com \
--cc=akinobu.mita@gmail.com \
--cc=hans.verkuil@cisco.com \
--cc=jacopo+renesas@jmondi.org \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@s-opensource.com \
--cc=peda@axentia.se \
--cc=sakari.ailus@linux.intel.com \
--cc=sebastian.reichel@collabora.co.uk \
--cc=wsa@the-dreams.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox