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=-6.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 4723DC433E0 for ; Tue, 30 Jun 2020 18:14:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2957A20722 for ; Tue, 30 Jun 2020 18:14:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="b0p9lJnA" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390708AbgF3SOr (ORCPT ); Tue, 30 Jun 2020 14:14:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60100 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390707AbgF3SOq (ORCPT ); Tue, 30 Jun 2020 14:14:46 -0400 Received: from mail-ed1-x541.google.com (mail-ed1-x541.google.com [IPv6:2a00:1450:4864:20::541]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E4DC4C061755; Tue, 30 Jun 2020 11:14:45 -0700 (PDT) Received: by mail-ed1-x541.google.com with SMTP id h28so17120281edz.0; Tue, 30 Jun 2020 11:14:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=J4eE12BOE1HalE843yy2+ABkRGNvy5RVDqgV4Do+Hxs=; b=b0p9lJnA9AEnQ/OCFLRDracrYFp4I6OVuWsJcT/octsL0opJ8r/zfNPOlkBBhQP6jj A3Sl/EeNlagvrkjHf5S1TIRIdVxqLhQEz+EH/ID/dca5NUdHN4ucOubimvul3Ae5cih0 7KyNI2zkfSGwYCliLNv1Rb5LZdXnqEIy4uoZKrpRyLepkBd9CJ1peAimbT99k8bv8kTA vkhzw/XP4RwwB9bDBDa9vX6B8sh7SX2tWPU2erQ6hMlFI/wcz7HUbLeSgYHu3rXNj38H Hwu4MYFdxfIJatJO1mPQlTM1yDEbKlH4KhwqN88dKc9lN8emDE4jtBn/RJFdXg8ru3qO sUBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=J4eE12BOE1HalE843yy2+ABkRGNvy5RVDqgV4Do+Hxs=; b=kLVDq6MMRZJMZu2ihz92qwxh6nMH55gVoyPtYFllce+uzjQcr3AtzcDL6IVEE5pdHE YP8pPHnRsHVl26ATtNYp4bxPl80CQNAORoSb0dhVuvrlMPvgs1UqFELVLScMKr245ZCB dvN8EtkWGo/z+cuTyfDC/sdwL8l6j4oRy1cMhckosnHG32NenG0t23UE3MefRN7Pge8O 1ZwqLSmLJApbxxkp97yIn9b9KCJM26rR/xFKBvyb3JcW+P66d7dWb9hEqsKVCk48fQFo sxZstTEDwR0QgJkEdDKnpDWx1x6MlAT/EvtSjKJpfbw7f4+uFicg6AuL3Ny8DClIhtBh GLnQ== X-Gm-Message-State: AOAM532nQjTM9Q5yEY/47XzeNsajcVN93q7Idz5OpeUzuJpdjbn0GPHu ToBigYCYcwnI4cdidyp8Q90HDB/lNYlsHheNnzM= X-Google-Smtp-Source: ABdhPJxNZ/TFxDKRnW9VbHXebDh2ZEsRrPe+ICrLHAMxjLv+e5504Mo7cub+qPqMRStrZi1Fn5uSLFVMTJDGzNJVzJY= X-Received: by 2002:a05:6402:1244:: with SMTP id l4mr24868482edw.71.1593540883963; Tue, 30 Jun 2020 11:14:43 -0700 (PDT) MIME-Version: 1.0 References: <1591697830-16311-1-git-send-email-amittomer25@gmail.com> <1591697830-16311-3-git-send-email-amittomer25@gmail.com> <20200624061529.GF2324254@vkoul-mobl> <20200629095207.GG2599@vkoul-mobl> <20200630142427.GP2599@vkoul-mobl> In-Reply-To: <20200630142427.GP2599@vkoul-mobl> From: Amit Tomer Date: Tue, 30 Jun 2020 23:44:06 +0530 Message-ID: Subject: Re: [PATCH v4 02/10] dmaengine: Actions: Add support for S700 DMA engine To: Vinod Koul Cc: Andre Przywara , =?UTF-8?Q?Andreas_F=C3=A4rber?= , Manivannan Sadhasivam , dan.j.williams@intel.com, cristian.ciocaltea@gmail.com, dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel , linux-actions@lists.infradead.org Content-Type: text/plain; charset="UTF-8" Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org Hi, On Tue, Jun 30, 2020 at 7:54 PM Vinod Koul wrote: > > On 30-06-20, 15:17, Amit Tomer wrote: > > Hi Vinod, > > > > On Mon, Jun 29, 2020 at 3:22 PM Vinod Koul wrote: > > > > > If you use of_device_get_match_data() you will not fall into this :) > > > > But again, of_device_get_match_data() returns void *, and we need > > "uintptr_t" in order to type cast it properly (at-least without > > warning). > > Not really, you can cast from void * to you own structure.. btw why do > you need uintptr_t? uintptr_t allows us to cast to an integer type that matches with enum in terms of size, and clang is happy about it (no more such warnings). > The problem is a pointer to enum conversion :) I think the right way > would be to do would be below > > soc_type = (enum foo)of_device_get_match_data(dev); > > or > soc_type = (unsigned long) of_device_get_match_data(dev); > > which I think should be fine in gcc, but possibly give you above warning Yeah, GCC is always fine with it. > in clang.. but i thought that was fixed in clang https://reviews.llvm.org/D75758 Thanks for pointing this out. To be honest, I thought clang had brought something important which is missed by GCC (via emitting this warning) that needed to be fixed in Kernel code. But looking at this commit[1], feeling that CLANG people just wanted to be compatible with GCC, and in that situation why should one believe the clang ? [1]: https://github.com/ClangBuiltLinux/llvm-project/commit/4fd4438882cc7f78e56e147d52d9a1f63b58ba81 Thanks -Amit 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=-6.0 required=3.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 7340DC433DF for ; Tue, 30 Jun 2020 18:16:06 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 44B4C20722 for ; Tue, 30 Jun 2020 18:16:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="yj3YqJf2"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="b0p9lJnA" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 44B4C20722 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=4XEJqnOO/XlW0Nc/LvKrh0KKJKpNNfKrALr9fR07c44=; b=yj3YqJf2yl1jbb50kVumk89Au opc7r7U0/Mn1NDbVBoW1kunCPCe89D/+minCtx6ftZCN7YKp+antJc30Z5fMvghJEZ4Lai1uNje2B jx0GYKV/63IXkM1zjsqJyPlsPRry9xPvXQd1iyMZYux9S2U5lSDVmSfmnsQPkq48e2EE/uN3gOgEZ 6ya46U7llZIFie9Ovh9ObRMJBKQ6DcSQMGMaFp93ms+z0r2hdHLGn6j8FUilWmwbiqzsph7QBBJ5j Ihf7ZTd7mIR+AG804joMgFWbLGBzctKaiT0y37wW57nWKKoxWrAxP5zIBIjulKglk5uK1mBrNY36O gPgPZawGQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jqKmN-00024w-Hz; Tue, 30 Jun 2020 18:14:47 +0000 Received: from mail-ed1-x541.google.com ([2a00:1450:4864:20::541]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jqKmL-00024S-Dc; Tue, 30 Jun 2020 18:14:46 +0000 Received: by mail-ed1-x541.google.com with SMTP id z17so17103715edr.9; Tue, 30 Jun 2020 11:14:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=J4eE12BOE1HalE843yy2+ABkRGNvy5RVDqgV4Do+Hxs=; b=b0p9lJnA9AEnQ/OCFLRDracrYFp4I6OVuWsJcT/octsL0opJ8r/zfNPOlkBBhQP6jj A3Sl/EeNlagvrkjHf5S1TIRIdVxqLhQEz+EH/ID/dca5NUdHN4ucOubimvul3Ae5cih0 7KyNI2zkfSGwYCliLNv1Rb5LZdXnqEIy4uoZKrpRyLepkBd9CJ1peAimbT99k8bv8kTA vkhzw/XP4RwwB9bDBDa9vX6B8sh7SX2tWPU2erQ6hMlFI/wcz7HUbLeSgYHu3rXNj38H Hwu4MYFdxfIJatJO1mPQlTM1yDEbKlH4KhwqN88dKc9lN8emDE4jtBn/RJFdXg8ru3qO sUBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=J4eE12BOE1HalE843yy2+ABkRGNvy5RVDqgV4Do+Hxs=; b=MZvo2jSc6ppIwC6cRABJ2ok3qvq8Y1Kij6giJY13C0vsU16MbKKHA1SyA9IL5bKVkG bFss59rbltxSraTIToofBSbN5yF0NxQxUp1M59K6ei4ZlrPISe4M4n+Cg94VwoU/nsbH VbyMsoXitL2qLyg+UXmCCLCe2GKYMo832FtPNKBCnaYDpYHHTqVetdROPqWNxnVzu6b9 rasOTvU1qTyIysdbcbt9C4WxiIijO5xyOVewEsrD4DeVnGCbrBT4V8rLp9zTNbvsUqU2 rvR0yx4ZiSe65FGos1sqn3nO4lBzrY+Rjz0RRR21pU3J2cDYupXxl/FCfvaCTQvbjYKM FsWA== X-Gm-Message-State: AOAM531sOnG/AOZb5IfWYyaimwlfkqo5S+YKJrJ8S/XJjndgY8d/WEEE tz8AF8EwbtvYcnqQLcPkh1EZklJ9KtAkQzQp354= X-Google-Smtp-Source: ABdhPJxNZ/TFxDKRnW9VbHXebDh2ZEsRrPe+ICrLHAMxjLv+e5504Mo7cub+qPqMRStrZi1Fn5uSLFVMTJDGzNJVzJY= X-Received: by 2002:a05:6402:1244:: with SMTP id l4mr24868482edw.71.1593540883963; Tue, 30 Jun 2020 11:14:43 -0700 (PDT) MIME-Version: 1.0 References: <1591697830-16311-1-git-send-email-amittomer25@gmail.com> <1591697830-16311-3-git-send-email-amittomer25@gmail.com> <20200624061529.GF2324254@vkoul-mobl> <20200629095207.GG2599@vkoul-mobl> <20200630142427.GP2599@vkoul-mobl> In-Reply-To: <20200630142427.GP2599@vkoul-mobl> From: Amit Tomer Date: Tue, 30 Jun 2020 23:44:06 +0530 Message-ID: Subject: Re: [PATCH v4 02/10] dmaengine: Actions: Add support for S700 DMA engine To: Vinod Koul X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200630_141445_493770_B45518D1 X-CRM114-Status: GOOD ( 15.67 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andre Przywara , linux-actions@lists.infradead.org, linux-kernel@vger.kernel.org, cristian.ciocaltea@gmail.com, Manivannan Sadhasivam , dmaengine@vger.kernel.org, dan.j.williams@intel.com, =?UTF-8?Q?Andreas_F=C3=A4rber?= , linux-arm-kernel Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi, On Tue, Jun 30, 2020 at 7:54 PM Vinod Koul wrote: > > On 30-06-20, 15:17, Amit Tomer wrote: > > Hi Vinod, > > > > On Mon, Jun 29, 2020 at 3:22 PM Vinod Koul wrote: > > > > > If you use of_device_get_match_data() you will not fall into this :) > > > > But again, of_device_get_match_data() returns void *, and we need > > "uintptr_t" in order to type cast it properly (at-least without > > warning). > > Not really, you can cast from void * to you own structure.. btw why do > you need uintptr_t? uintptr_t allows us to cast to an integer type that matches with enum in terms of size, and clang is happy about it (no more such warnings). > The problem is a pointer to enum conversion :) I think the right way > would be to do would be below > > soc_type = (enum foo)of_device_get_match_data(dev); > > or > soc_type = (unsigned long) of_device_get_match_data(dev); > > which I think should be fine in gcc, but possibly give you above warning Yeah, GCC is always fine with it. > in clang.. but i thought that was fixed in clang https://reviews.llvm.org/D75758 Thanks for pointing this out. To be honest, I thought clang had brought something important which is missed by GCC (via emitting this warning) that needed to be fixed in Kernel code. But looking at this commit[1], feeling that CLANG people just wanted to be compatible with GCC, and in that situation why should one believe the clang ? [1]: https://github.com/ClangBuiltLinux/llvm-project/commit/4fd4438882cc7f78e56e147d52d9a1f63b58ba81 Thanks -Amit _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel