Re: [PATCH 3/6] block: check if page is mergeable in one helper

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

 



On Mon, Mar 11, 2019 at 03:23:56PM +0100, Christoph Hellwig wrote:
> > +static inline bool
> > +page_is_mergeable(const struct bio_vec *bv, struct page *page,
> > +		unsigned int len, unsigned int off, bool same_page)
> 
> Please follow the other function declarations in this file:
> 
> static inline bool page_is_mergeable(const struct bio_vec *bv,
> 		struct page *page, unsigned int len, unsigned int off,
> 		bool same_page)

OK.

> 
> > +	if (same_page && (vec_end_addr & PAGE_MASK) != page_addr)
> > +		return false;
> 
> No need for the inner braces here.

I think it is needed, given "!=" has higher precedence thank "&", see

	https://en.cppreference.com/w/c/language/operator_precedence

Also the line is more readable with inner braces.

Thanks,
Ming



[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