Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp1576580ybi; Sat, 25 May 2019 05:10:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqy6m+nZG2C4E36qfs8BYLQEzcdSH7OTs8358PVnJX5EbpMElqNqqI1UfZW2jhaTa2BV5GK7 X-Received: by 2002:a62:e90a:: with SMTP id j10mr51486658pfh.147.1558786202766; Sat, 25 May 2019 05:10:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558786202; cv=none; d=google.com; s=arc-20160816; b=jmYA4WGtioCaKGLNlK9XYn1wCws+dZ9jBXUNEZW6nkiHLNMBhe5wRXfY4LyKkESB0Z eOwSPeEyf9bSuYdEsECMoKtFk/FAe8fuQrS58JesKbBmDaMJDFumtLAYTDAj0dDRn44U hPtTmgYX+7wWpIGP2sWh9uFVuV0bh8hxmWAldu/TNGMrcNnWxYXSkapWpMyiRrTvpga+ kwNoQ4Y4wKU9DodxboU4LpAiz+IWgxasN9PxgNcD8yFQyfAZq40NcSPA+VFWrnRHEGcY 0qcG5XhwLQJ+mzvBcNdcP16jP489OhpHT5iviMlLfQ7/CIJfA7u6qN9vHwwhPFi/KEct MJrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:to:subject; bh=C7s1f8CZBUzRHJaP9zmZTf/qVgXe6TRMeXdY943vOQE=; b=xJ20w1U810MjA5DJpu926U6tkn61jxLzpAI32qKU1SVFMLHgdJ12EjwLchyNzH8uMi dOEjNlnxVvv5nSb1Qinp0bvSnY65iVd1RuZsIU2to2T7S1omA2t4Una62aVbgqKCERAs A3dCa+DQcUvsiwzTpKNu10XaatNkrbai6qFuZvt+ho3HLKMfVxrcjfmwAgBdRNdMl4tM 0Q3OWfdtSFgLTnmaoFnZqpv4TJxvuQReHKZu0Y11wLB03Y4P7dnihSTodmNukJnUTdW7 ONqXrQu4gkC74sRQJ23HV8+Daq+LHqeKOgEH2akxAkwvThkv96gF7PFpj1LF/9Sjc9K5 ye7w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w10si7183597pjq.100.2019.05.25.05.09.35; Sat, 25 May 2019 05:10:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726859AbfEYMHl (ORCPT + 99 others); Sat, 25 May 2019 08:07:41 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60322 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726585AbfEYMHl (ORCPT ); Sat, 25 May 2019 08:07:41 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5EA3C308A9BE; Sat, 25 May 2019 12:07:41 +0000 (UTC) Received: from [10.72.12.46] (ovpn-12-46.pek2.redhat.com [10.72.12.46]) by smtp.corp.redhat.com (Postfix) with ESMTP id CDE322DE9E; Sat, 25 May 2019 12:07:36 +0000 (UTC) Subject: Re: [PATCH] ceph: fix warning PTR_ERR_OR_ZERO can be used To: Hariprasad Kelam , Sage Weil , Ilya Dryomov , ceph-devel@vger.kernel.org, linux-kernel@vger.kernel.org References: <20190525091559.GA14633@hari-Inspiron-1545> From: "Yan, Zheng" Message-ID: Date: Sat, 25 May 2019 20:07:34 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: <20190525091559.GA14633@hari-Inspiron-1545> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Sat, 25 May 2019 12:07:41 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5/25/19 5:15 PM, Hariprasad Kelam wrote: > change1: fix below warning reported by coccicheck > > /fs/ceph/export.c:371:33-39: WARNING: PTR_ERR_OR_ZERO can be used > > change2: typecasted PTR_ERR_OR_ZERO to long as dout expecting long > > Signed-off-by: Hariprasad Kelam > --- > fs/ceph/export.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/fs/ceph/export.c b/fs/ceph/export.c > index d3ef7ee42..15ff1b0 100644 > --- a/fs/ceph/export.c > +++ b/fs/ceph/export.c > @@ -368,7 +368,7 @@ static struct dentry *ceph_get_parent(struct dentry *child) > } > out: > dout("get_parent %p ino %llx.%llx err=%ld\n", > - child, ceph_vinop(inode), (IS_ERR(dn) ? PTR_ERR(dn) : 0)); > + child, ceph_vinop(inode), (long)PTR_ERR_OR_ZERO(dn)); > return dn; > } > > Applied. Thanks Yan, Zheng