[lkml]   [2003]   [Nov]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] irda: fix type of struct irda_ias_set.attribute.irda_attrib_string.len
On Mon, Nov 10, 2003 at 06:59:59PM -0800, Linus Torvalds wrote:
> On Tue, 11 Nov 2003, Arnaldo Carvalho de Melo wrote:
> >
> > Ok, ias_opt->attribute.irda_attrib_string.len is __u8, but
> > IAS_MAX_STRING = 256... so attribute.irda_attrib_string.len has to be at least
> > __u18, this patch fix this, please see if it is appropriate and if it is so,
> > apply.
> No, please don't. This
> (a) changes ABI structures that are exported to user space

Yes ! You are 100% correct, changing this would break all the
IrDA user space, which I'm not keen on doing.

> (b) is unnecessary - since the problem is the _warning_, not the test.
> Just shut the warning up by either removing the test (replacing it with a
> comment about why it's unnecessary), or by adding a cast, ie
> unsigned int len = ias_opt->attribute.irda_attrib_string.len;
> if (len > IAS_MAX_STRING) {
> ...
> in case the code ever expects IAS_MAX_STRING to be shorter (or if the type
> is ever changed).

Yes, in this case the test should be removed with a comment.

> Linus

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:58    [W:0.055 / U:11.344 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site