Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp1643822imm; Wed, 20 Jun 2018 23:44:36 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKsaH2jnkEQmL6yTzIKJuoVZSzVZ4uSn+GFbM4mc1sWkf1LlbVMXwnabOL4LGBNRoM0TBio X-Received: by 2002:a65:6186:: with SMTP id c6-v6mr4021684pgv.360.1529563476929; Wed, 20 Jun 2018 23:44:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529563476; cv=none; d=google.com; s=arc-20160816; b=EJ8Laq66RbSDP1Ku06OObBVtc1xd/4AVqTR975++piYP7/Z//54+hFumrvHrHUOMso YLgaXgHI+3X5EDSuUmJM39CBDHLW1yHqYDuTp7OgzJX/dyUGkKYczjZpS6GHwtEgE+Vo 3ZGXebFyeDDvcY7OB8vUJWN09kWt3AHeys+4fQivyEfBP6uLgLi9CqYgwTo0bG5CXvTX tMIrFNc9Rm/jzbid7WH6MlSIM1Dn7K8O1Cw0vAHznDE0swud7b2pLCJFVO9yzU13yi9F 5zN2oQV7bReBNAktuHUuTIpCrX5thFYt0VEF+1W47rdO6xtVv8TIDyUYumhSiE/1rO9r qzeg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=6JKGCagtb+ioQ5uE0jW9Tka9XBnC7KqDUk1no8bR0rU=; b=lgtc2ddRe5KOgoLqNRwgIzfii2kYlH6xwHM0Zz7tn1GJ5M6rpv1m2NJ8U77Hr5HS5F ZWnxEpg8cOFnp+6qSDQqG3izWy72pzGWoYyq1IQ0p7zqhhxWq2+SkmRVvQoJGcS+mKOL Yoca9QzDD00FTl9vd1RXhZkAM8nq7EsOS05IzNYb0E0fvtxx2jOy+79PecBNfqXfg+/x 1FAM64pvanAkyy0F06+Z49KO5UlaSGBVlaWM5U82DwC0ZHxLVXJFFjWUOm6RvL077zMp qV2uBZJp06YhKm9ZOYZ7kwKY3Q+0oxg9u6i0zJTgIUHWJf6W9t2I1VUpYyl5XYltMAqY jkMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=q+5ll7qw; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f2-v6si3520347pgu.457.2018.06.20.23.44.22; Wed, 20 Jun 2018 23:44:36 -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; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=q+5ll7qw; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932931AbeFUGnb (ORCPT + 99 others); Thu, 21 Jun 2018 02:43:31 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:36592 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932883AbeFUGnY (ORCPT ); Thu, 21 Jun 2018 02:43:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=6JKGCagtb+ioQ5uE0jW9Tka9XBnC7KqDUk1no8bR0rU=; b=q+5ll7qwib2bMLNzCvHsvDuIq u2fgQ40K29wRrez/wps+SLqJ7QXvtPeaoE4MidMlS63W/W1tDYGlN/XN9q29+Ity+MXJbTBzbrzx4 vR60qu/fuCYeBMCZm/8EVGwFiSLX61CknoRHn0JZl9V/tift4RupsbEJBZKYzGbDpJzHjzhoryqWp UFuoTVZkBy/S45WS/jGYxCanAaCrEMybrOQN6Ze+1VIgD0Qtlu8KlIJSbWIZTr2XrthGCnzjcJnaU EWF0hUds+eDAo/p6WiaPj/F3O01UaxiQdXH2jkzYGg8SF3shAk3nSgxAoUo7xpJJALhyL3vAaOuxX rIaMm3SSQ==; Received: from hch by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1fVtJS-0004Hi-FW; Thu, 21 Jun 2018 06:43:22 +0000 Date: Wed, 20 Jun 2018 23:43:22 -0700 From: Christoph Hellwig To: Zong Li Cc: palmer@sifive.com, aou@eecs.berkeley.edu, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, greentime@adnestech.com Subject: Re: [PATCH 5/5] RISC-V: Use fixed width integer types for 32-bit compatible Message-ID: <20180621064322.GE19319@infradead.org> References: <37a6523947397cd72320676030b96926e373d05a.1529506497.git.zong@andestech.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <37a6523947397cd72320676030b96926e373d05a.1529506497.git.zong@andestech.com> User-Agent: Mutt/1.9.2 (2017-12-15) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 21, 2018 at 09:41:46AM +0800, Zong Li wrote: > Use fixed width integer types for print format on 32/64 bit > to fix warning about format compatible. > > Like inttypes.h, but more simpler for RISC-V usage. > > Signed-off-by: Zong Li > --- > arch/riscv/include/asm/format.h | 20 ++++++++++++++++++++ > arch/riscv/kernel/module.c | 13 +++++++------ > 2 files changed, 27 insertions(+), 6 deletions(-) > create mode 100644 arch/riscv/include/asm/format.h > > diff --git a/arch/riscv/include/asm/format.h b/arch/riscv/include/asm/format.h > new file mode 100644 > index 000000000000..9b68ca7fac46 > --- /dev/null > +++ b/arch/riscv/include/asm/format.h > @@ -0,0 +1,20 @@ > +/* SPDX-License-Identifier: GPL-2.0 */ > +/* Copyright (C) 2018 Andes Technology Corporation */ > + > +#ifndef _ASM_RISCV_FORMAT_H > +#define _ASM_RISCV_FORMAT_H > + > +#if __riscv_xlen == 64 > +#define __PRI_PREFIX "ll" > +#else > +#define __PRI_PREFIX > +#endif > + > +#define PRIdX __PRI_PREFIX "d" > +#define PRIiX __PRI_PREFIX "i" > +#define PRIuX __PRI_PREFIX "u" > +#define PRIoX __PRI_PREFIX "o" > +#define PRIxX __PRI_PREFIX "x" > +#define PRIXX __PRI_PREFIX "X" > + > +#endif /* _ASM_RISCV_FORMAT_H */ If you want these prefixed submit them to the core kernel, not under asm/ for RISC-V. > > static int apply_r_riscv_32_rela(struct module *me, u32 *location, Elf_Addr v) > { > if (v != (u32)v) { > - pr_err("%s: value %016llx out of range for 32-bit field\n", > + pr_err("%s: value %016" PRIxX "out of range for 32-bit field\n", > me->name, v); > return -EINVAL; But in general Linux uXX and sXX values are always the same underlying fundamental C type. What is the mismatch here?