[PATCH 02/14] Revert "powerpc/powernv: remove the unused vas_win_paste_addr and vas_win_id functions"

Christoph Hellwig hch at infradead.org
Wed Nov 27 19:28:10 AEDT 2019


On Tue, Nov 26, 2019 at 05:03:27PM -0800, Haren Myneni wrote:
> 
> This reverts commit 452d23c0f6bd97f2fd8a9691fee79b76040a0feb.
> 
> User space send windows (NX GZIP compression) need vas_win_paste_addr()
> to mmap window paste address and vas_win_id() to get window ID when
> window address is given.

Even with your full series applied vas_win_paste_addr is entirely
unused, and vas_win_id is only used once in the same file it is defined.

So instead of this patch you should just open code vas_win_id in
init_winctx_for_txwin.

> +static inline u32 encode_pswid(int vasid, int winid)
> +{
> +	u32 pswid = 0;
> +
> +	pswid |= vasid << (31 - 7);
> +	pswid |= winid;
> +
> +	return pswid;

This can be simplified down to:

	return (u32)winid | (vasid << (31 - 7));


More information about the Linuxppc-dev mailing list