From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932640AbdAKGuR (ORCPT ); Wed, 11 Jan 2017 01:50:17 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:55236 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753616AbdAKGuQ (ORCPT ); Wed, 11 Jan 2017 01:50:16 -0500 Date: Wed, 11 Jan 2017 07:50:36 +0100 From: Greg Kroah-Hartman To: Logan Gunthorpe Cc: Joe Perches , Jon Mason , Xiangliang Yu , Dave Jiang , Allen Hubbe , linux-ntb@googlegroups.com, linux-kernel Subject: Re: [PATCH 0/2] Style fixes: open code obfuscating macros Message-ID: <20170111065036.GA4111@kroah.com> References: <1483407036-20697-1-git-send-email-logang@deltatee.com> <20170110215527.GD13381@kudzu.us> <1484089612.12006.11.camel@perches.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.7.2 (2016-11-26) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 10, 2017 at 04:34:41PM -0700, Logan Gunthorpe wrote: > > > On 10/01/17 04:06 PM, Joe Perches wrote: > > It might also be better to add and use YA > > logging macro like ndev_dbg > > > > #define ndev_dvg(ndev, fmt, ...) \ > > dev_dbg(&(ndev)->ntb.pdev->dev, fmt, ##__VA_ARGS__) > > > > so that the new temporaries that are used just > > for debugging are not required. > > > > I feel like that's going in the exact opposite direction from what Greg > was looking for... I think the point is to hide less of where the device > is coming from, not to create a new and different macro that hides > things in a different way. > > Or, more likely, I _think_ Greg would suggest that this is showing that > the driver model isn't really being used properly. Perhaps, we should be > printing against the ntb struct device instead of the pci device so > there is no dereferencing. You should be printing against the ntb struct device, as that's the "correct" structure here, and not the PCI device at all, as that's too far up the device chain from what the driver is supposed to be doing. thanks, greg k-h