From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.8 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 31916C169C4 for ; Tue, 29 Jan 2019 18:13:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 04E5420857 for ; Tue, 29 Jan 2019 18:13:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="mYsuKXQr" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729328AbfA2SNh (ORCPT ); Tue, 29 Jan 2019 13:13:37 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:35196 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729297AbfA2SNf (ORCPT ); Tue, 29 Jan 2019 13:13:35 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From :Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=hxJVZs5E5cqhZZjBbmbtMAt19nHoSSZSpcr7hJeAg2Y=; b=mYsuKXQr79fxlJrSvGtCwDV8E1 dhxibgSIOMRegtyTswexxJhCjvzrpdbr9pREJTtsxREsqFB0bso2v33ZKyN8EldUZJ1t8d5Tlxc2Z XkRwTajyGgTRTxGK+07p+cBWoHz6puijpOCZsTNBCRvESHTwHg1T7M9z0cBkj4hx1Soa6s7VRkIJ1 gTsYRVFVjq24E6/2JlfGx7SwRwhf+pGHwog33lHkkv5quxzPXkJExomaTNcVOvK1dyP1Y13z5dFDR Yi8BTKlqkie173930ESkOi1DR3Usb7xWzvpDZSwrhExoaxcnJ6m1d7CzBtIMaWHap8SlNWMbfBBkS CX3d9NFQ==; Received: from 213-225-35-141.nat.highway.a1.net ([213.225.35.141] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1goXt8-00084P-9r; Tue, 29 Jan 2019 18:13:34 +0000 From: Christoph Hellwig To: "James E.J. Bottomley" , Helge Deller Cc: linux-parisc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 7/8] parisc/lba_pci: use container_of in LBA_DEV Date: Tue, 29 Jan 2019 19:13:09 +0100 Message-Id: <20190129181310.5557-8-hch@lst.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190129181310.5557-1-hch@lst.de> References: <20190129181310.5557-1-hch@lst.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use the type safe container_of macros instead of a blind cast in LBA_DEV, and turn the macro into an inline function. Signed-off-by: Christoph Hellwig --- drivers/parisc/lba_pci.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/parisc/lba_pci.c b/drivers/parisc/lba_pci.c index 63e9bc6d18de..065d88868402 100644 --- a/drivers/parisc/lba_pci.c +++ b/drivers/parisc/lba_pci.c @@ -111,12 +111,10 @@ static u32 lba_t32; #define LBA_SKIP_PROBE(d) ((d)->flags & LBA_FLAG_SKIP_PROBE) - -/* Looks nice and keeps the compiler happy */ -#define LBA_DEV(d) ({ \ - void *__pdata = d; \ - BUG_ON(!__pdata); \ - (struct lba_device *)__pdata; }) +static inline struct lba_device *LBA_DEV(struct pci_hba_data *hba) +{ + return container_of(hba, struct lba_device, hba); +} /* ** Only allow 8 subsidiary busses per LBA -- 2.20.1