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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 11812CD128A for ; Thu, 11 Apr 2024 07:51:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc: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=3gQ2rpduoQKhO1Ruxqxfuct4SK1UhLKvwFajmjLq544=; b=fTlCSOYwFbEGI0 2F5PImkEbWPyJsSXjUbR93DFX16lUU17+yWOR84G6dfnTB3y45XAh3+yvkgGII0hXLDldAZSNQSUU OiX/kgMJDKNcb0M6agbuFG3OF1aLE9chRKwopkfvyKuKxzYShNhKt0bBccqyK5IaFBSQ9LGwXxyIl hbOu0wmwR/Mmu3ma5AFAwRbg85OM2Urk0WBEpqUO7h5U3Puw4OTwpgVUq+RotXUveLj2KCSZ6R3u3 MGmY+eJ6kZ8QU9bB8BzcLkzMgEO73B96fIHCwyhGIBo/y59Eg7s9IZWMZY+3D8SfwdbFWp0EEDqM6 dhIF0SUTisP049CvxZEg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rupCv-0000000AxGE-0LZD; Thu, 11 Apr 2024 07:50:53 +0000 Received: from mail-oa1-x32.google.com ([2001:4860:4864:20::32]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rupCs-0000000AxDj-0cdX for linux-arm-kernel@lists.infradead.org; Thu, 11 Apr 2024 07:50:52 +0000 Received: by mail-oa1-x32.google.com with SMTP id 586e51a60fabf-22fa7e4b0beso1285702fac.1 for ; Thu, 11 Apr 2024 00:50:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712821848; x=1713426648; darn=lists.infradead.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=K1N7MYojLeI98ykv2u1nfElF4/8RvWc4Po+NQoLUVVw=; b=Mn8p/A6t0H2xCbyEi7Js17mmAx2GuUR1etdVbfk1yj4hTsG9YdnlscGWMX2M0cxArI Vg4mkGXymhKXH3S26E5ho0I4bzyNf7syt/M4CdK4m54VUymNPDn5gEmBsYelFSQDMh7v n4oTpuzcK5uH3E343RrglkVEDYDTNXeCWZcVOBo2+WnJtFB8iZpPtsUmnHmUSHCIfA0E fyOviTHIKz2+k1PDcpuWvaDdSrU6hO4Kb/zrvM3+YtoBy/0tFpVn8r0T4/+W3WvJHLGo mcqMKUHR1+ATNir2pOCbfZT9muP+8bltVRvlpYMQT2LqAtVwGs5IP6NAGbjvMZZhMSXB /SKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712821848; x=1713426648; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=K1N7MYojLeI98ykv2u1nfElF4/8RvWc4Po+NQoLUVVw=; b=rKpGsxDj3Qo4RlD8BaHN+SNhuFAdFAK+p45pS6G7eQrrflaRNvXwhZ9Ktr/F5EProf vejCWzdZPJddLDhBIvPWrMa8XLZjcw6zjvtUXckbPqIhC6EiHxF7ssddt7pTOv4sWag6 An1DYR37CF1YHYF7G73+aqL2M66PfKvXoWZHMMkXSqprxUQv3NI3QJQbitLq8CyBZWU5 Lb0j9EY7Fzo82iPMYmkPE9paatR6GUiZGMRzPS09I8359s871vl1lqOPPBUVYBqbJU0e DdCUyzmeDJ50jSEYhxZDQCPciWDpGb6B8O3oDkLM5fpCwGXRDVF3fYO5Q9dssqfwop5q 3Xyg== X-Forwarded-Encrypted: i=1; AJvYcCXWSz7IgyCUOoNcXYC6RFpTdc9feKfCPmVa01P3w1Yz/9vjtWC/X0nnsHBSx1Tl8zZ9ebd0SfayNeRaRUosWasrhjdpRC6JeXEcBA/Jsmp/vAHI8Gs= X-Gm-Message-State: AOJu0YwzkXT6dzXMXsqSnRsTlHG1hDmLLaBzeqGAa0xtRMsonC6GDZtc SbAkv3Xj55KxJHUB5DxjYivN8PiRMcTi9pFZvkFHfn9/HY53cDdeDSkTQq1ncp6kXr8OG+zTkeM bOosC/kCuCJ1VavYt8+UHBsT2CrI= X-Google-Smtp-Source: AGHT+IGMkAAJtDvRmLGqE3O84KzubcqbUdORj7yi/0mwOx+0/MYwJB+MptRR3G6k5wFtj6uNdbUybb4yeh+d+N1r+EE= X-Received: by 2002:a05:6870:f6a5:b0:233:3085:e55c with SMTP id el37-20020a056870f6a500b002333085e55cmr3215251oab.53.1712821847796; Thu, 11 Apr 2024 00:50:47 -0700 (PDT) MIME-Version: 1.0 References: <20240404071350.4242-1-linux.amoon@gmail.com> <20240404071350.4242-7-linux.amoon@gmail.com> <20240409015352.ocpjbgxrx636jmk4@synopsys.com> <20240410232623.6gaupt6t725hhype@synopsys.com> In-Reply-To: <20240410232623.6gaupt6t725hhype@synopsys.com> From: Anand Moon Date: Thu, 11 Apr 2024 13:20:31 +0530 Message-ID: Subject: Re: [PATCH v2 6/6] usb: dwc3: exynos: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() To: Thinh Nguyen Cc: Greg Kroah-Hartman , Krzysztof Kozlowski , Alim Akhtar , Christophe JAILLET , Johan Hovold , "linux-usb@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-samsung-soc@vger.kernel.org" , "linux-kernel@vger.kernel.org" X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240411_005050_410567_65407A90 X-CRM114-Status: GOOD ( 29.02 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 Thinh, On Thu, 11 Apr 2024 at 04:56, Thinh Nguyen wrote: > > On Wed, Apr 10, 2024, Anand Moon wrote: > > Hi Thinh, > > > > On Tue, 9 Apr 2024 at 07:24, Thinh Nguyen wrote: > > > > > > On Thu, Apr 04, 2024, Anand Moon wrote: > > > > Use the new PM macros for the suspend and resume functions to be > > > > automatically dropped by the compiler when CONFIG_PM_SLEEP are disabled, > > > > without having to use #ifdef guards. If CONFIG_PM_SLEEP unused, > > > > they will simply be discarded by the compiler. > > > > > > > > Signed-off-by: Anand Moon > > > > --- > > > > v2: add __maybe_unused to suspend/resume functions in case CONFIG_PM is > > > > disabled. > > > > > > The compiler discards the code, yet we still need __maybe_unused? > > > > > Earlier version had not added this since but I removed the > > guard.CONFIG_PM_SLEEP. > > added __maybe_unused just to safeguard the function. > > > > I have tried to build with config by disabling CONFIG_PM and CONFIG_PM_SLEEP > > but could get the warning compilation by adding flag W=1 > > -Werror=unused-function. > > > > > > > > > But since these CONFIG_PM and CONFIG_PM_SLEEP cannot be disabled, > > I am not getting any warning related to these functions. > > > > Do you want me to remove __maybe_unused ? > > > > The warning was there as expected. You should to use it along with > DEFINE_SIMPLE_DEV_PM_OPS(). Let me know if you still see the same > warning. > But the warnings are related to the following macros #define PTR_IF(cond, ptr) ((cond) ? (ptr) : NULL) #define pm_ptr(_ptr) PTR_IF(IS_ENABLED(CONFIG_PM), (_ptr)) #define pm_sleep_ptr(_ptr) PTR_IF(IS_ENABLED(CONFIG_PM_SLEEP), (_ptr)) So if we can disable CONFIG_PM and CONFIG_PM_SLEEP options the relevant function with the above macro will be set to NULL. in this case, the compiler will discard the function in SET_SYSTEM_SLEEP_PM_OPS > BR, > Thinh Thanks -Anand _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel