Re: [PATCH 03/10] fdisk: API: add fdisk_label_change

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

 



On Tue, Jul 24, 2012 at 12:39:07PM +0200, Davidlohr Bueso wrote:
> > >> Shouldn't we use something else than hardcoded "sun"|"dos"|"sgi"|...
> > >> strings here? 
> > > 
> > > What's the problem with these strings? I think these are well
> > > recognized with clear meaning. What alternative do you propose?
> > 
> > Sorry, I should've proposed this already in my first mail:
> > 
> > -	fdisk_label_change(cxt, "sun");
> > +	fdisk_label_change(cxt, sun_label.name);
 
Ah, right. Deduplicating the strings makes sense, IMO.

> I'm planning on adding the disklabel type (numeric) to the context
> structure in a near future, so we'd then have two ways of identifying
> labels. I really do not see much difference between numbers and strings
> - this is not a performance critical program.

The concern here is not speed, but maintainability ;)

Best,

Petr

-- 
Petr Uzel
IRC: ptr_uzl @ freenode

Attachment: pgpQ77CftI60Q.pgp
Description: PGP signature


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux