Hello Linus,
Cleanup of i2c-core, i2c-proc and i2c-dev to use new module_init and module_exit
functions. Cleanup of old compatability statements.
Albert
--
[email protected]
Albert Cranford wrote:
> /**** debug level */
> -static int i2c_debug=1;
> +static int i2c_debug=0;
don't need "=0", that wastes space in initialized data section
> @@ -658,18 +624,19 @@
> struct i2c_client *client;
> int i,j,k,order_nr,len=0,len_total;
> int order[I2C_CLIENT_MAX];
> +#define OUTPUT_LENGTH_PER_LINE 70
>
> - if (count > 4096)
> - return -EINVAL;
> len_total = file->f_pos + count;
> - /* Too bad if this gets longer (unlikely) */
> - if (len_total > 4096)
> - len_total = 4096;
> + if (len_total > (I2C_CLIENT_MAX * OUTPUT_LENGTH_PER_LINE) )
> + /* adjust to maximum file size */
> + len_total = (I2C_CLIENT_MAX * OUTPUT_LENGTH_PER_LINE);
> for (i = 0; i < I2C_ADAP_MAX; i++)
> if (adapters[i]->inode == inode->i_ino) {
> /* We need a bit of slack in the kernel buffer; this makes the
> sprintf safe. */
> - if (! (kbuf = kmalloc(count + 80,GFP_KERNEL)))
> + if (! (kbuf = kmalloc(len_total +
> + OUTPUT_LENGTH_PER_LINE,
> + GFP_KERNEL)))
> return -ENOMEM;
> /* Order will hold the indexes of the clients
this really wants to be converted to seq_printf API...
otherwise, looks ok