lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <0d22fa16-1511-33ed-363e-fc42e4287aa0@codeaurora.org>
Date:   Thu, 19 Apr 2018 11:16:26 -0400
From:   Sinan Kaya <okaya@...eaurora.org>
To:     Wolfram Sang <wsa+renesas@...g-engineering.com>,
        linux-kernel@...r.kernel.org
Cc:     linux-renesas-soc@...r.kernel.org, kernel-janitors@...r.kernel.org,
        Andy Gross <andy.gross@...aro.org>,
        David Brown <david.brown@...aro.org>,
        Vinod Koul <vinod.koul@...el.com>,
        Dan Williams <dan.j.williams@...el.com>,
        linux-arm-msm@...r.kernel.org, linux-soc@...r.kernel.org,
        dmaengine@...r.kernel.org
Subject: Re: [PATCH 09/61] dmaengine: qcom: simplify getting .drvdata

On 4/19/2018 10:05 AM, Wolfram Sang wrote:
> We should get drvdata from struct device directly. Going via
> platform_device is an unneeded step back and forth.
> 
> Signed-off-by: Wolfram Sang <wsa+renesas@...g-engineering.com>
> ---
> 
> Build tested only. buildbot is happy. Please apply individually.
> 
>  drivers/dma/qcom/hidma.c          | 3 +--
>  drivers/dma/qcom/hidma_mgmt_sys.c | 6 ++----
>  2 files changed, 3 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/dma/qcom/hidma.c b/drivers/dma/qcom/hidma.c
> index 963cc5228d05..43d4b00b8138 100644
> --- a/drivers/dma/qcom/hidma.c
> +++ b/drivers/dma/qcom/hidma.c
> @@ -616,8 +616,7 @@ static irqreturn_t hidma_chirq_handler_msi(int chirq, void *arg)
>  static ssize_t hidma_show_values(struct device *dev,
>  				 struct device_attribute *attr, char *buf)
>  {
> -	struct platform_device *pdev = to_platform_device(dev);
> -	struct hidma_dev *mdev = platform_get_drvdata(pdev);
> +	struct hidma_dev *mdev = dev_get_drvdata(dev);
>  
>  	buf[0] = 0;
>  
> diff --git a/drivers/dma/qcom/hidma_mgmt_sys.c b/drivers/dma/qcom/hidma_mgmt_sys.c
> index d61f1068a34b..cbb89eafd844 100644
> --- a/drivers/dma/qcom/hidma_mgmt_sys.c
> +++ b/drivers/dma/qcom/hidma_mgmt_sys.c
> @@ -107,8 +107,7 @@ static struct hidma_mgmt_fileinfo hidma_mgmt_files[] = {
>  static ssize_t show_values(struct device *dev, struct device_attribute *attr,
>  			   char *buf)
>  {
> -	struct platform_device *pdev = to_platform_device(dev);
> -	struct hidma_mgmt_dev *mdev = platform_get_drvdata(pdev);
> +	struct hidma_mgmt_dev *mdev = dev_get_drvdata(dev);
>  	unsigned int i;
>  
>  	buf[0] = 0;
> @@ -125,8 +124,7 @@ static ssize_t show_values(struct device *dev, struct device_attribute *attr,
>  static ssize_t set_values(struct device *dev, struct device_attribute *attr,
>  			  const char *buf, size_t count)
>  {
> -	struct platform_device *pdev = to_platform_device(dev);
> -	struct hidma_mgmt_dev *mdev = platform_get_drvdata(pdev);
> +	struct hidma_mgmt_dev *mdev = dev_get_drvdata(dev);
>  	unsigned long tmp;
>  	unsigned int i;
>  	int rc;
> 

Reviewed-by: Sinan Kaya <okaya@...eaurora.org>

-- 
Sinan Kaya
Qualcomm Datacenter Technologies, Inc. as an affiliate of Qualcomm Technologies, Inc.
Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ