Received: by 10.223.176.5 with SMTP id f5csp159591wra; Thu, 1 Feb 2018 17:35:19 -0800 (PST) X-Google-Smtp-Source: AH8x227VlYz3rY5PpGgFta6ZNlOK9CJD4bz+U4mBwlnWBSvxLk0hcL8tabXXJjjEo3o4axab9eve X-Received: by 2002:a17:902:b082:: with SMTP id p2-v6mr2828720plr.314.1517535318981; Thu, 01 Feb 2018 17:35:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517535318; cv=none; d=google.com; s=arc-20160816; b=sfscbqRPkWnPCE0Aj8YZ7/PuMdFN7bWnWLj5i8atMU78v8E7akmA1qKsxgWBVLGdWo D5Sr97TXROJis4o6W/qoOl1QDLLsoKbm8uwdDeCq4i9GoKAlTNDVoktI5ww4tinrW6dd FvU2jOL0uKbwipflU2WA3+0MQ3ZUHwUV4lkgiWyu83zVyE8ExiN78pjrVUC+Q2+mbouW anbPZZgDHWcgROMveI9q6KDU4aTprVcW2vkLkX71+4A3M1/ac2UY3gC2PYKaXj4ztSiI 9q6iQFoOZ3AEMWRz5JP1mCUDm1pwbwYhnyRdWwsF7c0kH33qgoVPHirwC1rKiDqV5wsd CTow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=+FntLWo0V5jTAiqjQFDJ9vaQmc+BFBed7F4fe1+iUEY=; b=Im8/3dsCmG08+qreEYhbdg2IjoGFYC1uZRP13ZLlFUYdIv0+C7FfzaorP1lyWZhV4B 9LrW7TXQd/Buid8NU2sRqJMGVMxrXX6XLfC96hyf2DhR3YO9Kq+Jz0nwqA4rEkKkSOEa yx8KXmEYTW5dDJJjCjWgVmNl2AhJE1980GJXPgzVLFG4EN8b5u8xvYG0PQmCPRgNsIYL c1eOBNkV3A5r6nSMM84oob1pPnNC+A9iSBOPuPnj7/LCc6z3Ui4dnTrktKQj1GPAzexc WewQavFBWvBtr8JRyfF750gcewTuPtAEZGIp2pC5woUMiKyosBG84yKoQpjORi4eyBHl 6P/w== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j1si729090pfj.249.2018.02.01.17.35.04; Thu, 01 Feb 2018 17:35:18 -0800 (PST) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751984AbeBBBdz (ORCPT + 99 others); Thu, 1 Feb 2018 20:33:55 -0500 Received: from mga01.intel.com ([192.55.52.88]:59636 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751708AbeBBBdv (ORCPT ); Thu, 1 Feb 2018 20:33:51 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Feb 2018 17:33:50 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,445,1511856000"; d="scan'208";a="200709738" Received: from haiyuewa-mobl1.ccr.corp.intel.com (HELO [10.239.196.23]) ([10.239.196.23]) by fmsmga006.fm.intel.com with ESMTP; 01 Feb 2018 17:33:49 -0800 Subject: Re: [PATCH arm/aspeed/ast2500 v4 1/2] ipmi: add a KCS IPMI BMC driver To: minyard@acm.org, joel@jms.id.au, openbmc@lists.ozlabs.org, openipmi-developer@lists.sourceforge.net, linux-kernel@vger.kernel.org Cc: andriy.shevchenko@intel.com References: <1517531323-19427-1-git-send-email-haiyue.wang@linux.intel.com> <1ec1648a-020c-a6b5-3519-48eece098716@acm.org> From: "Wang, Haiyue" Message-ID: Date: Fri, 2 Feb 2018 09:33:49 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <1ec1648a-020c-a6b5-3519-48eece098716@acm.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018-02-02 09:10, Corey Minyard wrote: > > I loaded this in, tried a compile on x86_64, and got the following: > > In file included from ../drivers/char/ipmi/kcs_bmc.c:15:0: > ../drivers/char/ipmi/kcs_bmc.h: In function ‘kcs_bmc_priv’: > ../drivers/char/ipmi/kcs_bmc.h:100:9: warning: return discards ‘const’ > qualifier from pointer target type [-Wdiscarded-qualifiers] >   return kcs_bmc->priv; >          ^ -static inline void *kcs_bmc_priv(const struct kcs_bmc *kcs_bmc) +static inline void *kcs_bmc_priv(struct kcs_bmc *kcs_bmc)  <-- Can this fix error on x86_64 ? {     return kcs_bmc->priv; } > In file included from ../include/linux/printk.h:7:0, >                  from ../include/linux/kernel.h:14, >                  from ../include/asm-generic/bug.h:18, >                  from ../arch/x86/include/asm/bug.h:82, >                  from ../include/linux/bug.h:5, >                  from ../include/linux/io.h:23, >                  from ../drivers/char/ipmi/kcs_bmc.c:7: > ../drivers/char/ipmi/kcs_bmc.c: In function ‘kcs_bmc_read’: > ../include/linux/kern_levels.h:5:18: warning: format ‘%u’ expects > argument of type ‘unsigned int’, but argument 3 has type ‘size_t {aka > long unsigned int}’ [-Wformat=] >  #define KERN_SOH "\001"  /* ASCII Start Of Header */ >                   ^ > ../include/linux/kern_levels.h:11:18: note: in expansion of macro > ‘KERN_SOH’ >  #define KERN_ERR KERN_SOH "3" /* error conditions */ >                   ^ > ../include/linux/printk.h:301:9: note: in expansion of macro ‘KERN_ERR’ >   printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__) >          ^ > ../drivers/char/ipmi/kcs_bmc.c:307:3: note: in expansion of macro > ‘pr_err’ >    pr_err("channel=%u with too large data : %u\n", >    ^ https://elinux.org/Debugging_by_printing However please*note*: always use/%zu/,/%zd/or/%zx/for printing/size_t/and/ssize_t/values. ssize_t and size_t are quite common values in the kernel, so please use the/%z/to avoid annoying compile warnings. So I change it from "%u" to "%zu", it is passed on my arm-32 compile, is it OK on your X64 ? pr_err("channel=%u with too large data : %zu\n", > In file included from ../drivers/char/ipmi/kcs_bmc_aspeed.c:20:0: > ../drivers/char/ipmi/kcs_bmc.h: In function ‘kcs_bmc_priv’: > ../drivers/char/ipmi/kcs_bmc.h:100:9: warning: return discards ‘const’ > qualifier from pointer target type [-Wdiscarded-qualifiers] >   return kcs_bmc->priv; >          ^ > > So that needs to be fixed before it goes in. > > Also, since you are respinning, can you make ASPEED_KCS_IPMI_BMC > select IPMI_KCS_BMC, like: > > diff --git a/drivers/char/ipmi/Kconfig b/drivers/char/ipmi/Kconfig > index bc2568a..d34f40e 100644 > --- a/drivers/char/ipmi/Kconfig > +++ b/drivers/char/ipmi/Kconfig > @@ -99,16 +99,11 @@ config IPMI_POWEROFF >  endif # IPMI_HANDLER > >  config IPMI_KCS_BMC > -       tristate 'IPMI KCS BMC Interface' > -       help > -         Provides a device driver for the KCS (Keyboard Controller > Style) > -         IPMI interface which meets the requirement of the BMC > (Baseboard > -         Management Controllers) side for handling the IPMI request from > -         host system software. > +       tristate > >  config ASPEED_KCS_IPMI_BMC >         depends on ARCH_ASPEED || COMPILE_TEST > -       depends on IPMI_KCS_BMC > +       select IPMI_KCS_BMC >         select REGMAP_MMIO >         tristate "Aspeed KCS IPMI BMC driver" >         help > > It doesn't make much sense to have IPMI_KCS_BMC on its own.  I was > going to do this till I saw the compiler error. > Got it, will change it to 'select' > -corey