Re: [PATCH 3/3] block: warn if ->groups is set when calling add_disk

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

 



On Mon, Sep 20, 2021 at 04:50:03PM -0700, Dan Williams wrote:
> >
> >         ddev->parent = parent;
> > -       ddev->groups = groups;
> > +       if (!WARN_ON_ONCE(ddev->groups))
> > +               ddev->groups = groups;
> 
> That feels too compact to me, and dev_WARN_ONCE() might save someone a
> git blame to look up the reason for the warning:
> 
>     dev_WARN_ONCE(parent, ddev->groups, "unexpected pre-populated
> attribute group\n");
>     if (!ddev->groups)
>         ddev->groups = groups;
> 
> ...but not a deal breaker. Either way you can add:
> 

I'd rather keep it simple and optmize for the normal case..



[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux