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=-10.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,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 40615C433E0 for ; Tue, 2 Feb 2021 15:11:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F3C7A64E9E for ; Tue, 2 Feb 2021 15:10:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234988AbhBBPKr (ORCPT ); Tue, 2 Feb 2021 10:10:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35560 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230338AbhBBPHW (ORCPT ); Tue, 2 Feb 2021 10:07:22 -0500 Received: from mail-ed1-x52c.google.com (mail-ed1-x52c.google.com [IPv6:2a00:1450:4864:20::52c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F1E99C06178B for ; Tue, 2 Feb 2021 07:05:40 -0800 (PST) Received: by mail-ed1-x52c.google.com with SMTP id i5so1071711edu.10 for ; Tue, 02 Feb 2021 07:05:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=soleen.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=xNPuLWbMOPJhBKW5/O3dFI43s3JosphBljhuMVPMAJI=; b=YO5JffeoAjC9HQlC6/6NpLQ4XGUy9IrmZEE+M1Wpu+Z/AtRU4EDZOSuGFhor9j3ldF f6bg7DPqpjzUEBJIgG4jhbPsn07qCgo7322CSz8ozEWNxgurPBWjTGZnbNTo/GA80Ldb c/9miLkPNQp8Rj1U1XlZ7A1qjbYMTDzGfsPpEkXT4HJ+aaoHlwLWQtTyOnAjHdJm7L/c no9huoFvG30XWGX3TbLr3eWlZiG/2nt3MRM8BHvZBUY1n6UZ9Hco+RH3ITDk1rPOsbm4 pLGsIwP3KooZ0QxEDsWRHWcACtPE1qJiyI9Xscwb0+J2lDFa4LYqyH9/77tgq+J05TDg /TXA== 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=xNPuLWbMOPJhBKW5/O3dFI43s3JosphBljhuMVPMAJI=; b=QGmbPi5Sni8a/B9dns2/soZ+mKLUD+bG21Cbv1NDWjckVqwWPfKKE7EqHZLjggUh1b r2vRPqn7wOhNUjOUBoNawusQ/hOR9Ws3iS41SLl7SUwHihi/1himRyahMkYHJAdh+Ina TpkOHPC/dilozylLaLi2h07A3BQSCmhpu5k/kXEg3pw5+JxPQIToAOzQQRu0dxTrQCH1 rsAsSBEZ3dfdxIDpzHDESQxJTaNmIlJLAvuDqbOOWOGadsZg/Awfn2UwbavpJh1DuK0I GgQtkHWwmfORp7k5UlO53F3bE7OrPoiYEkmV0TmXErYLDcPK9QaKe2Ww3vLQmfHAh9ey RQJQ== X-Gm-Message-State: AOAM533QI/rxGew/QjNklgkBqy/AbenSMtAWN2TDTIMXkIo/qyXk/Cqn BgLVQp3QA/J5tkiSTZH2xkWStfHYsTCkDelz+CpCaw== X-Google-Smtp-Source: ABdhPJzPe8UR7cYiiXBEjQ2bELHWrWvEDyAypfU7vun7gk98Rh6dVxCDqYuae8Yr6FpQ1r9V4lwH6QbKZ1Pt22/dEM4= X-Received: by 2002:aa7:cd0a:: with SMTP id b10mr1818394edw.153.1612278339686; Tue, 02 Feb 2021 07:05:39 -0800 (PST) MIME-Version: 1.0 References: <20210201150306.54099-1-pasha.tatashin@soleen.com> <20210201150306.54099-2-pasha.tatashin@soleen.com> <20210202084243.GA3558964@infradead.org> In-Reply-To: <20210202084243.GA3558964@infradead.org> From: Pavel Tatashin Date: Tue, 2 Feb 2021 10:05:03 -0500 Message-ID: Subject: Re: [PATCH 1/1] arm64: hibernate: add __force attribute to gfp_t casting To: Christoph Hellwig Cc: James Morris , Sasha Levin , "Eric W. Biederman" , LKML , Jonathan Corbet , Catalin Marinas , Will Deacon , Linux ARM , Marc Zyngier , James Morse , Vladimir Murzin , Matthias Brugger , Mark Rutland , steve.capper@arm.com, rfontana@redhat.com, Selin Dag , Tyler Hicks Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 2, 2021 at 3:42 AM Christoph Hellwig wrote: > > On Mon, Feb 01, 2021 at 10:03:06AM -0500, Pavel Tatashin wrote: > > Two new warnings are reported by sparse: > > > > "sparse warnings: (new ones prefixed by >>)" > > >> arch/arm64/kernel/hibernate.c:181:39: sparse: sparse: cast to > > restricted gfp_t > > >> arch/arm64/kernel/hibernate.c:202:44: sparse: sparse: cast from > > restricted gfp_t > > > > gfp_t has __bitwise type attribute and requires __force added to casting > > in order to avoid these warnings. > > > > Fixes: 50f53fb72181 ("arm64: trans_pgd: make trans_pgd_map_page generic") > > Reported-by: kernel test robot > > Signed-off-by: Pavel Tatashin > > What about just passing the gfp_t value by reference which would be much > cleaner? Hi Christoph, Thank you for your suggestions. Passing by reference is OK. I am not sure it would be much cleaner because for GFP_ATOMIC we would need to declare another variable on stack before trans_info. Pasha 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=-9.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,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 3AA32C433DB for ; Tue, 2 Feb 2021 15:06:57 +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 EBFC264F83 for ; Tue, 2 Feb 2021 15:06:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EBFC264F83 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=soleen.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=PHO9zlXFNNR5Z8a+yncGW9FUq96KL22A8XLV+XEwjbM=; b=Dlv3/JxFR65KddQXBPufE7kdy 5kgc12FAO0Z5SXeIfBnsZTJSnCz4E1yaskT50s3DVoVpnCJCvUDJovOZ377kxHzhf5SD78Rg6YbO+ H60ZUHF+fAr49f4zQDkAl7heUNcvcT6nhw1cKSpsxy6iXZsaAkyY1VzoG7E5HE/munF0ezTDLVT1K yDt8YSxD1dBq6RCAuYWXi+eGXQzG8HYYXw3Hfwz56Z9mePNjdZ6YFr8CQPqRLvtxMAOKTzQBL5U8z ZZoi07RZlDiDiwyHY2rsf8T4OL9X8vuerRkhnoazGpuCEiZd5qZLkf2JD7qUp4tu8dtJgtXvZ50/f jg4TZ+eNg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l6xFP-0005kH-P7; Tue, 02 Feb 2021 15:05:43 +0000 Received: from mail-ed1-x529.google.com ([2a00:1450:4864:20::529]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l6xFN-0005jN-8F for linux-arm-kernel@lists.infradead.org; Tue, 02 Feb 2021 15:05:42 +0000 Received: by mail-ed1-x529.google.com with SMTP id d2so23300228edz.3 for ; Tue, 02 Feb 2021 07:05:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=soleen.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=xNPuLWbMOPJhBKW5/O3dFI43s3JosphBljhuMVPMAJI=; b=YO5JffeoAjC9HQlC6/6NpLQ4XGUy9IrmZEE+M1Wpu+Z/AtRU4EDZOSuGFhor9j3ldF f6bg7DPqpjzUEBJIgG4jhbPsn07qCgo7322CSz8ozEWNxgurPBWjTGZnbNTo/GA80Ldb c/9miLkPNQp8Rj1U1XlZ7A1qjbYMTDzGfsPpEkXT4HJ+aaoHlwLWQtTyOnAjHdJm7L/c no9huoFvG30XWGX3TbLr3eWlZiG/2nt3MRM8BHvZBUY1n6UZ9Hco+RH3ITDk1rPOsbm4 pLGsIwP3KooZ0QxEDsWRHWcACtPE1qJiyI9Xscwb0+J2lDFa4LYqyH9/77tgq+J05TDg /TXA== 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=xNPuLWbMOPJhBKW5/O3dFI43s3JosphBljhuMVPMAJI=; b=I3jDMI2saTIDqNFYkeXBjkQXHmEjz3z5UFntnaDmH42mAtZ0PYyPOsSYPo7UrtA7Nf PjL0PI4aQDsfWFI4YixX6TPSK7ZcBHjPpYTGeSO6Yej0kcWmi4rum/7/FUMYhTuYsYKf gu4TGpfqjBkdEvrGo3IPWklTySSheJ2+ZBfWZHWGmIvadn/EwK9IHyvkJrHigWIcD/Xi 49afH+7/wtJBVYyRRO/fGoKYoUudppL3T24OpTbYPdFbYZIGBGVAfOrdlA/S8saykC67 DnFgCy7nYLb2yreNLwKpPIJg8Ac85Mvrqy2a9VYODeQvHfeat6B74ozU0fcj0lq9h6pA g6Mg== X-Gm-Message-State: AOAM532ZF7Thy7aUO8mqSqZoCdvN8fJlVl9mPm9RJhuqDxc9dXN0XR3a 7SslzfXq791UmGtaXm3lG+KBSsCp0qenx76aPigH/A== X-Google-Smtp-Source: ABdhPJzPe8UR7cYiiXBEjQ2bELHWrWvEDyAypfU7vun7gk98Rh6dVxCDqYuae8Yr6FpQ1r9V4lwH6QbKZ1Pt22/dEM4= X-Received: by 2002:aa7:cd0a:: with SMTP id b10mr1818394edw.153.1612278339686; Tue, 02 Feb 2021 07:05:39 -0800 (PST) MIME-Version: 1.0 References: <20210201150306.54099-1-pasha.tatashin@soleen.com> <20210201150306.54099-2-pasha.tatashin@soleen.com> <20210202084243.GA3558964@infradead.org> In-Reply-To: <20210202084243.GA3558964@infradead.org> From: Pavel Tatashin Date: Tue, 2 Feb 2021 10:05:03 -0500 Message-ID: Subject: Re: [PATCH 1/1] arm64: hibernate: add __force attribute to gfp_t casting To: Christoph Hellwig X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210202_100541_419142_E4AD668D X-CRM114-Status: GOOD ( 18.87 ) 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: Sasha Levin , Mark Rutland , Vladimir Murzin , Jonathan Corbet , Catalin Marinas , Selin Dag , steve.capper@arm.com, LKML , James Morris , rfontana@redhat.com, Tyler Hicks , James Morse , "Eric W. Biederman" , Marc Zyngier , Matthias Brugger , Will Deacon , Linux ARM 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 On Tue, Feb 2, 2021 at 3:42 AM Christoph Hellwig wrote: > > On Mon, Feb 01, 2021 at 10:03:06AM -0500, Pavel Tatashin wrote: > > Two new warnings are reported by sparse: > > > > "sparse warnings: (new ones prefixed by >>)" > > >> arch/arm64/kernel/hibernate.c:181:39: sparse: sparse: cast to > > restricted gfp_t > > >> arch/arm64/kernel/hibernate.c:202:44: sparse: sparse: cast from > > restricted gfp_t > > > > gfp_t has __bitwise type attribute and requires __force added to casting > > in order to avoid these warnings. > > > > Fixes: 50f53fb72181 ("arm64: trans_pgd: make trans_pgd_map_page generic") > > Reported-by: kernel test robot > > Signed-off-by: Pavel Tatashin > > What about just passing the gfp_t value by reference which would be much > cleaner? Hi Christoph, Thank you for your suggestions. Passing by reference is OK. I am not sure it would be much cleaner because for GFP_ATOMIC we would need to declare another variable on stack before trans_info. Pasha _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel