lists.openwall.net | lists / announce owl-users owl-dev john-users john-dev passwdqc-users yescrypt popa3d-users / oss-security kernel-hardening musl sabotage tlsify passwords / crypt-dev xvendor / Bugtraq Full-Disclosure linux-kernel linux-netdev linux-ext4 linux-hardening linux-cve-announce PHC | |
Open Source and information security mailing list archives
| ||
|
Date: Fri, 4 Mar 2016 14:53:49 +0800 From: Baolin Wang <baolin.wang@...aro.org> To: Robert Jarzmik <robert.jarzmik@...e.fr> Cc: Herbert Xu <herbert@...dor.apana.org.au>, David Miller <davem@...emloft.net>, Alasdair G Kergon <agk@...hat.com>, Mike Snitzer <snitzer@...hat.com>, axboe@...com, dm-devel@...hat.com, akpm@...ux-foundation.org, david.s.gordon@...el.com, Tom Lendacky <thomas.lendacky@....com>, Masahiro Yamada <yamada.masahiro@...ionext.com>, smueller@...onox.de, tadeusz.struk@...el.com, Masanari Iida <standby24x7@...il.com>, shli@...nel.org, Mark Brown <broonie@...nel.org>, Linus Walleij <linus.walleij@...aro.org>, Arnd Bergmann <arnd@...db.de>, LKML <linux-kernel@...r.kernel.org>, linux-crypto@...r.kernel.org, linux-raid@...r.kernel.org Subject: Re: [PATCH 1/4] scatterlist: Introduce some helper functions >>> + **/ >>> +static inline bool sg_is_contiguous(struct scatterlist *sga, >>> + struct scatterlist *sgb) >>> +{ >>> + return ((sga->page_link & ~0x3UL) + sga->offset + sga->length == >>> + (sgb->page_link & ~0x3UL)); >>> +} >> I don't understand that one. >> sga->page_link is a pointer to a "struct page *". How can it be added to an >> offset within a page ??? > > > Ah, sorry that's a mistake. It should check as below: > static inline bool sg_is_contiguous(struct scatterlist *sga, struct > scatterlist *sgb) > { > return (unsigned int)sg_virt(sga) + sga->length == (unsigned > int)sg_virt(sgb); > } sorry, it should be: static inline bool sg_is_contiguous(struct scatterlist *sga, struct scatterlist *sgb) { return (unsigned long)sg_virt(sga) + sga->length == (unsigned long)sg_virt(sgb); } -- Baolin.wang Best Regards
Powered by blists - more mailing lists