* [PATCH] [i2c]: Fix some gcc 4.0 compile failures and warnings
@ 2005-02-23 22:12 Mickey Stein
2005-02-23 22:57 ` linux-os
2005-02-25 20:07 ` Greg KH
0 siblings, 2 replies; 7+ messages in thread
From: Mickey Stein @ 2005-02-23 22:12 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg KH
[-- Attachment #1: Type: text/plain, Size: 1037 bytes --]
From: Mickey Stein
Versions: linux-2.6.11-rc4-bk11, gcc4 (GCC) 4.0.0 20050217 (latest fc
rawhide from 19Feb DL)
gcc 4.0.x cvs seems to dislike "include/linux/i2c.h file" and others
due to a current gcc 4.0.x change having to do with
array declarations.
Example error msg: include/linux/i2c.h:{55,194} error: array type has
incomplete element type
A. Daplas has recently done a workaround for this on another header
file. A thread discussing this
can be found by following the link below:
http://gcc.gnu.org/ml/gcc/2005-02/msg00053.html
The patch changes the array(struct i2c_msg) declaration used by
*i2c_transfer and *master_xfer
from "struct i2c_msg msg[]" format to "struct i2c_msg *msg".
After some grepping, I came up with about a dozen files that used the
format disliked by gcc4 that're addressed by the attached patch.
Tested on gcc 3.x & gcc 4.x by configuring kernel with all i2c switches
enabled as module, and saw no errors or warnings in i2c.
Signed-off-by: Mickey Stein <yekkim@pacbell.net>
[-- Attachment #2: i2c_xfer.patch --]
[-- Type: text/plain, Size: 10959 bytes --]
--- ./include/linux/i2c.h.sav 2005-02-23 10:35:36.000000000 -0800
+++ ./include/linux/i2c.h 2005-02-23 10:46:23.000000000 -0800
@@ -55,7 +55,7 @@
/* Transfer num messages.
*/
-extern int i2c_transfer(struct i2c_adapter *adap, struct i2c_msg msg[],int num);
+extern int i2c_transfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num);
/*
* Some adapter types (i.e. PCF 8584 based ones) may support slave behaviuor.
@@ -194,7 +194,7 @@
to NULL. If an adapter algorithm can do SMBus access, set
smbus_xfer. If set to NULL, the SMBus protocol is simulated
using common I2C messages */
- int (*master_xfer)(struct i2c_adapter *adap,struct i2c_msg msgs[],
+ int (*master_xfer)(struct i2c_adapter *adap,struct i2c_msg *msgs,
int num);
int (*smbus_xfer) (struct i2c_adapter *adap, u16 addr,
unsigned short flags, char read_write,
--- ./drivers/i2c/busses/i2c-iop3xx.c.sav 2005-02-23 10:36:21.000000000 -0800
+++ ./drivers/i2c/busses/i2c-iop3xx.c 2005-02-23 10:47:36.000000000 -0800
@@ -361,7 +361,7 @@
* master_xfer() - main read/write entry
*/
static int
-iop3xx_i2c_master_xfer(struct i2c_adapter *i2c_adap, struct i2c_msg msgs[],
+iop3xx_i2c_master_xfer(struct i2c_adapter *i2c_adap, struct i2c_msg *msgs,
int num)
{
struct i2c_algo_iop3xx_data *iop3xx_adap = i2c_adap->algo_data;
--- ./drivers/i2c/i2c-core.c.sav 2005-02-23 10:34:59.000000000 -0800
+++ ./drivers/i2c/i2c-core.c 2005-02-23 10:49:18.000000000 -0800
@@ -583,7 +583,7 @@
* ----------------------------------------------------
*/
-int i2c_transfer(struct i2c_adapter * adap, struct i2c_msg msgs[],int num)
+int i2c_transfer(struct i2c_adapter * adap, struct i2c_msg *msgs, int num)
{
int ret;
--- ./drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c.sav 2005-02-23 10:39:53.000000000 -0800
+++ ./drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c 2005-02-23 10:50:07.000000000 -0800
@@ -252,7 +252,7 @@
return rcv_len;
}
-static int master_xfer(struct i2c_adapter* adapter, struct i2c_msg msg[], int num)
+static int master_xfer(struct i2c_adapter* adapter, struct i2c_msg *msg, int num)
{
struct ttusb *ttusb = i2c_get_adapdata(adapter);
int i = 0;
--- ./drivers/media/dvb/b2c2/skystar2.c.sav 2005-02-23 10:40:33.000000000 -0800
+++ ./drivers/media/dvb/b2c2/skystar2.c 2005-02-23 10:50:42.000000000 -0800
@@ -293,7 +293,7 @@
return buf - start;
}
-static int master_xfer(struct i2c_adapter* adapter, struct i2c_msg msgs[], int num)
+static int master_xfer(struct i2c_adapter* adapter, struct i2c_msg *msgs, int num)
{
struct adapter *tmp = i2c_get_adapdata(adapter);
int i, ret = 0;
--- ./Documentation/i2c/writing-clients.sav 2005-02-23 10:42:00.000000000 -0800
+++ ./Documentation/i2c/writing-clients 2005-02-23 10:42:30.000000000 -0800
@@ -642,7 +642,7 @@
parameter contains the bytes the read/write, the third the length of the
buffer. Returned is the actual number of bytes read/written.
- extern int i2c_transfer(struct i2c_adapter *adap, struct i2c_msg msg[],
+ extern int i2c_transfer(struct i2c_adapter *adap, struct i2c_msg *msg,
int num);
This sends a series of messages. Each message can be a read or write,
--- ./include/media/saa7146.h.sav 2005-02-23 12:01:51.000000000 -0800
+++ ./include/media/saa7146.h 2005-02-23 12:19:38.000000000 -0800
@@ -157,7 +157,7 @@
/* from saa7146_i2c.c */
int saa7146_i2c_adapter_prepare(struct saa7146_dev *dev, struct i2c_adapter *i2c_adapter, u32 bitrate);
-int saa7146_i2c_transfer(struct saa7146_dev *saa, const struct i2c_msg msgs[], int num, int retries);
+int saa7146_i2c_transfer(struct saa7146_dev *saa, const struct *i2c_msg msgs, int num, int retries);
/* from saa7146_core.c */
extern struct list_head saa7146_devices;
--- ./drivers/i2c/busses/i2c-s3c2410.c.sav 2005-02-23 12:03:29.000000000 -0800
+++ ./drivers/i2c/busses/i2c-s3c2410.c 2005-02-23 12:20:31.000000000 -0800
@@ -483,7 +483,7 @@
* this starts an i2c transfer
*/
-static int s3c24xx_i2c_doxfer(struct s3c24xx_i2c *i2c, struct i2c_msg msgs[], int num)
+static int s3c24xx_i2c_doxfer(struct s3c24xx_i2c *i2c, struct i2c_msg *msgs, int num)
{
unsigned long timeout;
int ret;
@@ -534,7 +534,7 @@
*/
static int s3c24xx_i2c_xfer(struct i2c_adapter *adap,
- struct i2c_msg msgs[], int num)
+ struct i2c_msg *msgs, int num)
{
struct s3c24xx_i2c *i2c = (struct s3c24xx_i2c *)adap->algo_data;
int retry;
--- ./drivers/i2c/busses/i2c-mpc.c.sav 2005-02-23 12:04:11.000000000 -0800
+++ ./drivers/i2c/busses/i2c-mpc.c 2005-02-23 12:17:28.000000000 -0800
@@ -233,7 +233,7 @@
return length;
}
-static int mpc_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[], int num)
+static int mpc_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num)
{
struct i2c_msg *pmsg;
int i;
--- ./drivers/i2c/busses/i2c-ibm_iic.c.sav 2005-02-23 12:04:42.000000000 -0800
+++ ./drivers/i2c/busses/i2c-ibm_iic.c 2005-02-23 12:21:08.000000000 -0800
@@ -549,7 +549,7 @@
* Generic master transfer entrypoint.
* Returns the number of processed messages or error (<0)
*/
-static int iic_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[], int num)
+static int iic_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num)
{
struct ibm_iic_private* dev = (struct ibm_iic_private*)(i2c_get_adapdata(adap));
volatile struct iic_regs __iomem *iic = dev->vaddr;
--- ./drivers/i2c/busses/i2c-keywest.c.sav 2005-02-23 12:05:10.000000000 -0800
+++ ./drivers/i2c/busses/i2c-keywest.c 2005-02-23 12:26:47.000000000 -0800
@@ -399,7 +399,7 @@
*/
static int
keywest_xfer( struct i2c_adapter *adap,
- struct i2c_msg msgs[],
+ struct i2c_msg *msgs,
int num)
{
struct keywest_chan* chan = i2c_get_adapdata(adap);
--- ./drivers/i2c/busses/i2c-au1550.c.sav 2005-02-23 12:06:00.000000000 -0800
+++ ./drivers/i2c/busses/i2c-au1550.c 2005-02-23 12:27:39.000000000 -0800
@@ -253,7 +253,7 @@
}
static int
-au1550_xfer(struct i2c_adapter *i2c_adap, struct i2c_msg msgs[], int num)
+au1550_xfer(struct i2c_adapter *i2c_adap, struct i2c_msg *msgs, int num)
{
struct i2c_au1550_data *adap = i2c_adap->algo_data;
struct i2c_msg *p;
--- ./drivers/i2c/algos/i2c-algo-pca.c.sav 2005-02-23 12:06:21.000000000 -0800
+++ ./drivers/i2c/algos/i2c-algo-pca.c 2005-02-23 12:28:09.000000000 -0800
@@ -178,7 +178,7 @@
}
static int pca_xfer(struct i2c_adapter *i2c_adap,
- struct i2c_msg msgs[],
+ struct i2c_msg *msgs,
int num)
{
struct i2c_algo_pca_data *adap = i2c_adap->algo_data;
--- ./drivers/i2c/algos/i2c-algo-pcf.c.sav 2005-02-23 12:07:04.000000000 -0800
+++ ./drivers/i2c/algos/i2c-algo-pcf.c 2005-02-23 12:28:49.000000000 -0800
@@ -332,7 +332,7 @@
}
static int pcf_xfer(struct i2c_adapter *i2c_adap,
- struct i2c_msg msgs[],
+ struct i2c_msg *msgs,
int num)
{
struct i2c_algo_pcf_data *adap = i2c_adap->algo_data;
--- ./drivers/i2c/algos/i2c-algo-ite.c.sav 2005-02-23 12:07:17.000000000 -0800
+++ ./drivers/i2c/algos/i2c-algo-ite.c 2005-02-23 12:29:31.000000000 -0800
@@ -490,7 +490,7 @@
* condition.
*/
#if 0
-static int iic_combined_transaction(struct i2c_adapter *i2c_adap, struct i2c_msg msgs[], int num)
+static int iic_combined_transaction(struct i2c_adapter *i2c_adap, struct i2c_msg *msgs, int num)
{
int i;
struct i2c_msg *pmsg;
@@ -600,7 +600,7 @@
* verify that the bus is not busy or in some unknown state.
*/
static int iic_xfer(struct i2c_adapter *i2c_adap,
- struct i2c_msg msgs[],
+ struct i2c_msg *msgs,
int num)
{
struct i2c_algo_iic_data *adap = i2c_adap->algo_data;
--- ./drivers/i2c/algos/i2c-algo-sgi.c.sav 2005-02-23 12:07:40.000000000 -0800
+++ ./drivers/i2c/algos/i2c-algo-sgi.c 2005-02-23 12:29:58.000000000 -0800
@@ -131,7 +131,7 @@
return 0;
}
-static int sgi_xfer(struct i2c_adapter *i2c_adap, struct i2c_msg msgs[],
+static int sgi_xfer(struct i2c_adapter *i2c_adap, struct i2c_msg *msgs,
int num)
{
struct i2c_algo_sgi_data *adap = i2c_adap->algo_data;
--- ./drivers/media/video/saa7134/saa7134-i2c.c.sav 2005-02-23 12:08:12.000000000 -0800
+++ ./drivers/media/video/saa7134/saa7134-i2c.c 2005-02-23 12:30:20.000000000 -0800
@@ -236,7 +236,7 @@
}
static int saa7134_i2c_xfer(struct i2c_adapter *i2c_adap,
- struct i2c_msg msgs[], int num)
+ struct i2c_msg *msgs, int num)
{
struct saa7134_dev *dev = i2c_adap->algo_data;
enum i2c_status status;
--- ./drivers/media/video/bttv-i2c.c.sav 2005-02-23 12:08:29.000000000 -0800
+++ ./drivers/media/video/bttv-i2c.c 2005-02-23 12:30:56.000000000 -0800
@@ -245,7 +245,7 @@
return retval;
}
-static int bttv_i2c_xfer(struct i2c_adapter *i2c_adap, struct i2c_msg msgs[], int num)
+static int bttv_i2c_xfer(struct i2c_adapter *i2c_adap, struct i2c_msg *msgs, int num)
{
struct bttv *btv = i2c_get_adapdata(i2c_adap);
int retval = 0;
--- ./drivers/media/dvb/dibusb/dvb-dibusb-fe-i2c.c.sav 2005-02-23 12:09:43.000000000 -0800
+++ ./drivers/media/dvb/dibusb/dvb-dibusb-fe-i2c.c 2005-02-23 12:31:38.000000000 -0800
@@ -38,7 +38,7 @@
/*
* I2C master xfer function
*/
-static int dibusb_i2c_xfer(struct i2c_adapter *adap,struct i2c_msg msg[],int num)
+static int dibusb_i2c_xfer(struct i2c_adapter *adap,struct i2c_msg *msg,int num)
{
struct usb_dibusb *dib = i2c_get_adapdata(adap);
int i;
--- ./drivers/media/common/saa7146_i2c.c.sav 2005-02-23 12:10:06.000000000 -0800
+++ ./drivers/media/common/saa7146_i2c.c 2005-02-23 12:32:45.000000000 -0800
@@ -25,7 +25,7 @@
sent through the saa7146. have a look at the specifications p. 122 ff
to understand this. it returns the number of u32s to send, or -1
in case of an error. */
-static int saa7146_i2c_msg_prepare(const struct i2c_msg m[], int num, u32 *op)
+static int saa7146_i2c_msg_prepare(const struct i2c_msg *m, int num, u32 *op)
{
int h1, h2;
int i, j, addr;
@@ -89,7 +89,7 @@
which bytes were read through the adapter and write them back to the corresponding
i2c-message. but instead, we simply write back all bytes.
fixme: this could be improved. */
-static int saa7146_i2c_msg_cleanup(const struct i2c_msg m[], int num, u32 *op)
+static int saa7146_i2c_msg_cleanup(const struct i2c_msg *m, int num, u32 *op)
{
int i, j;
int op_count = 0;
@@ -272,7 +272,7 @@
return 0;
}
-int saa7146_i2c_transfer(struct saa7146_dev *dev, const struct i2c_msg msgs[], int num, int retries)
+int saa7146_i2c_transfer(struct saa7146_dev *dev, const struct i2c_msg *msgs, int num, int retries)
{
int i = 0, count = 0;
u32* buffer = dev->d_i2c.cpu_addr;
@@ -372,7 +372,7 @@
}
/* utility functions */
-static int saa7146_i2c_xfer(struct i2c_adapter* adapter, struct i2c_msg msg[], int num)
+static int saa7146_i2c_xfer(struct i2c_adapter* adapter, struct i2c_msg *msg, int num)
{
struct saa7146_dev* dev = i2c_get_adapdata(adapter);
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH] [i2c]: Fix some gcc 4.0 compile failures and warnings 2005-02-23 22:12 [PATCH] [i2c]: Fix some gcc 4.0 compile failures and warnings Mickey Stein @ 2005-02-23 22:57 ` linux-os 2005-02-23 23:17 ` Greg KH 2005-02-25 20:07 ` Greg KH 1 sibling, 1 reply; 7+ messages in thread From: linux-os @ 2005-02-23 22:57 UTC (permalink / raw) To: Mickey Stein; +Cc: Linux kernel, Greg KH [-- Attachment #1: Type: TEXT/PLAIN, Size: 1281 bytes --] On Wed, 23 Feb 2005, Mickey Stein wrote: > From: Mickey Stein > Versions: linux-2.6.11-rc4-bk11, gcc4 (GCC) 4.0.0 20050217 (latest fc > rawhide from 19Feb DL) > > gcc 4.0.x cvs seems to dislike "include/linux/i2c.h file" and others due to a > current gcc 4.0.x change having to do with > array declarations. > > Example error msg: include/linux/i2c.h:{55,194} error: array type has > incomplete element type > > A. Daplas has recently done a workaround for this on another header file. A > thread discussing this > can be found by following the link below: > > http://gcc.gnu.org/ml/gcc/2005-02/msg00053.html > Do you know if the new compiler will compile.... int main(int argc, char *argv[]){} ????? ... or would one have to change every F* file in the world to be: int main(int argc, char **argv){}; ... which is wrong because it's truly a pointer to an array of strings. If so, the compiler is broken. Also, in the cited link, if anybody at GNU bothered to read the Response from the Committee on the cited defect report, they said; "No constraint are violated, therefore no diagnostics are required"...... We shouldn't "fix" the kernel for broken compilers. I attached a `grep` of GNU's own C-header files. I guess they expect us to change all those too, no? [-- Attachment #2: Type: TEXT/PLAIN, Size: 12305 bytes --] aio.h:extern int aio_suspend (__const struct aiocb *__const __list[], int __nent, aio.h: (__const struct aiocb *__const __list[], aio.h:extern int aio_suspend64 (__const struct aiocb64 *__const __list[], int __nent, argz.h:extern error_t __argz_create (char *__const __argv[], char **__restrict __argz, argz.h:extern error_t argz_create (char *__const __argv[], char **__restrict __argz, audiofile.h:void afInitLoopIDs (AFfilesetup, int instid, int ids[], int nids); audiofile.h:int afGetLoopIDs (AFfilehandle, int instid, int loopids[]); audiofile.h:int afGetMarkIDs (AFfilehandle file, int trackid, int markids[]); baudboy.h:static inline int _doit(const char * argv[]) baudboy.h: const char * argv[] = { LOCKDEV_PATH, "-l", NULL, NULL}; baudboy.h: const char * argv[] = { LOCKDEV_PATH, "-u", NULL, NULL}; baudboy.h: const char * argv[] = { LOCKDEV_PATH, NULL, NULL}; colorname.h:pm_parse_dictionary_name(const char colorname[], long const lmaxval, curses.h:extern NCURSES_EXPORT_VAR(chtype) acs_map[]; curses.h:extern NCURSES_EXPORT_VAR(char) ttytype[]; /* needed for backward compatibility */ db_cxx.h: DB_LOCKREQ list[], int nlist, DB_LOCKREQ **elistp); db_cxx.h: virtual int log_archive(char **list[], u_int32_t flags); db.h: int (*log_archive) __P((DB_ENV *, char **[], u_int32_t)); dejagnu.h:const char *outstate_list[] = { expect.h:EXTERN int exp_spawnv _ANSI_ARGS_((char *file, char *argv[])); fam.h:extern char *FamErrlist[]; ghttp_constants.h:extern const char http_hdr_Allow[]; ghttp_constants.h:extern const char http_hdr_Content_Encoding[]; ghttp_constants.h:extern const char http_hdr_Content_Language[]; ghttp_constants.h:extern const char http_hdr_Content_Length[]; ghttp_constants.h:extern const char http_hdr_Content_Location[]; ghttp_constants.h:extern const char http_hdr_Content_MD5[]; ghttp_constants.h:extern const char http_hdr_Content_Range[]; ghttp_constants.h:extern const char http_hdr_Content_Type[]; ghttp_constants.h:extern const char http_hdr_Expires[]; ghttp_constants.h:extern const char http_hdr_Last_Modified[]; ghttp_constants.h:extern const char http_hdr_Cache_Control[]; ghttp_constants.h:extern const char http_hdr_Connection[]; ghttp_constants.h:extern const char http_hdr_Date[]; ghttp_constants.h:extern const char http_hdr_Pragma[]; ghttp_constants.h:extern const char http_hdr_Transfer_Encoding[]; ghttp_constants.h:extern const char http_hdr_Update[]; ghttp_constants.h:extern const char http_hdr_Trailer[]; ghttp_constants.h:extern const char http_hdr_Via[]; ghttp_constants.h:extern const char http_hdr_Accept[]; ghttp_constants.h:extern const char http_hdr_Accept_Charset[]; ghttp_constants.h:extern const char http_hdr_Accept_Encoding[]; ghttp_constants.h:extern const char http_hdr_Accept_Language[]; ghttp_constants.h:extern const char http_hdr_Authorization[]; ghttp_constants.h:extern const char http_hdr_Expect[]; ghttp_constants.h:extern const char http_hdr_From[]; ghttp_constants.h:extern const char http_hdr_Host[]; ghttp_constants.h:extern const char http_hdr_If_Modified_Since[]; ghttp_constants.h:extern const char http_hdr_If_Match[]; ghttp_constants.h:extern const char http_hdr_If_None_Match[]; ghttp_constants.h:extern const char http_hdr_If_Range[]; ghttp_constants.h:extern const char http_hdr_If_Unmodified_Since[]; ghttp_constants.h:extern const char http_hdr_Max_Forwards[]; ghttp_constants.h:extern const char http_hdr_Proxy_Authorization[]; ghttp_constants.h:extern const char http_hdr_Range[]; ghttp_constants.h:extern const char http_hdr_Referrer[]; ghttp_constants.h:extern const char http_hdr_TE[]; ghttp_constants.h:extern const char http_hdr_User_Agent[]; ghttp_constants.h:extern const char http_hdr_Accept_Ranges[]; ghttp_constants.h:extern const char http_hdr_Age[]; ghttp_constants.h:extern const char http_hdr_ETag[]; ghttp_constants.h:extern const char http_hdr_Location[]; ghttp_constants.h:extern const char http_hdr_Retry_After[]; ghttp_constants.h:extern const char http_hdr_Server[]; ghttp_constants.h:extern const char http_hdr_Vary[]; ghttp_constants.h:extern const char http_hdr_Warning[]; ghttp_constants.h:extern const char http_hdr_WWW_Authenticate[]; ghttp_constants.h:extern const char http_hdr_Set_Cookie[]; ghttp_constants.h:extern const char http_hdr_DAV[]; ghttp_constants.h:extern const char http_hdr_Depth[]; ghttp_constants.h:extern const char http_hdr_Destination[]; ghttp_constants.h:extern const char http_hdr_If[]; ghttp_constants.h:extern const char http_hdr_Lock_Token[]; ghttp_constants.h:extern const char http_hdr_Overwrite[]; ghttp_constants.h:extern const char http_hdr_Status_URI[]; ghttp_constants.h:extern const char http_hdr_Timeout[]; gif_lib.h: GifPixelType ColorTransIn2[]); gif_lib.h:extern void ApplyTranslation(SavedImage *Image, GifPixelType Translation[]); gif_lib.h:extern int AddExtensionBlock(SavedImage *New, int Len, char ExtData[]); gif_lib.h:extern unsigned char AsciiTable[][GIF_FONT_WIDTH]; gpm.h:extern unsigned char _gpm_buf[]; hfs.h:extern const unsigned char hfs_charorder[]; hfs.h: const char *, unsigned int, const unsigned long []); iwlib.h: char * args[], iwlib.h: char * args[], iwlib.h:extern const char * const iw_operation_mode[]; jpeglib.h: int component_index; /* its index in SOF or cinfo->comp_info[] */ jpeglib.h: int component_index[MAX_COMPS_IN_SCAN]; /* their SOF/comp_info[] indexes */ jpeglib.h: unsigned int data_length; /* # bytes of data saved at data[] */ k3bdevice.h: static const char* cdrdao_drivers[]; krb5.h: krb5_prompt prompts[]); krb5.h: krb5_prompt prompts[]); libaio.h:extern int io_submit(io_context_t ctx, long nr, struct iocb *ios[]); libesmtp.h:char *smtp_strerror (int error, char buf[], size_t buflen); link.h:extern ElfW(Dyn) _DYNAMIC[]; ltdl.h: extern const lt_dlsymlist lt_preloaded_symbols[]; \ mpi.h:extern int MPI_Group_range_excl __ARGS((MPI_Group, int, int [][3], mpi.h:extern int MPI_Group_range_incl __ARGS((MPI_Group, int, int [][3], mpi.h:extern int PMPI_Group_range_excl __ARGS((MPI_Group, int, int [][3], mpi.h:extern int PMPI_Group_range_incl __ARGS((MPI_Group, int, int [][3], ncurses.h:extern NCURSES_EXPORT_VAR(chtype) acs_map[]; ncurses.h:extern NCURSES_EXPORT_VAR(char) ttytype[]; /* needed for backward compatibility */ netdb.h:extern int gai_suspend (__const struct gaicb *__const __list[], int __ent, pbmfont.h:int mk_argvn ARGS(( char* s, char* vec[], int max )); pbm.h:void pbm_init ARGS(( int* argcP, char* argv[] )); pgm.h:void pgm_init ARGS(( int* argcP, char* argv[] )); pgtypes_numeric.h: int ndigits; /* number of digits in digits[] - can be pgtypes_numeric.h: NumericDigit *buf; /* start of alloc'd space for digits[] */ pgtypes_numeric.h: int ndigits; /* number of digits in digits[] - can be pi-datebook.h: extern char *DatebookAlarmTypeNames[]; pi-datebook.h: extern char *DatebookRepeatTypeNames[]; pi-datebook.hxx: delete [] _description; pi-datebook.hxx: delete [] _note; pi-dlp.h: extern char *dlp_errorlist[]; pi-expense.h: extern char *ExpenseSortNames[]; pi-expense.h: extern char *ExpenseDistanceNames[]; pi-expense.h: extern char *ExpensePaymentNames[]; pi-expense.h: extern char *ExpenseTypeNames[]; pi-mail.h: extern char *MailSyncTypeNames[]; pi-mail.h: extern char *MailSortTypeNames[]; pm.h:pm_proginit(int* const argcP, char* argv[]); pm.h:pm_message (const char format[], ...); pm.h:pm_error (const char reason[], ...); pm.h:pm_perror (const char reason[]); pm.h:pm_usage (const char usage[]); pm.h:pm_openr_seekable(const char name[]); pm.h:pm_arg0toprogname(const char arg0[]); pnm.h:void pnm_init ARGS(( int* argcP, char* argv[] )); popt.h:extern struct poptOption poptAliasOptions[]; popt.h:extern struct poptOption poptHelpOptions[]; ppm.h:void ppm_init ARGS(( int* argcP, char* argv[] )); recodext.h:extern const recode_ucs2 ucs2_data_pool[]; resolv.h: unsigned nsort:4; /* number of elements in sort_list[] */ shhopt.h:void optParseOptions(int *argc, char *argv[], shhopt.h: optStruct opt[], int allowNegNum); shhopt.h:optParseOptions2(int * const argc_p, char *argv[], const optStruct2 opt, shhopt.h:optParseOptions3(int * const argc_p, char *argv[], const optStruct3 opt, spawn.h: char *__const argv[], char *__const envp[]); stdlib.h:extern int getloadavg (double __loadavg[], int __nelem) __THROW; tcldbg.h:EXTERN char **Dbg_ArgcArgv _ANSI_ARGS_((int argc,char *argv[], tclDecls.h: Tcl_Obj *CONST objv[])); tclDecls.h: int objc, Tcl_Obj *CONST objv[])); tclDecls.h: Tcl_Obj *CONST objv[])); tclDecls.h: int objc, Tcl_Obj *CONST objv[])); tclDecls.h: Tcl_Obj *CONST objv[])); tclDecls.h: int objc, Tcl_Obj *CONST objv[], tclDecls.h: int objc, Tcl_Obj *CONST objv[], int flags)); tclDecls.h: Tcl_Obj *CONST objv[])); tclDecls.h: int objc, Tcl_Obj *CONST objv[])); tclDecls.h: Tcl_Obj * (*tcl_ConcatObj) _ANSI_ARGS_((int objc, Tcl_Obj *CONST objv[])); /* 17 */ tclDecls.h: int (*tcl_ListObjReplace) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * listPtr, int first, int count, int objc, Tcl_Obj *CONST objv[])); /* 48 */ tclDecls.h: Tcl_Obj * (*tcl_NewListObj) _ANSI_ARGS_((int objc, Tcl_Obj *CONST objv[])); /* 53 */ tclDecls.h: void (*tcl_SetListObj) _ANSI_ARGS_((Tcl_Obj * objPtr, int objc, Tcl_Obj *CONST objv[])); /* 62 */ tclDecls.h: int (*tcl_CreateAliasObj) _ANSI_ARGS_((Tcl_Interp * slave, CONST char * slaveCmd, Tcl_Interp * target, CONST char * targetCmd, int objc, Tcl_Obj *CONST objv[])); /* 87 */ tclDecls.h: void (*tcl_WrongNumArgs) _ANSI_ARGS_((Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[], CONST char * message)); /* 264 */ tclDecls.h: int (*tcl_EvalObjv) _ANSI_ARGS_((Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[], int flags)); /* 292 */ tclDecls.h: int (*tcl_ProcObjCmd) _ANSI_ARGS_((ClientData clientData, Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[])); /* 390 */ tclDecls.h: Tcl_Obj* (*tcl_FSJoinToPath) _ANSI_ARGS_((Tcl_Obj * basePtr, int objc, Tcl_Obj *CONST objv[])); /* 464 */ tcl.h: Tcl_Interp *interp, int argc, CONST84 char *argv[])); tcl.h: ClientData cmdClientData, int argc, CONST84 char *argv[])); tcpd.h:extern char unknown[]; tcpd.h:extern char paranoid[]; term.h:extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) boolnames[]; term.h:extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) boolcodes[]; term.h:extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) boolfnames[]; term.h:extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) numnames[]; term.h:extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) numcodes[]; term.h:extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) numfnames[]; term.h:extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) strnames[]; term.h:extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) strcodes[]; term.h:extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) strfnames[]; term.h:extern NCURSES_EXPORT_VAR(char) ttytype[]; tkDecls.h: int objc, Tcl_Obj *CONST objv[], tkDecls.h: int objc, Tcl_Obj *CONST objv[], tkDecls.h: int (*tk_GetScrollInfoObj) _ANSI_ARGS_((Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[], double * dblPtr, int * intPtr)); /* 210 */ tkDecls.h: int (*tk_SetOptions) _ANSI_ARGS_((Tcl_Interp * interp, char * recordPtr, Tk_OptionTable optionTable, int objc, Tcl_Obj *CONST objv[], Tk_Window tkwin, Tk_SavedOptions * savePtr, int * maskPtr)); /* 214 */ tk.h: XPoint xPoints[], double dblPoints[])); tk.h: Tcl_Obj *CONST objv[])); tk.h: Tcl_Obj *CONST objv[], int flags)); tk.h: Tcl_Obj *CONST argv[])); tk.h: char *name, int objc, Tcl_Obj *CONST objv[], Tk_ImageType *typePtr, unistd.h:extern int execve (__const char *__path, char *__const __argv[], unistd.h: char *__const __envp[]) __THROW; unistd.h:extern int fexecve (int __fd, char *__const __argv[], char *__const __envp[]) unistd.h:extern int execv (__const char *__path, char *__const __argv[]) __THROW; unistd.h:extern int execvp (__const char *__file, char *__const __argv[]) __THROW; unistd.h:extern int getgroups (int __size, __gid_t __list[]) __THROW; ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] [i2c]: Fix some gcc 4.0 compile failures and warnings 2005-02-23 22:57 ` linux-os @ 2005-02-23 23:17 ` Greg KH 0 siblings, 0 replies; 7+ messages in thread From: Greg KH @ 2005-02-23 23:17 UTC (permalink / raw) To: linux-os; +Cc: Mickey Stein, Linux kernel On Wed, Feb 23, 2005 at 05:57:14PM -0500, linux-os wrote: > On Wed, 23 Feb 2005, Mickey Stein wrote: > > >From: Mickey Stein > >Versions: linux-2.6.11-rc4-bk11, gcc4 (GCC) 4.0.0 20050217 (latest fc > >rawhide from 19Feb DL) > > > >gcc 4.0.x cvs seems to dislike "include/linux/i2c.h file" and others due > >to a current gcc 4.0.x change having to do with > >array declarations. > > > >Example error msg: include/linux/i2c.h:{55,194} error: array type has > >incomplete element type > > > >A. Daplas has recently done a workaround for this on another header file. > >A thread discussing this > >can be found by following the link below: > > > >http://gcc.gnu.org/ml/gcc/2005-02/msg00053.html > > > > Do you know if the new compiler will compile.... > > int main(int argc, char *argv[]){} > > ????? That's not the point here. See the above thread for the real point. greg k-h ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] [i2c]: Fix some gcc 4.0 compile failures and warnings 2005-02-23 22:12 [PATCH] [i2c]: Fix some gcc 4.0 compile failures and warnings Mickey Stein 2005-02-23 22:57 ` linux-os @ 2005-02-25 20:07 ` Greg KH 1 sibling, 0 replies; 7+ messages in thread From: Greg KH @ 2005-02-25 20:07 UTC (permalink / raw) To: Mickey Stein; +Cc: linux-kernel On Wed, Feb 23, 2005 at 02:12:44PM -0800, Mickey Stein wrote: > From: Mickey Stein > Versions: linux-2.6.11-rc4-bk11, gcc4 (GCC) 4.0.0 20050217 (latest fc > rawhide from 19Feb DL) > > gcc 4.0.x cvs seems to dislike "include/linux/i2c.h file" and others > due to a current gcc 4.0.x change having to do with > array declarations. > > Example error msg: include/linux/i2c.h:{55,194} error: array type has > incomplete element type > > A. Daplas has recently done a workaround for this on another header > file. A thread discussing this > can be found by following the link below: > > http://gcc.gnu.org/ml/gcc/2005-02/msg00053.html > > The patch changes the array(struct i2c_msg) declaration used by > *i2c_transfer and *master_xfer > from "struct i2c_msg msg[]" format to "struct i2c_msg *msg". > > After some grepping, I came up with about a dozen files that used the > format disliked by gcc4 that're addressed by the attached patch. > Tested on gcc 3.x & gcc 4.x by configuring kernel with all i2c switches > enabled as module, and saw no errors or warnings in i2c. > > Signed-off-by: Mickey Stein <yekkim@pacbell.net> Applied, thanks. greg k-h ^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH] I2C: Make i2c list terminators explicitely unsigned @ 2005-03-04 20:36 Greg KH 2005-03-04 20:36 ` [PATCH] I2C: Fix some gcc 4.0 compile failures and warnings Greg KH 0 siblings, 1 reply; 7+ messages in thread From: Greg KH @ 2005-03-04 20:36 UTC (permalink / raw) To: linux-kernel, sensors; +Cc: khali ChangeSet 1.2107, 2005/03/02 15:02:10-08:00, khali@linux-fr.org [PATCH] I2C: Make i2c list terminators explicitely unsigned Shouldn't the i2c list terminators be explicitely declared as unsigned? I'd hope it to help code analysis tools and possibly avoid false positives. Coverity's SWAT pointed my attention to these constants. Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> include/linux/i2c.h | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff -Nru a/include/linux/i2c.h b/include/linux/i2c.h --- a/include/linux/i2c.h 2005-03-04 12:23:42 -08:00 +++ b/include/linux/i2c.h 2005-03-04 12:23:42 -08:00 @@ -299,8 +299,8 @@ }; /* Internal numbers to terminate lists */ -#define I2C_CLIENT_END 0xfffe -#define I2C_CLIENT_ISA_END 0xfffefffe +#define I2C_CLIENT_END 0xfffeU +#define I2C_CLIENT_ISA_END 0xfffefffeU /* The numbers to use to set I2C bus address */ #define ANY_I2C_BUS 0xffff ^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH] I2C: Fix some gcc 4.0 compile failures and warnings 2005-03-04 20:36 [PATCH] I2C: Make i2c list terminators explicitely unsigned Greg KH @ 2005-03-04 20:36 ` Greg KH 2005-03-04 22:55 ` Mickey Stein 0 siblings, 1 reply; 7+ messages in thread From: Greg KH @ 2005-03-04 20:36 UTC (permalink / raw) To: linux-kernel, sensors; +Cc: yekkim ChangeSet 1.2108, 2005/03/02 15:02:27-08:00, yekkim@pacbell.net [PATCH] I2C: Fix some gcc 4.0 compile failures and warnings gcc 4.0.x cvs seems to dislike "include/linux/i2c.h file" and others due to a current gcc 4.0.x change having to do with array declarations. Example error msg: include/linux/i2c.h:{55,194} error: array type has incomplete element type A. Daplas has recently done a workaround for this on another header file. A thread discussing this can be found by following the link below: http://gcc.gnu.org/ml/gcc/2005-02/msg00053.html The patch changes the array(struct i2c_msg) declaration used by *i2c_transfer and *master_xfer from "struct i2c_msg msg[]" format to "struct i2c_msg *msg". After some grepping, I came up with about a dozen files that used the format disliked by gcc4 that're addressed by the attached patch. Tested on gcc 3.x & gcc 4.x by configuring kernel with all i2c switches enabled as module, and saw no errors or warnings in i2c. Signed-off-by: Mickey Stein <yekkim@pacbell.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> Documentation/i2c/writing-clients | 2 +- drivers/i2c/algos/i2c-algo-ite.c | 4 ++-- drivers/i2c/algos/i2c-algo-pca.c | 2 +- drivers/i2c/algos/i2c-algo-pcf.c | 2 +- drivers/i2c/algos/i2c-algo-sgi.c | 2 +- drivers/i2c/busses/i2c-au1550.c | 2 +- drivers/i2c/busses/i2c-ibm_iic.c | 2 +- drivers/i2c/busses/i2c-iop3xx.c | 2 +- drivers/i2c/busses/i2c-keywest.c | 2 +- drivers/i2c/busses/i2c-mpc.c | 2 +- drivers/i2c/busses/i2c-s3c2410.c | 4 ++-- drivers/i2c/i2c-core.c | 2 +- drivers/media/common/saa7146_i2c.c | 8 ++++---- drivers/media/dvb/b2c2/skystar2.c | 2 +- drivers/media/dvb/dibusb/dvb-dibusb-fe-i2c.c | 2 +- drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c | 2 +- drivers/media/video/bttv-i2c.c | 2 +- drivers/media/video/saa7134/saa7134-i2c.c | 2 +- include/linux/i2c.h | 4 ++-- include/media/saa7146.h | 2 +- 20 files changed, 26 insertions(+), 26 deletions(-) diff -Nru a/Documentation/i2c/writing-clients b/Documentation/i2c/writing-clients --- a/Documentation/i2c/writing-clients 2005-03-04 12:23:35 -08:00 +++ b/Documentation/i2c/writing-clients 2005-03-04 12:23:35 -08:00 @@ -638,7 +638,7 @@ parameter contains the bytes the read/write, the third the length of the buffer. Returned is the actual number of bytes read/written. - extern int i2c_transfer(struct i2c_adapter *adap, struct i2c_msg msg[], + extern int i2c_transfer(struct i2c_adapter *adap, struct i2c_msg *msg, int num); This sends a series of messages. Each message can be a read or write, diff -Nru a/drivers/i2c/algos/i2c-algo-ite.c b/drivers/i2c/algos/i2c-algo-ite.c --- a/drivers/i2c/algos/i2c-algo-ite.c 2005-03-04 12:23:35 -08:00 +++ b/drivers/i2c/algos/i2c-algo-ite.c 2005-03-04 12:23:35 -08:00 @@ -490,7 +490,7 @@ * condition. */ #if 0 -static int iic_combined_transaction(struct i2c_adapter *i2c_adap, struct i2c_msg msgs[], int num) +static int iic_combined_transaction(struct i2c_adapter *i2c_adap, struct i2c_msg *msgs, int num) { int i; struct i2c_msg *pmsg; @@ -600,7 +600,7 @@ * verify that the bus is not busy or in some unknown state. */ static int iic_xfer(struct i2c_adapter *i2c_adap, - struct i2c_msg msgs[], + struct i2c_msg *msgs, int num) { struct i2c_algo_iic_data *adap = i2c_adap->algo_data; diff -Nru a/drivers/i2c/algos/i2c-algo-pca.c b/drivers/i2c/algos/i2c-algo-pca.c --- a/drivers/i2c/algos/i2c-algo-pca.c 2005-03-04 12:23:35 -08:00 +++ b/drivers/i2c/algos/i2c-algo-pca.c 2005-03-04 12:23:35 -08:00 @@ -178,7 +178,7 @@ } static int pca_xfer(struct i2c_adapter *i2c_adap, - struct i2c_msg msgs[], + struct i2c_msg *msgs, int num) { struct i2c_algo_pca_data *adap = i2c_adap->algo_data; diff -Nru a/drivers/i2c/algos/i2c-algo-pcf.c b/drivers/i2c/algos/i2c-algo-pcf.c --- a/drivers/i2c/algos/i2c-algo-pcf.c 2005-03-04 12:23:35 -08:00 +++ b/drivers/i2c/algos/i2c-algo-pcf.c 2005-03-04 12:23:35 -08:00 @@ -332,7 +332,7 @@ } static int pcf_xfer(struct i2c_adapter *i2c_adap, - struct i2c_msg msgs[], + struct i2c_msg *msgs, int num) { struct i2c_algo_pcf_data *adap = i2c_adap->algo_data; diff -Nru a/drivers/i2c/algos/i2c-algo-sgi.c b/drivers/i2c/algos/i2c-algo-sgi.c --- a/drivers/i2c/algos/i2c-algo-sgi.c 2005-03-04 12:23:35 -08:00 +++ b/drivers/i2c/algos/i2c-algo-sgi.c 2005-03-04 12:23:35 -08:00 @@ -131,7 +131,7 @@ return 0; } -static int sgi_xfer(struct i2c_adapter *i2c_adap, struct i2c_msg msgs[], +static int sgi_xfer(struct i2c_adapter *i2c_adap, struct i2c_msg *msgs, int num) { struct i2c_algo_sgi_data *adap = i2c_adap->algo_data; diff -Nru a/drivers/i2c/busses/i2c-au1550.c b/drivers/i2c/busses/i2c-au1550.c --- a/drivers/i2c/busses/i2c-au1550.c 2005-03-04 12:23:35 -08:00 +++ b/drivers/i2c/busses/i2c-au1550.c 2005-03-04 12:23:35 -08:00 @@ -253,7 +253,7 @@ } static int -au1550_xfer(struct i2c_adapter *i2c_adap, struct i2c_msg msgs[], int num) +au1550_xfer(struct i2c_adapter *i2c_adap, struct i2c_msg *msgs, int num) { struct i2c_au1550_data *adap = i2c_adap->algo_data; struct i2c_msg *p; diff -Nru a/drivers/i2c/busses/i2c-ibm_iic.c b/drivers/i2c/busses/i2c-ibm_iic.c --- a/drivers/i2c/busses/i2c-ibm_iic.c 2005-03-04 12:23:35 -08:00 +++ b/drivers/i2c/busses/i2c-ibm_iic.c 2005-03-04 12:23:35 -08:00 @@ -549,7 +549,7 @@ * Generic master transfer entrypoint. * Returns the number of processed messages or error (<0) */ -static int iic_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[], int num) +static int iic_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num) { struct ibm_iic_private* dev = (struct ibm_iic_private*)(i2c_get_adapdata(adap)); volatile struct iic_regs __iomem *iic = dev->vaddr; diff -Nru a/drivers/i2c/busses/i2c-iop3xx.c b/drivers/i2c/busses/i2c-iop3xx.c --- a/drivers/i2c/busses/i2c-iop3xx.c 2005-03-04 12:23:35 -08:00 +++ b/drivers/i2c/busses/i2c-iop3xx.c 2005-03-04 12:23:35 -08:00 @@ -361,7 +361,7 @@ * master_xfer() - main read/write entry */ static int -iop3xx_i2c_master_xfer(struct i2c_adapter *i2c_adap, struct i2c_msg msgs[], +iop3xx_i2c_master_xfer(struct i2c_adapter *i2c_adap, struct i2c_msg *msgs, int num) { struct i2c_algo_iop3xx_data *iop3xx_adap = i2c_adap->algo_data; diff -Nru a/drivers/i2c/busses/i2c-keywest.c b/drivers/i2c/busses/i2c-keywest.c --- a/drivers/i2c/busses/i2c-keywest.c 2005-03-04 12:23:35 -08:00 +++ b/drivers/i2c/busses/i2c-keywest.c 2005-03-04 12:23:35 -08:00 @@ -399,7 +399,7 @@ */ static int keywest_xfer( struct i2c_adapter *adap, - struct i2c_msg msgs[], + struct i2c_msg *msgs, int num) { struct keywest_chan* chan = i2c_get_adapdata(adap); diff -Nru a/drivers/i2c/busses/i2c-mpc.c b/drivers/i2c/busses/i2c-mpc.c --- a/drivers/i2c/busses/i2c-mpc.c 2005-03-04 12:23:35 -08:00 +++ b/drivers/i2c/busses/i2c-mpc.c 2005-03-04 12:23:35 -08:00 @@ -233,7 +233,7 @@ return length; } -static int mpc_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[], int num) +static int mpc_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num) { struct i2c_msg *pmsg; int i; diff -Nru a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c-s3c2410.c --- a/drivers/i2c/busses/i2c-s3c2410.c 2005-03-04 12:23:35 -08:00 +++ b/drivers/i2c/busses/i2c-s3c2410.c 2005-03-04 12:23:35 -08:00 @@ -483,7 +483,7 @@ * this starts an i2c transfer */ -static int s3c24xx_i2c_doxfer(struct s3c24xx_i2c *i2c, struct i2c_msg msgs[], int num) +static int s3c24xx_i2c_doxfer(struct s3c24xx_i2c *i2c, struct i2c_msg *msgs, int num) { unsigned long timeout; int ret; @@ -534,7 +534,7 @@ */ static int s3c24xx_i2c_xfer(struct i2c_adapter *adap, - struct i2c_msg msgs[], int num) + struct i2c_msg *msgs, int num) { struct s3c24xx_i2c *i2c = (struct s3c24xx_i2c *)adap->algo_data; int retry; diff -Nru a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c --- a/drivers/i2c/i2c-core.c 2005-03-04 12:23:35 -08:00 +++ b/drivers/i2c/i2c-core.c 2005-03-04 12:23:35 -08:00 @@ -582,7 +582,7 @@ * ---------------------------------------------------- */ -int i2c_transfer(struct i2c_adapter * adap, struct i2c_msg msgs[],int num) +int i2c_transfer(struct i2c_adapter * adap, struct i2c_msg *msgs, int num) { int ret; diff -Nru a/drivers/media/common/saa7146_i2c.c b/drivers/media/common/saa7146_i2c.c --- a/drivers/media/common/saa7146_i2c.c 2005-03-04 12:23:35 -08:00 +++ b/drivers/media/common/saa7146_i2c.c 2005-03-04 12:23:35 -08:00 @@ -25,7 +25,7 @@ sent through the saa7146. have a look at the specifications p. 122 ff to understand this. it returns the number of u32s to send, or -1 in case of an error. */ -static int saa7146_i2c_msg_prepare(const struct i2c_msg m[], int num, u32 *op) +static int saa7146_i2c_msg_prepare(const struct i2c_msg *m, int num, u32 *op) { int h1, h2; int i, j, addr; @@ -89,7 +89,7 @@ which bytes were read through the adapter and write them back to the corresponding i2c-message. but instead, we simply write back all bytes. fixme: this could be improved. */ -static int saa7146_i2c_msg_cleanup(const struct i2c_msg m[], int num, u32 *op) +static int saa7146_i2c_msg_cleanup(const struct i2c_msg *m, int num, u32 *op) { int i, j; int op_count = 0; @@ -272,7 +272,7 @@ return 0; } -int saa7146_i2c_transfer(struct saa7146_dev *dev, const struct i2c_msg msgs[], int num, int retries) +int saa7146_i2c_transfer(struct saa7146_dev *dev, const struct i2c_msg *msgs, int num, int retries) { int i = 0, count = 0; u32* buffer = dev->d_i2c.cpu_addr; @@ -372,7 +372,7 @@ } /* utility functions */ -static int saa7146_i2c_xfer(struct i2c_adapter* adapter, struct i2c_msg msg[], int num) +static int saa7146_i2c_xfer(struct i2c_adapter* adapter, struct i2c_msg *msg, int num) { struct saa7146_dev* dev = i2c_get_adapdata(adapter); diff -Nru a/drivers/media/dvb/b2c2/skystar2.c b/drivers/media/dvb/b2c2/skystar2.c --- a/drivers/media/dvb/b2c2/skystar2.c 2005-03-04 12:23:35 -08:00 +++ b/drivers/media/dvb/b2c2/skystar2.c 2005-03-04 12:23:35 -08:00 @@ -293,7 +293,7 @@ return buf - start; } -static int master_xfer(struct i2c_adapter* adapter, struct i2c_msg msgs[], int num) +static int master_xfer(struct i2c_adapter* adapter, struct i2c_msg *msgs, int num) { struct adapter *tmp = i2c_get_adapdata(adapter); int i, ret = 0; diff -Nru a/drivers/media/dvb/dibusb/dvb-dibusb-fe-i2c.c b/drivers/media/dvb/dibusb/dvb-dibusb-fe-i2c.c --- a/drivers/media/dvb/dibusb/dvb-dibusb-fe-i2c.c 2005-03-04 12:23:35 -08:00 +++ b/drivers/media/dvb/dibusb/dvb-dibusb-fe-i2c.c 2005-03-04 12:23:35 -08:00 @@ -38,7 +38,7 @@ /* * I2C master xfer function */ -static int dibusb_i2c_xfer(struct i2c_adapter *adap,struct i2c_msg msg[],int num) +static int dibusb_i2c_xfer(struct i2c_adapter *adap,struct i2c_msg *msg,int num) { struct usb_dibusb *dib = i2c_get_adapdata(adap); int i; diff -Nru a/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c b/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c --- a/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c 2005-03-04 12:23:35 -08:00 +++ b/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c 2005-03-04 12:23:35 -08:00 @@ -252,7 +252,7 @@ return rcv_len; } -static int master_xfer(struct i2c_adapter* adapter, struct i2c_msg msg[], int num) +static int master_xfer(struct i2c_adapter* adapter, struct i2c_msg *msg, int num) { struct ttusb *ttusb = i2c_get_adapdata(adapter); int i = 0; diff -Nru a/drivers/media/video/bttv-i2c.c b/drivers/media/video/bttv-i2c.c --- a/drivers/media/video/bttv-i2c.c 2005-03-04 12:23:35 -08:00 +++ b/drivers/media/video/bttv-i2c.c 2005-03-04 12:23:35 -08:00 @@ -245,7 +245,7 @@ return retval; } -static int bttv_i2c_xfer(struct i2c_adapter *i2c_adap, struct i2c_msg msgs[], int num) +static int bttv_i2c_xfer(struct i2c_adapter *i2c_adap, struct i2c_msg *msgs, int num) { struct bttv *btv = i2c_get_adapdata(i2c_adap); int retval = 0; diff -Nru a/drivers/media/video/saa7134/saa7134-i2c.c b/drivers/media/video/saa7134/saa7134-i2c.c --- a/drivers/media/video/saa7134/saa7134-i2c.c 2005-03-04 12:23:35 -08:00 +++ b/drivers/media/video/saa7134/saa7134-i2c.c 2005-03-04 12:23:35 -08:00 @@ -236,7 +236,7 @@ } static int saa7134_i2c_xfer(struct i2c_adapter *i2c_adap, - struct i2c_msg msgs[], int num) + struct i2c_msg *msgs, int num) { struct saa7134_dev *dev = i2c_adap->algo_data; enum i2c_status status; diff -Nru a/include/linux/i2c.h b/include/linux/i2c.h --- a/include/linux/i2c.h 2005-03-04 12:23:35 -08:00 +++ b/include/linux/i2c.h 2005-03-04 12:23:35 -08:00 @@ -55,7 +55,7 @@ /* Transfer num messages. */ -extern int i2c_transfer(struct i2c_adapter *adap, struct i2c_msg msg[],int num); +extern int i2c_transfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num); /* * Some adapter types (i.e. PCF 8584 based ones) may support slave behaviuor. @@ -191,7 +191,7 @@ to NULL. If an adapter algorithm can do SMBus access, set smbus_xfer. If set to NULL, the SMBus protocol is simulated using common I2C messages */ - int (*master_xfer)(struct i2c_adapter *adap,struct i2c_msg msgs[], + int (*master_xfer)(struct i2c_adapter *adap,struct i2c_msg *msgs, int num); int (*smbus_xfer) (struct i2c_adapter *adap, u16 addr, unsigned short flags, char read_write, diff -Nru a/include/media/saa7146.h b/include/media/saa7146.h --- a/include/media/saa7146.h 2005-03-04 12:23:35 -08:00 +++ b/include/media/saa7146.h 2005-03-04 12:23:35 -08:00 @@ -157,7 +157,7 @@ /* from saa7146_i2c.c */ int saa7146_i2c_adapter_prepare(struct saa7146_dev *dev, struct i2c_adapter *i2c_adapter, u32 bitrate); -int saa7146_i2c_transfer(struct saa7146_dev *saa, const struct i2c_msg msgs[], int num, int retries); +int saa7146_i2c_transfer(struct saa7146_dev *saa, const struct *i2c_msg msgs, int num, int retries); /* from saa7146_core.c */ extern struct list_head saa7146_devices; ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] I2C: Fix some gcc 4.0 compile failures and warnings 2005-03-04 20:36 ` [PATCH] I2C: Fix some gcc 4.0 compile failures and warnings Greg KH @ 2005-03-04 22:55 ` Mickey Stein 2005-03-04 23:02 ` Greg KH 0 siblings, 1 reply; 7+ messages in thread From: Mickey Stein @ 2005-03-04 22:55 UTC (permalink / raw) To: Greg K-H; +Cc: linux-kernel, sensors [-- Attachment #1: Type: text/plain, Size: 16316 bytes --] Greg KH wrote: >ChangeSet 1.2108, 2005/03/02 15:02:27-08:00, yekkim@pacbell.net > >[PATCH] I2C: Fix some gcc 4.0 compile failures and warnings > >gcc 4.0.x cvs seems to dislike "include/linux/i2c.h file" and others due >to a current gcc 4.0.x change having to do with array declarations. > >Example error msg: include/linux/i2c.h:{55,194} error: array type has >incomplete element type > >A. Daplas has recently done a workaround for this on another header >file. A thread discussing this can be found by following the link below: > >http://gcc.gnu.org/ml/gcc/2005-02/msg00053.html > >The patch changes the array(struct i2c_msg) declaration used by >*i2c_transfer and *master_xfer from "struct i2c_msg msg[]" format to >"struct i2c_msg *msg". > >After some grepping, I came up with about a dozen files that used the >format disliked by gcc4 that're addressed by the attached patch. >Tested on gcc 3.x & gcc 4.x by configuring kernel with all i2c switches >enabled as module, and saw no errors or warnings in i2c. > >Signed-off-by: Mickey Stein <yekkim@pacbell.net> >Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> > > > Documentation/i2c/writing-clients | 2 +- > drivers/i2c/algos/i2c-algo-ite.c | 4 ++-- > drivers/i2c/algos/i2c-algo-pca.c | 2 +- > drivers/i2c/algos/i2c-algo-pcf.c | 2 +- > drivers/i2c/algos/i2c-algo-sgi.c | 2 +- > drivers/i2c/busses/i2c-au1550.c | 2 +- > drivers/i2c/busses/i2c-ibm_iic.c | 2 +- > drivers/i2c/busses/i2c-iop3xx.c | 2 +- > drivers/i2c/busses/i2c-keywest.c | 2 +- > drivers/i2c/busses/i2c-mpc.c | 2 +- > drivers/i2c/busses/i2c-s3c2410.c | 4 ++-- > drivers/i2c/i2c-core.c | 2 +- > drivers/media/common/saa7146_i2c.c | 8 ++++---- > drivers/media/dvb/b2c2/skystar2.c | 2 +- > drivers/media/dvb/dibusb/dvb-dibusb-fe-i2c.c | 2 +- > drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c | 2 +- > drivers/media/video/bttv-i2c.c | 2 +- > drivers/media/video/saa7134/saa7134-i2c.c | 2 +- > include/linux/i2c.h | 4 ++-- > include/media/saa7146.h | 2 +- > 20 files changed, 26 insertions(+), 26 deletions(-) > > >diff -Nru a/Documentation/i2c/writing-clients b/Documentation/i2c/writing-clients >--- a/Documentation/i2c/writing-clients 2005-03-04 12:23:35 -08:00 >+++ b/Documentation/i2c/writing-clients 2005-03-04 12:23:35 -08:00 >@@ -638,7 +638,7 @@ > parameter contains the bytes the read/write, the third the length of the > buffer. Returned is the actual number of bytes read/written. > >- extern int i2c_transfer(struct i2c_adapter *adap, struct i2c_msg msg[], >+ extern int i2c_transfer(struct i2c_adapter *adap, struct i2c_msg *msg, > int num); > > This sends a series of messages. Each message can be a read or write, >diff -Nru a/drivers/i2c/algos/i2c-algo-ite.c b/drivers/i2c/algos/i2c-algo-ite.c >--- a/drivers/i2c/algos/i2c-algo-ite.c 2005-03-04 12:23:35 -08:00 >+++ b/drivers/i2c/algos/i2c-algo-ite.c 2005-03-04 12:23:35 -08:00 >@@ -490,7 +490,7 @@ > * condition. > */ > #if 0 >-static int iic_combined_transaction(struct i2c_adapter *i2c_adap, struct i2c_msg msgs[], int num) >+static int iic_combined_transaction(struct i2c_adapter *i2c_adap, struct i2c_msg *msgs, int num) > { > int i; > struct i2c_msg *pmsg; >@@ -600,7 +600,7 @@ > * verify that the bus is not busy or in some unknown state. > */ > static int iic_xfer(struct i2c_adapter *i2c_adap, >- struct i2c_msg msgs[], >+ struct i2c_msg *msgs, > int num) > { > struct i2c_algo_iic_data *adap = i2c_adap->algo_data; >diff -Nru a/drivers/i2c/algos/i2c-algo-pca.c b/drivers/i2c/algos/i2c-algo-pca.c >--- a/drivers/i2c/algos/i2c-algo-pca.c 2005-03-04 12:23:35 -08:00 >+++ b/drivers/i2c/algos/i2c-algo-pca.c 2005-03-04 12:23:35 -08:00 >@@ -178,7 +178,7 @@ > } > > static int pca_xfer(struct i2c_adapter *i2c_adap, >- struct i2c_msg msgs[], >+ struct i2c_msg *msgs, > int num) > { > struct i2c_algo_pca_data *adap = i2c_adap->algo_data; >diff -Nru a/drivers/i2c/algos/i2c-algo-pcf.c b/drivers/i2c/algos/i2c-algo-pcf.c >--- a/drivers/i2c/algos/i2c-algo-pcf.c 2005-03-04 12:23:35 -08:00 >+++ b/drivers/i2c/algos/i2c-algo-pcf.c 2005-03-04 12:23:35 -08:00 >@@ -332,7 +332,7 @@ > } > > static int pcf_xfer(struct i2c_adapter *i2c_adap, >- struct i2c_msg msgs[], >+ struct i2c_msg *msgs, > int num) > { > struct i2c_algo_pcf_data *adap = i2c_adap->algo_data; >diff -Nru a/drivers/i2c/algos/i2c-algo-sgi.c b/drivers/i2c/algos/i2c-algo-sgi.c >--- a/drivers/i2c/algos/i2c-algo-sgi.c 2005-03-04 12:23:35 -08:00 >+++ b/drivers/i2c/algos/i2c-algo-sgi.c 2005-03-04 12:23:35 -08:00 >@@ -131,7 +131,7 @@ > return 0; > } > >-static int sgi_xfer(struct i2c_adapter *i2c_adap, struct i2c_msg msgs[], >+static int sgi_xfer(struct i2c_adapter *i2c_adap, struct i2c_msg *msgs, > int num) > { > struct i2c_algo_sgi_data *adap = i2c_adap->algo_data; >diff -Nru a/drivers/i2c/busses/i2c-au1550.c b/drivers/i2c/busses/i2c-au1550.c >--- a/drivers/i2c/busses/i2c-au1550.c 2005-03-04 12:23:35 -08:00 >+++ b/drivers/i2c/busses/i2c-au1550.c 2005-03-04 12:23:35 -08:00 >@@ -253,7 +253,7 @@ > } > > static int >-au1550_xfer(struct i2c_adapter *i2c_adap, struct i2c_msg msgs[], int num) >+au1550_xfer(struct i2c_adapter *i2c_adap, struct i2c_msg *msgs, int num) > { > struct i2c_au1550_data *adap = i2c_adap->algo_data; > struct i2c_msg *p; >diff -Nru a/drivers/i2c/busses/i2c-ibm_iic.c b/drivers/i2c/busses/i2c-ibm_iic.c >--- a/drivers/i2c/busses/i2c-ibm_iic.c 2005-03-04 12:23:35 -08:00 >+++ b/drivers/i2c/busses/i2c-ibm_iic.c 2005-03-04 12:23:35 -08:00 >@@ -549,7 +549,7 @@ > * Generic master transfer entrypoint. > * Returns the number of processed messages or error (<0) > */ >-static int iic_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[], int num) >+static int iic_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num) > { > struct ibm_iic_private* dev = (struct ibm_iic_private*)(i2c_get_adapdata(adap)); > volatile struct iic_regs __iomem *iic = dev->vaddr; >diff -Nru a/drivers/i2c/busses/i2c-iop3xx.c b/drivers/i2c/busses/i2c-iop3xx.c >--- a/drivers/i2c/busses/i2c-iop3xx.c 2005-03-04 12:23:35 -08:00 >+++ b/drivers/i2c/busses/i2c-iop3xx.c 2005-03-04 12:23:35 -08:00 >@@ -361,7 +361,7 @@ > * master_xfer() - main read/write entry > */ > static int >-iop3xx_i2c_master_xfer(struct i2c_adapter *i2c_adap, struct i2c_msg msgs[], >+iop3xx_i2c_master_xfer(struct i2c_adapter *i2c_adap, struct i2c_msg *msgs, > int num) > { > struct i2c_algo_iop3xx_data *iop3xx_adap = i2c_adap->algo_data; >diff -Nru a/drivers/i2c/busses/i2c-keywest.c b/drivers/i2c/busses/i2c-keywest.c >--- a/drivers/i2c/busses/i2c-keywest.c 2005-03-04 12:23:35 -08:00 >+++ b/drivers/i2c/busses/i2c-keywest.c 2005-03-04 12:23:35 -08:00 >@@ -399,7 +399,7 @@ > */ > static int > keywest_xfer( struct i2c_adapter *adap, >- struct i2c_msg msgs[], >+ struct i2c_msg *msgs, > int num) > { > struct keywest_chan* chan = i2c_get_adapdata(adap); >diff -Nru a/drivers/i2c/busses/i2c-mpc.c b/drivers/i2c/busses/i2c-mpc.c >--- a/drivers/i2c/busses/i2c-mpc.c 2005-03-04 12:23:35 -08:00 >+++ b/drivers/i2c/busses/i2c-mpc.c 2005-03-04 12:23:35 -08:00 >@@ -233,7 +233,7 @@ > return length; > } > >-static int mpc_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[], int num) >+static int mpc_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num) > { > struct i2c_msg *pmsg; > int i; >diff -Nru a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c-s3c2410.c >--- a/drivers/i2c/busses/i2c-s3c2410.c 2005-03-04 12:23:35 -08:00 >+++ b/drivers/i2c/busses/i2c-s3c2410.c 2005-03-04 12:23:35 -08:00 >@@ -483,7 +483,7 @@ > * this starts an i2c transfer > */ > >-static int s3c24xx_i2c_doxfer(struct s3c24xx_i2c *i2c, struct i2c_msg msgs[], int num) >+static int s3c24xx_i2c_doxfer(struct s3c24xx_i2c *i2c, struct i2c_msg *msgs, int num) > { > unsigned long timeout; > int ret; >@@ -534,7 +534,7 @@ > */ > > static int s3c24xx_i2c_xfer(struct i2c_adapter *adap, >- struct i2c_msg msgs[], int num) >+ struct i2c_msg *msgs, int num) > { > struct s3c24xx_i2c *i2c = (struct s3c24xx_i2c *)adap->algo_data; > int retry; >diff -Nru a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c >--- a/drivers/i2c/i2c-core.c 2005-03-04 12:23:35 -08:00 >+++ b/drivers/i2c/i2c-core.c 2005-03-04 12:23:35 -08:00 >@@ -582,7 +582,7 @@ > * ---------------------------------------------------- > */ > >-int i2c_transfer(struct i2c_adapter * adap, struct i2c_msg msgs[],int num) >+int i2c_transfer(struct i2c_adapter * adap, struct i2c_msg *msgs, int num) > { > int ret; > >diff -Nru a/drivers/media/common/saa7146_i2c.c b/drivers/media/common/saa7146_i2c.c >--- a/drivers/media/common/saa7146_i2c.c 2005-03-04 12:23:35 -08:00 >+++ b/drivers/media/common/saa7146_i2c.c 2005-03-04 12:23:35 -08:00 >@@ -25,7 +25,7 @@ > sent through the saa7146. have a look at the specifications p. 122 ff > to understand this. it returns the number of u32s to send, or -1 > in case of an error. */ >-static int saa7146_i2c_msg_prepare(const struct i2c_msg m[], int num, u32 *op) >+static int saa7146_i2c_msg_prepare(const struct i2c_msg *m, int num, u32 *op) > { > int h1, h2; > int i, j, addr; >@@ -89,7 +89,7 @@ > which bytes were read through the adapter and write them back to the corresponding > i2c-message. but instead, we simply write back all bytes. > fixme: this could be improved. */ >-static int saa7146_i2c_msg_cleanup(const struct i2c_msg m[], int num, u32 *op) >+static int saa7146_i2c_msg_cleanup(const struct i2c_msg *m, int num, u32 *op) > { > int i, j; > int op_count = 0; >@@ -272,7 +272,7 @@ > return 0; > } > >-int saa7146_i2c_transfer(struct saa7146_dev *dev, const struct i2c_msg msgs[], int num, int retries) >+int saa7146_i2c_transfer(struct saa7146_dev *dev, const struct i2c_msg *msgs, int num, int retries) > { > int i = 0, count = 0; > u32* buffer = dev->d_i2c.cpu_addr; >@@ -372,7 +372,7 @@ > } > > /* utility functions */ >-static int saa7146_i2c_xfer(struct i2c_adapter* adapter, struct i2c_msg msg[], int num) >+static int saa7146_i2c_xfer(struct i2c_adapter* adapter, struct i2c_msg *msg, int num) > { > struct saa7146_dev* dev = i2c_get_adapdata(adapter); > >diff -Nru a/drivers/media/dvb/b2c2/skystar2.c b/drivers/media/dvb/b2c2/skystar2.c >--- a/drivers/media/dvb/b2c2/skystar2.c 2005-03-04 12:23:35 -08:00 >+++ b/drivers/media/dvb/b2c2/skystar2.c 2005-03-04 12:23:35 -08:00 >@@ -293,7 +293,7 @@ > return buf - start; > } > >-static int master_xfer(struct i2c_adapter* adapter, struct i2c_msg msgs[], int num) >+static int master_xfer(struct i2c_adapter* adapter, struct i2c_msg *msgs, int num) > { > struct adapter *tmp = i2c_get_adapdata(adapter); > int i, ret = 0; >diff -Nru a/drivers/media/dvb/dibusb/dvb-dibusb-fe-i2c.c b/drivers/media/dvb/dibusb/dvb-dibusb-fe-i2c.c >--- a/drivers/media/dvb/dibusb/dvb-dibusb-fe-i2c.c 2005-03-04 12:23:35 -08:00 >+++ b/drivers/media/dvb/dibusb/dvb-dibusb-fe-i2c.c 2005-03-04 12:23:35 -08:00 >@@ -38,7 +38,7 @@ > /* > * I2C master xfer function > */ >-static int dibusb_i2c_xfer(struct i2c_adapter *adap,struct i2c_msg msg[],int num) >+static int dibusb_i2c_xfer(struct i2c_adapter *adap,struct i2c_msg *msg,int num) > { > struct usb_dibusb *dib = i2c_get_adapdata(adap); > int i; >diff -Nru a/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c b/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c >--- a/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c 2005-03-04 12:23:35 -08:00 >+++ b/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c 2005-03-04 12:23:35 -08:00 >@@ -252,7 +252,7 @@ > return rcv_len; > } > >-static int master_xfer(struct i2c_adapter* adapter, struct i2c_msg msg[], int num) >+static int master_xfer(struct i2c_adapter* adapter, struct i2c_msg *msg, int num) > { > struct ttusb *ttusb = i2c_get_adapdata(adapter); > int i = 0; >diff -Nru a/drivers/media/video/bttv-i2c.c b/drivers/media/video/bttv-i2c.c >--- a/drivers/media/video/bttv-i2c.c 2005-03-04 12:23:35 -08:00 >+++ b/drivers/media/video/bttv-i2c.c 2005-03-04 12:23:35 -08:00 >@@ -245,7 +245,7 @@ > return retval; > } > >-static int bttv_i2c_xfer(struct i2c_adapter *i2c_adap, struct i2c_msg msgs[], int num) >+static int bttv_i2c_xfer(struct i2c_adapter *i2c_adap, struct i2c_msg *msgs, int num) > { > struct bttv *btv = i2c_get_adapdata(i2c_adap); > int retval = 0; >diff -Nru a/drivers/media/video/saa7134/saa7134-i2c.c b/drivers/media/video/saa7134/saa7134-i2c.c >--- a/drivers/media/video/saa7134/saa7134-i2c.c 2005-03-04 12:23:35 -08:00 >+++ b/drivers/media/video/saa7134/saa7134-i2c.c 2005-03-04 12:23:35 -08:00 >@@ -236,7 +236,7 @@ > } > > static int saa7134_i2c_xfer(struct i2c_adapter *i2c_adap, >- struct i2c_msg msgs[], int num) >+ struct i2c_msg *msgs, int num) > { > struct saa7134_dev *dev = i2c_adap->algo_data; > enum i2c_status status; >diff -Nru a/include/linux/i2c.h b/include/linux/i2c.h >--- a/include/linux/i2c.h 2005-03-04 12:23:35 -08:00 >+++ b/include/linux/i2c.h 2005-03-04 12:23:35 -08:00 >@@ -55,7 +55,7 @@ > > /* Transfer num messages. > */ >-extern int i2c_transfer(struct i2c_adapter *adap, struct i2c_msg msg[],int num); >+extern int i2c_transfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num); > > /* > * Some adapter types (i.e. PCF 8584 based ones) may support slave behaviuor. >@@ -191,7 +191,7 @@ > to NULL. If an adapter algorithm can do SMBus access, set > smbus_xfer. If set to NULL, the SMBus protocol is simulated > using common I2C messages */ >- int (*master_xfer)(struct i2c_adapter *adap,struct i2c_msg msgs[], >+ int (*master_xfer)(struct i2c_adapter *adap,struct i2c_msg *msgs, > int num); > int (*smbus_xfer) (struct i2c_adapter *adap, u16 addr, > unsigned short flags, char read_write, >diff -Nru a/include/media/saa7146.h b/include/media/saa7146.h >--- a/include/media/saa7146.h 2005-03-04 12:23:35 -08:00 >+++ b/include/media/saa7146.h 2005-03-04 12:23:35 -08:00 >@@ -157,7 +157,7 @@ > > /* from saa7146_i2c.c */ > int saa7146_i2c_adapter_prepare(struct saa7146_dev *dev, struct i2c_adapter *i2c_adapter, u32 bitrate); >-int saa7146_i2c_transfer(struct saa7146_dev *saa, const struct i2c_msg msgs[], int num, int retries); >+int saa7146_i2c_transfer(struct saa7146_dev *saa, const struct *i2c_msg msgs, int num, int retries); > > /* from saa7146_core.c */ > extern struct list_head saa7146_devices; > > > > Greg, I was just scanning this email and it looks like you possibly grabbed the first of my patches with a typo because this last little bit I corrected in a prior email to you. It got into the *mm* tree ok. So I'm not sure where this took a wrong turn again. Its the very last bit of the above patch on saa7146.h, where I'd at first mistakenly managed to change struct i2c_msg msgs[] to struct *i2c_msg msgs, when it should have been changed to struct i2c_msg *msgs as below. (Its just a cut and paste below, so it might be easier if you just typed it into whatever version you've got now. If its left uncorrected it'd give some sort of compiler error (to say the least). Thanks very much, Mick --- diff -Nru a/include/media/saa7146.h b/include/media/saa7146.h --- a/include/media/saa7146.h 2005-03-04 12:23:35 -08:00 +++ b/include/media/saa7146.h 2005-03-04 12:23:35 -08:00 @@ -157,7 +157,7 @@ /* from saa7146_i2c.c */ int saa7146_i2c_adapter_prepare(struct saa7146_dev *dev, struct i2c_adapter *i2c_adapter, u32 bitrate); -int saa7146_i2c_transfer(struct saa7146_dev *saa, const struct i2c_msg msgs[], int num, int retries); +int saa7146_i2c_transfer(struct saa7146_dev *saa, const struct i2c_msg *msgs, int num, int retries); /* from saa7146_core.c */ extern struct list_head saa7146_devices; PS: I'm headed out of town for a week, and the above is only a cut&paste, so the correct patch is attached here once more. [-- Attachment #2: i2c_xfer.patch --] [-- Type: text/plain, Size: 10959 bytes --] --- ./include/linux/i2c.h.sav 2005-02-23 10:35:36.000000000 -0800 +++ ./include/linux/i2c.h 2005-02-23 10:46:23.000000000 -0800 @@ -55,7 +55,7 @@ /* Transfer num messages. */ -extern int i2c_transfer(struct i2c_adapter *adap, struct i2c_msg msg[],int num); +extern int i2c_transfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num); /* * Some adapter types (i.e. PCF 8584 based ones) may support slave behaviuor. @@ -194,7 +194,7 @@ to NULL. If an adapter algorithm can do SMBus access, set smbus_xfer. If set to NULL, the SMBus protocol is simulated using common I2C messages */ - int (*master_xfer)(struct i2c_adapter *adap,struct i2c_msg msgs[], + int (*master_xfer)(struct i2c_adapter *adap,struct i2c_msg *msgs, int num); int (*smbus_xfer) (struct i2c_adapter *adap, u16 addr, unsigned short flags, char read_write, --- ./drivers/i2c/busses/i2c-iop3xx.c.sav 2005-02-23 10:36:21.000000000 -0800 +++ ./drivers/i2c/busses/i2c-iop3xx.c 2005-02-23 10:47:36.000000000 -0800 @@ -361,7 +361,7 @@ * master_xfer() - main read/write entry */ static int -iop3xx_i2c_master_xfer(struct i2c_adapter *i2c_adap, struct i2c_msg msgs[], +iop3xx_i2c_master_xfer(struct i2c_adapter *i2c_adap, struct i2c_msg *msgs, int num) { struct i2c_algo_iop3xx_data *iop3xx_adap = i2c_adap->algo_data; --- ./drivers/i2c/i2c-core.c.sav 2005-02-23 10:34:59.000000000 -0800 +++ ./drivers/i2c/i2c-core.c 2005-02-23 10:49:18.000000000 -0800 @@ -583,7 +583,7 @@ * ---------------------------------------------------- */ -int i2c_transfer(struct i2c_adapter * adap, struct i2c_msg msgs[],int num) +int i2c_transfer(struct i2c_adapter * adap, struct i2c_msg *msgs, int num) { int ret; --- ./drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c.sav 2005-02-23 10:39:53.000000000 -0800 +++ ./drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c 2005-02-23 10:50:07.000000000 -0800 @@ -252,7 +252,7 @@ return rcv_len; } -static int master_xfer(struct i2c_adapter* adapter, struct i2c_msg msg[], int num) +static int master_xfer(struct i2c_adapter* adapter, struct i2c_msg *msg, int num) { struct ttusb *ttusb = i2c_get_adapdata(adapter); int i = 0; --- ./drivers/media/dvb/b2c2/skystar2.c.sav 2005-02-23 10:40:33.000000000 -0800 +++ ./drivers/media/dvb/b2c2/skystar2.c 2005-02-23 10:50:42.000000000 -0800 @@ -293,7 +293,7 @@ return buf - start; } -static int master_xfer(struct i2c_adapter* adapter, struct i2c_msg msgs[], int num) +static int master_xfer(struct i2c_adapter* adapter, struct i2c_msg *msgs, int num) { struct adapter *tmp = i2c_get_adapdata(adapter); int i, ret = 0; --- ./Documentation/i2c/writing-clients.sav 2005-02-23 10:42:00.000000000 -0800 +++ ./Documentation/i2c/writing-clients 2005-02-23 10:42:30.000000000 -0800 @@ -642,7 +642,7 @@ parameter contains the bytes the read/write, the third the length of the buffer. Returned is the actual number of bytes read/written. - extern int i2c_transfer(struct i2c_adapter *adap, struct i2c_msg msg[], + extern int i2c_transfer(struct i2c_adapter *adap, struct i2c_msg *msg, int num); This sends a series of messages. Each message can be a read or write, --- ./include/media/saa7146.h.sav 2005-02-23 12:01:51.000000000 -0800 +++ ./include/media/saa7146.h 2005-02-23 12:19:38.000000000 -0800 @@ -157,7 +157,7 @@ /* from saa7146_i2c.c */ int saa7146_i2c_adapter_prepare(struct saa7146_dev *dev, struct i2c_adapter *i2c_adapter, u32 bitrate); -int saa7146_i2c_transfer(struct saa7146_dev *saa, const struct i2c_msg msgs[], int num, int retries); +int saa7146_i2c_transfer(struct saa7146_dev *saa, const struct i2c_msg *msgs, int num, int retries); /* from saa7146_core.c */ extern struct list_head saa7146_devices; --- ./drivers/i2c/busses/i2c-s3c2410.c.sav 2005-02-23 12:03:29.000000000 -0800 +++ ./drivers/i2c/busses/i2c-s3c2410.c 2005-02-23 12:20:31.000000000 -0800 @@ -483,7 +483,7 @@ * this starts an i2c transfer */ -static int s3c24xx_i2c_doxfer(struct s3c24xx_i2c *i2c, struct i2c_msg msgs[], int num) +static int s3c24xx_i2c_doxfer(struct s3c24xx_i2c *i2c, struct i2c_msg *msgs, int num) { unsigned long timeout; int ret; @@ -534,7 +534,7 @@ */ static int s3c24xx_i2c_xfer(struct i2c_adapter *adap, - struct i2c_msg msgs[], int num) + struct i2c_msg *msgs, int num) { struct s3c24xx_i2c *i2c = (struct s3c24xx_i2c *)adap->algo_data; int retry; --- ./drivers/i2c/busses/i2c-mpc.c.sav 2005-02-23 12:04:11.000000000 -0800 +++ ./drivers/i2c/busses/i2c-mpc.c 2005-02-23 12:17:28.000000000 -0800 @@ -233,7 +233,7 @@ return length; } -static int mpc_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[], int num) +static int mpc_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num) { struct i2c_msg *pmsg; int i; --- ./drivers/i2c/busses/i2c-ibm_iic.c.sav 2005-02-23 12:04:42.000000000 -0800 +++ ./drivers/i2c/busses/i2c-ibm_iic.c 2005-02-23 12:21:08.000000000 -0800 @@ -549,7 +549,7 @@ * Generic master transfer entrypoint. * Returns the number of processed messages or error (<0) */ -static int iic_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[], int num) +static int iic_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num) { struct ibm_iic_private* dev = (struct ibm_iic_private*)(i2c_get_adapdata(adap)); volatile struct iic_regs __iomem *iic = dev->vaddr; --- ./drivers/i2c/busses/i2c-keywest.c.sav 2005-02-23 12:05:10.000000000 -0800 +++ ./drivers/i2c/busses/i2c-keywest.c 2005-02-23 12:26:47.000000000 -0800 @@ -399,7 +399,7 @@ */ static int keywest_xfer( struct i2c_adapter *adap, - struct i2c_msg msgs[], + struct i2c_msg *msgs, int num) { struct keywest_chan* chan = i2c_get_adapdata(adap); --- ./drivers/i2c/busses/i2c-au1550.c.sav 2005-02-23 12:06:00.000000000 -0800 +++ ./drivers/i2c/busses/i2c-au1550.c 2005-02-23 12:27:39.000000000 -0800 @@ -253,7 +253,7 @@ } static int -au1550_xfer(struct i2c_adapter *i2c_adap, struct i2c_msg msgs[], int num) +au1550_xfer(struct i2c_adapter *i2c_adap, struct i2c_msg *msgs, int num) { struct i2c_au1550_data *adap = i2c_adap->algo_data; struct i2c_msg *p; --- ./drivers/i2c/algos/i2c-algo-pca.c.sav 2005-02-23 12:06:21.000000000 -0800 +++ ./drivers/i2c/algos/i2c-algo-pca.c 2005-02-23 12:28:09.000000000 -0800 @@ -178,7 +178,7 @@ } static int pca_xfer(struct i2c_adapter *i2c_adap, - struct i2c_msg msgs[], + struct i2c_msg *msgs, int num) { struct i2c_algo_pca_data *adap = i2c_adap->algo_data; --- ./drivers/i2c/algos/i2c-algo-pcf.c.sav 2005-02-23 12:07:04.000000000 -0800 +++ ./drivers/i2c/algos/i2c-algo-pcf.c 2005-02-23 12:28:49.000000000 -0800 @@ -332,7 +332,7 @@ } static int pcf_xfer(struct i2c_adapter *i2c_adap, - struct i2c_msg msgs[], + struct i2c_msg *msgs, int num) { struct i2c_algo_pcf_data *adap = i2c_adap->algo_data; --- ./drivers/i2c/algos/i2c-algo-ite.c.sav 2005-02-23 12:07:17.000000000 -0800 +++ ./drivers/i2c/algos/i2c-algo-ite.c 2005-02-23 12:29:31.000000000 -0800 @@ -490,7 +490,7 @@ * condition. */ #if 0 -static int iic_combined_transaction(struct i2c_adapter *i2c_adap, struct i2c_msg msgs[], int num) +static int iic_combined_transaction(struct i2c_adapter *i2c_adap, struct i2c_msg *msgs, int num) { int i; struct i2c_msg *pmsg; @@ -600,7 +600,7 @@ * verify that the bus is not busy or in some unknown state. */ static int iic_xfer(struct i2c_adapter *i2c_adap, - struct i2c_msg msgs[], + struct i2c_msg *msgs, int num) { struct i2c_algo_iic_data *adap = i2c_adap->algo_data; --- ./drivers/i2c/algos/i2c-algo-sgi.c.sav 2005-02-23 12:07:40.000000000 -0800 +++ ./drivers/i2c/algos/i2c-algo-sgi.c 2005-02-23 12:29:58.000000000 -0800 @@ -131,7 +131,7 @@ return 0; } -static int sgi_xfer(struct i2c_adapter *i2c_adap, struct i2c_msg msgs[], +static int sgi_xfer(struct i2c_adapter *i2c_adap, struct i2c_msg *msgs, int num) { struct i2c_algo_sgi_data *adap = i2c_adap->algo_data; --- ./drivers/media/video/saa7134/saa7134-i2c.c.sav 2005-02-23 12:08:12.000000000 -0800 +++ ./drivers/media/video/saa7134/saa7134-i2c.c 2005-02-23 12:30:20.000000000 -0800 @@ -236,7 +236,7 @@ } static int saa7134_i2c_xfer(struct i2c_adapter *i2c_adap, - struct i2c_msg msgs[], int num) + struct i2c_msg *msgs, int num) { struct saa7134_dev *dev = i2c_adap->algo_data; enum i2c_status status; --- ./drivers/media/video/bttv-i2c.c.sav 2005-02-23 12:08:29.000000000 -0800 +++ ./drivers/media/video/bttv-i2c.c 2005-02-23 12:30:56.000000000 -0800 @@ -245,7 +245,7 @@ return retval; } -static int bttv_i2c_xfer(struct i2c_adapter *i2c_adap, struct i2c_msg msgs[], int num) +static int bttv_i2c_xfer(struct i2c_adapter *i2c_adap, struct i2c_msg *msgs, int num) { struct bttv *btv = i2c_get_adapdata(i2c_adap); int retval = 0; --- ./drivers/media/dvb/dibusb/dvb-dibusb-fe-i2c.c.sav 2005-02-23 12:09:43.000000000 -0800 +++ ./drivers/media/dvb/dibusb/dvb-dibusb-fe-i2c.c 2005-02-23 12:31:38.000000000 -0800 @@ -38,7 +38,7 @@ /* * I2C master xfer function */ -static int dibusb_i2c_xfer(struct i2c_adapter *adap,struct i2c_msg msg[],int num) +static int dibusb_i2c_xfer(struct i2c_adapter *adap,struct i2c_msg *msg,int num) { struct usb_dibusb *dib = i2c_get_adapdata(adap); int i; --- ./drivers/media/common/saa7146_i2c.c.sav 2005-02-23 12:10:06.000000000 -0800 +++ ./drivers/media/common/saa7146_i2c.c 2005-02-23 12:32:45.000000000 -0800 @@ -25,7 +25,7 @@ sent through the saa7146. have a look at the specifications p. 122 ff to understand this. it returns the number of u32s to send, or -1 in case of an error. */ -static int saa7146_i2c_msg_prepare(const struct i2c_msg m[], int num, u32 *op) +static int saa7146_i2c_msg_prepare(const struct i2c_msg *m, int num, u32 *op) { int h1, h2; int i, j, addr; @@ -89,7 +89,7 @@ which bytes were read through the adapter and write them back to the corresponding i2c-message. but instead, we simply write back all bytes. fixme: this could be improved. */ -static int saa7146_i2c_msg_cleanup(const struct i2c_msg m[], int num, u32 *op) +static int saa7146_i2c_msg_cleanup(const struct i2c_msg *m, int num, u32 *op) { int i, j; int op_count = 0; @@ -272,7 +272,7 @@ return 0; } -int saa7146_i2c_transfer(struct saa7146_dev *dev, const struct i2c_msg msgs[], int num, int retries) +int saa7146_i2c_transfer(struct saa7146_dev *dev, const struct i2c_msg *msgs, int num, int retries) { int i = 0, count = 0; u32* buffer = dev->d_i2c.cpu_addr; @@ -372,7 +372,7 @@ } /* utility functions */ -static int saa7146_i2c_xfer(struct i2c_adapter* adapter, struct i2c_msg msg[], int num) +static int saa7146_i2c_xfer(struct i2c_adapter* adapter, struct i2c_msg *msg, int num) { struct saa7146_dev* dev = i2c_get_adapdata(adapter); ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] I2C: Fix some gcc 4.0 compile failures and warnings 2005-03-04 22:55 ` Mickey Stein @ 2005-03-04 23:02 ` Greg KH 0 siblings, 0 replies; 7+ messages in thread From: Greg KH @ 2005-03-04 23:02 UTC (permalink / raw) To: Mickey Stein; +Cc: linux-kernel, sensors On Fri, Mar 04, 2005 at 02:55:11PM -0800, Mickey Stein wrote: > I was just scanning this email and it looks like you possibly grabbed > the first of my patches with a typo because this last little bit I > corrected in a prior email to you. It got into the *mm* tree ok. > So I'm not sure where this took a wrong turn again. You missed the follow-on patch that fixed this up :) thanks, greg k-h ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2005-03-05 0:36 UTC | newest] Thread overview: 7+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2005-02-23 22:12 [PATCH] [i2c]: Fix some gcc 4.0 compile failures and warnings Mickey Stein 2005-02-23 22:57 ` linux-os 2005-02-23 23:17 ` Greg KH 2005-02-25 20:07 ` Greg KH -- strict thread matches above, loose matches on Subject: below -- 2005-03-04 20:36 [PATCH] I2C: Make i2c list terminators explicitely unsigned Greg KH 2005-03-04 20:36 ` [PATCH] I2C: Fix some gcc 4.0 compile failures and warnings Greg KH 2005-03-04 22:55 ` Mickey Stein 2005-03-04 23:02 ` Greg KH
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox