Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754543AbbL0NXc (ORCPT ); Sun, 27 Dec 2015 08:23:32 -0500 Received: from mail-yk0-f179.google.com ([209.85.160.179]:36643 "EHLO mail-yk0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751528AbbL0NXb (ORCPT ); Sun, 27 Dec 2015 08:23:31 -0500 MIME-Version: 1.0 In-Reply-To: <0801535a0c35424d2fd2e91f6ed58058d884e147.1451221174.git.geliangtang@163.com> References: <0801535a0c35424d2fd2e91f6ed58058d884e147.1451221174.git.geliangtang@163.com> Date: Sun, 27 Dec 2015 15:23:30 +0200 Message-ID: Subject: Re: [PATCH 06/10] net: hns: use to_platform_device() From: Andy Shevchenko To: Geliang Tang Cc: "David S. Miller" , Yisen Zhuang , yankejian , huangdaode , netdev , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1766 Lines: 46 On Sun, Dec 27, 2015 at 3:15 PM, Geliang Tang wrote: > Use to_platform_device() instead of open-coding it. > > Signed-off-by: Geliang Tang > --- > drivers/net/ethernet/hisilicon/hns/hns_dsaf_rcb.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_rcb.c b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_rcb.c > index 8c30cec..d2263c7 100644 > --- a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_rcb.c > +++ b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_rcb.c > @@ -499,8 +499,7 @@ void hns_rcb_get_cfg(struct rcb_common_cb *rcb_common) > int base_irq_idx = hns_rcb_get_base_irq_idx(rcb_common); > struct device_node *np = rcb_common->dsaf_dev->dev->of_node; > struct platform_device *pdev = > - container_of(rcb_common->dsaf_dev->dev, > - struct platform_device, dev); > + to_platform_device(rcb_common->dsaf_dev->dev); Can it be one line after all? Please, check this for all your patches of such kind. > bool is_ver1 = AE_IS_VER1(rcb_common->dsaf_dev->dsaf_ver); > > for (i = 0; i < ring_num; i++) { > -- > 2.5.0 > > > -- > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > Please read the FAQ at http://www.tux.org/lkml/ -- With Best Regards, Andy Shevchenko -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/