[PATCH v2] staging: kpc2000: kpc_i2c: remove the macros inb_p and outb_p

Greg KH gregkh at linuxfoundation.org
Mon Jun 10 15:52:25 UTC 2019


On Mon, Jun 10, 2019 at 03:48:24PM +0800, Hao Xu wrote:
> remove inb_p and outb_p to call readq/writeq directly.
> 
> Signed-off-by: Hao Xu <haoxu.linuxkernel at gmail.com>
> ---
> Changes in v2:
> - remove the macros inb_p/outb_p and use readq/writeq directly, per https://lkml.kernel.org/lkml/20190608134505.GA963@arch-01.home/
> ---
>  drivers/staging/kpc2000/kpc2000_i2c.c | 112 ++++++++++++++++------------------
>  1 file changed, 53 insertions(+), 59 deletions(-)
> 
> diff --git a/drivers/staging/kpc2000/kpc2000_i2c.c b/drivers/staging/kpc2000/kpc2000_i2c.c
> index 69e8773..246d5b3 100644
> --- a/drivers/staging/kpc2000/kpc2000_i2c.c
> +++ b/drivers/staging/kpc2000/kpc2000_i2c.c
> @@ -122,12 +122,6 @@ struct i2c_device {
>  /* Not really a feature, but it's convenient to handle it as such */
>  #define FEATURE_IDF             BIT(15)
>  
> -// FIXME!
> -#undef inb_p
> -#define inb_p(a) readq((void *)a)
> -#undef outb_p
> -#define outb_p(d, a) writeq(d, (void *)a)
> -
>  /* Make sure the SMBus host is ready to start transmitting.
>   * Return 0 if it is, -EBUSY if it is not.
>   */
> @@ -135,7 +129,7 @@ static int i801_check_pre(struct i2c_device *priv)
>  {
>  	int status;
>  
> -	status = inb_p(SMBHSTSTS(priv));
> +	status = readq((void *)SMBHSTSTS(priv));

Ugh, all of the void * casting, is is really needed everywhere?  That
just makes everything a mess...

thanks,

greg k-h


More information about the devel mailing list