Re: [PATCH #upstream-fixes] libata: Add transport class for libata

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Matthew Wilcox wrote:
> I think a more important question is ... this is coming from a Google
> address, but has a Copyright Dell on it.  Where's the sign-off chain for
> this?  Who's the author really?

Indeed, this needs to be clarified.

>> Gwendal Grignou wrote:
>>> +#define SETUP_TEMPLATE(attrb, field, perm, test)			\
>>> +	i->private_##attrb[count] = dev_attr_##field;		       	\
>>> +	i->private_##attrb[count].attr.mode = perm;			\
>>> +	i->attrb[count] = &i->private_##attrb[count];			\
>>> +	if (test)							\
>>> +		count++
...
>>> +#define SETUP_PORT_ATTRIBUTE(field)					\
>>> +	SETUP_TEMPLATE(port_attrs, field, S_IRUGO, 1)
...
>>> +	count = 0;
>>> +	SETUP_PORT_ATTRIBUTE(nr_pmp_links);
>>> +	SETUP_PORT_ATTRIBUTE(idle_irq);
>>> +	BUG_ON(count > ATA_PORT_ATTRS);
>>> +	i->port_attrs[count] = NULL;

I understand that such preprocessor games are hard to avoid in code like
sysfs attribute setup.  I have nothing better to suggest, but they are
ugly nevertheless, and may amount to bloat.

Anyway; the BUG_ON there should probably be a BUILD_BUG_ON.
-- 
Stefan Richter
-=====-==--- =--- =--==
http://arcgraph.de/sr/
--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Filesystems]     [Linux SCSI]     [Linux RAID]     [Git]     [Kernel Newbies]     [Linux Newbie]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Samba]     [Device Mapper]

  Powered by Linux