From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: From: "Steve Wise" To: "'Sagi Grimberg'" , "'Logan Gunthorpe'" , "'Christoph Hellwig'" , "'James E.J. Bottomley'" , "'Martin K. Petersen'" , "'Jens Axboe'" , "'Stephen Bates'" , "'Max Gurtovoy'" , "'Dan Williams'" , "'Keith Busch'" , "'Jason Gunthorpe'" Cc: , , , , , References: <1490911959-5146-1-git-send-email-logang@deltatee.com> <1490911959-5146-3-git-send-email-logang@deltatee.com> In-Reply-To: Subject: RE: [RFC 2/8] cxgb4: setup pcie memory window 4 and create p2pmem region Date: Wed, 5 Apr 2017 10:41:45 -0500 Message-ID: <003001d2ae23$21e8f7d0$65bae770$@opengridcomputing.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org List-ID: > > > > +static void setup_memwin_p2pmem(struct adapter *adap) > > +{ > > + unsigned int mem_base = t4_read_reg(adap, > CIM_EXTMEM2_BASE_ADDR_A); > > + unsigned int mem_size = t4_read_reg(adap, > CIM_EXTMEM2_ADDR_SIZE_A); > > + > > + if (!use_p2pmem) > > + return; > > This is weird, why even call this if !use_p2pmem? > The use_p2pmem was added after the original change. I'll update as you suggest. > > +static int init_p2pmem(struct adapter *adapter) > > +{ > > + unsigned int mem_size = t4_read_reg(adapter, > CIM_EXTMEM2_ADDR_SIZE_A); > > + struct p2pmem_dev *p; > > + int rc; > > + struct resource res; > > + > > + if (!mem_size || !use_p2pmem) > > + return 0; > > Again, weird... Yup.