linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>
To: Roman Fietze <roman.fietze-rVvtEhYSWBkAey3BTtE3dg@public.gmane.org>
Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: Const buffer pointers for SMBus/I2C block write functions
Date: Sun, 12 Dec 2010 14:23:28 +0100	[thread overview]
Message-ID: <20101212142328.038f9575@endymion.delvare> (raw)
In-Reply-To: <201011160657.11061.roman.fietze-rVvtEhYSWBkAey3BTtE3dg@public.gmane.org>

Hi Roman,

Sorry for the late answer.

On Tue, 16 Nov 2010 06:57:10 +0100, Roman Fietze wrote:
> If the SMBus and I2C block write functions in i2c-dev.h (the version
> from lm-sensors, not the kernel) would take const buffer pointers,
> this would allow callers to use const data to be sent via SMB/I2C.

The lm-sensors package no longer includes the "user-space version" of
i2c-dev. It is part of i2c-tools now.

Note that this file is an horror, BTW. It should be turned into a proper
library, to avoid the confusion with the kernel header file. This is on
my to-do list for year 2011.

> Please see the diff below.
> 
> 
> Index: include/linux/i2c-dev.h
> ===================================================================
> --- include/linux/i2c-dev.h	(revision 5881)
> +++ include/linux/i2c-dev.h	(working copy)
> @@ -258,7 +258,7 @@
>  }
>  
>  static inline __s32 i2c_smbus_write_block_data(int file, __u8 command, 
> -                                               __u8 length, __u8 *values)
> +                                               __u8 length, const __u8 *values)
>  {
>  	union i2c_smbus_data data;
>  	int i;
> @@ -296,7 +296,7 @@
>  }
>  
>  static inline __s32 i2c_smbus_write_i2c_block_data(int file, __u8 command,
> -                                               __u8 length, __u8 *values)
> +                                               __u8 length, const __u8 *values)
>  {
>  	union i2c_smbus_data data;
>  	int i;
> 

Yes, this makes sense. Patch applied, thanks.

-- 
Jean Delvare

      parent reply	other threads:[~2010-12-12 13:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-16  5:57 Const buffer pointers for SMBus/I2C block write functions Roman Fietze
     [not found] ` <201011160657.11061.roman.fietze-rVvtEhYSWBkAey3BTtE3dg@public.gmane.org>
2010-12-12 13:23   ` Jean Delvare [this message]

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=20101212142328.038f9575@endymion.delvare \
    --to=khali-puyad+kwke1g9huczpvpmw@public.gmane.org \
    --cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=roman.fietze-rVvtEhYSWBkAey3BTtE3dg@public.gmane.org \
    /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;
as well as URLs for NNTP newsgroup(s).