Re: [PATCH 2/4] block: lift bio_is_zone_append to bio.h

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

 



On Fri, Nov 01, 2024 at 02:37:29PM +0900, Damien Le Moal wrote:
> > +static inline bool bio_is_zone_append(struct bio *bio)
> > +{
> > +	if (!IS_ENABLED(CONFIG_BLK_DEV_ZONED))
> > +		return false;
> 
> Nit: this "if" is probably not needed. But it does not hurt either. Since we
> should never be seeing this function being called for the
> !IS_ENABLED(CONFIG_BLK_DEV_ZONED) case, should we add a WARN_ON_ONCE() ?

The point of the IS_ENALBED is to optimize away the code when it can't
be used.  The WARN_ON_ONCE would generate worse code than just leaving
the check in.





[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