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=-1.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no 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 7D363C433FF for ; Thu, 8 Aug 2019 12:31:56 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 5399521882 for ; Thu, 8 Aug 2019 12:31:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="dHVYY/o3"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="opj1qQf9" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5399521882 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-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=bombadil.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=OalShYVxJA7ySyTSUg18XqEmL98wyXckmoiXEb9ecOc=; b=dHVYY/o39fcJ0p Qps5HmtU3yHQD774Nb8vrlBLVCzQZG36J7q8wI9tA/v1C9O3hVuJkpfzfCKOOhbdxZsgbBWhD2LNY PMBCPtz0ePhgh4v+rzlMGECFsJqH2Eoq5F92meqyO1zMyziEDk15nzonFfM9ueVN7HWqZSGo5hxCB OTPxU/nfwVRNWwAvS4gPJOORombX2oP3V7EK7GT8ovDPj/6H/KXyk+78dQB2iHQWVmfkmetopePmQ CdO3pEQMkNWaSEmxMRiE/6X0w7PXfdBrkU0dud0/yagVWRrCw/ZrJwuaHTV+STPSS/L9KnB3Ii/Ui 398NZRSE2hxRUfrpgRiw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hvhaF-0003dg-V0; Thu, 08 Aug 2019 12:31:55 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hvhaD-0003cs-2x for linux-arm-kernel@lists.infradead.org; Thu, 08 Aug 2019 12:31:54 +0000 Received: from mail-lj1-f179.google.com (mail-lj1-f179.google.com [209.85.208.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 32616218A2 for ; Thu, 8 Aug 2019 12:31:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1565267512; bh=bdQZvsSQ32pIcK00dvHnvYCuayYBNzzTq0JqfKXAAnA=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=opj1qQf9iEv45GohNPIZzhCfVIZu1ZKpRtt66TnyPL0lOzTJk5eitdVMhBoy+g0Hf UVInrjj0SFWueYHRvOSGyc2Fpz0WX4Dk4DE0AzIZES1sOm0BnypToJNP5f4pPpc22P wQUfdU1+dQ5DAUF2r3Ky0lG/+/V7pVl8LsPRJRnY= Received: by mail-lj1-f179.google.com with SMTP id z17so276468ljz.0 for ; Thu, 08 Aug 2019 05:31:52 -0700 (PDT) X-Gm-Message-State: APjAAAXjwaPiqjUZC0xL5/9pwvQvKJlM5MgwOVKHih/ZU90JEfTj7NVT bGHu1OkbNwwJDuMcfdjRsQkANRP6SIQoDta+Z7E= X-Google-Smtp-Source: APXvYqzE6I+ay+3PmHe0pYVJmR3CgZhxE3A6RP3FlUDg7MjWb3h3zbv3W0JwnvdTTIFomcUI0MjdcuE87ZGWhiIDMH0= X-Received: by 2002:a2e:3008:: with SMTP id w8mr8290719ljw.13.1565267510378; Thu, 08 Aug 2019 05:31:50 -0700 (PDT) MIME-Version: 1.0 References: <20190718143044.25066-1-s.nawrocki@samsung.com> <20190718143044.25066-4-s.nawrocki@samsung.com> In-Reply-To: From: Krzysztof Kozlowski Date: Thu, 8 Aug 2019 14:31:39 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 3/9] soc: samsung: Add Exynos Adaptive Supply Voltage driver To: Sylwester Nawrocki X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190808_053153_149286_3F235A22 X-CRM114-Status: GOOD ( 13.72 ) 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: devicetree@vger.kernel.org, "linux-samsung-soc@vger.kernel.org" , linux-pm@vger.kernel.org, pankaj.dubey@samsung.com, =?UTF-8?B?QmFydMWCb21pZWogxbtvxYJuaWVya2lld2ljeg==?= , "linux-kernel@vger.kernel.org" , robh+dt@kernel.org, kgene@kernel.org, vireshk@kernel.org, linux-arm-kernel@lists.infradead.org, Marek Szyprowski Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, 8 Aug 2019 at 14:07, Sylwester Nawrocki wrote: > >> +static unsigned int exynos5422_asv_parse_table(struct exynos_asv *asv, > >> + unsigned int pkg_id) > >> +{ > >> + return (pkg_id >> EXYNOS5422_TABLE_OFFSET) & EXYNOS5422_TABLE_MASK; > >> +} > >> + > >> +static bool exynos5422_asv_parse_bin2(struct exynos_asv *asv, > >> + unsigned int pkg_id) > >> +{ > >> + return (pkg_id >> EXYNOS5422_BIN2_OFFSET) & EXYNOS5422_BIN2_MASK; > > > > return !!() for converting to boolean. > > I'm not convinced it is needed, the return type of the function is bool > and value of the expression will be implicitly converted to that type. > Is there any compiler warning related to that? Yeah, but bool is int so there will be no implicit conversion... I guess it is a convention. In theory !! is the proper conversion to bool but if bool==int then it's essentially conversion to 1. I am not sure what's the benefit, maybe for some wrong code which would do comparisons on result like if (exynos5422_asv_parse_bin2() == TRUE)... Best regards, Krzysztof _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel