Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754245AbbFCPfG (ORCPT ); Wed, 3 Jun 2015 11:35:06 -0400 Received: from mail-by2on0120.outbound.protection.outlook.com ([207.46.100.120]:19328 "EHLO na01-by2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751680AbbFCPe6 convert rfc822-to-8bit (ORCPT ); Wed, 3 Jun 2015 11:34:58 -0400 Authentication-Results: spf=none (sender IP is 165.204.84.221) smtp.mailfrom=amd.com; alien8.de; dkim=none (message not signed) header.d=none; X-WSS-ID: 0NPDKM5-07-H12-02 X-M-MSG: Message-ID: <556F1E9A.7030601@amd.com> Date: Wed, 3 Jun 2015 10:34:50 -0500 From: Aravind Gopalakrishnan User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Borislav Petkov CC: , , , , Subject: Re: [PATCH V2 3/9] edac, mce_amd_inj: Modify flags attrigute to use string arguments References: <1433277362-10911-1-git-send-email-Aravind.Gopalakrishnan@amd.com> <1433277362-10911-4-git-send-email-Aravind.Gopalakrishnan@amd.com> <20150603145001.GL4403@pd.tnic> In-Reply-To: <20150603145001.GL4403@pd.tnic> Content-Type: text/plain; charset="utf-8"; format=flowed X-Originating-IP: [10.180.168.240] Content-Transfer-Encoding: 8BIT X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1;BL2FFO11FD053;1:77NwcWLn63ETG4CWKPg9+IIjyrng+4QB709rn2cgF9OUM8xLcoqR9GldfJ91Gp3eFp8NfJjzTNquBYam5FkEeuWM7e9MnXyCSFELPLbdxaen5It8mnHxa9Kkti3WvhhJPiWQSCGgNSyLanQDrofFH2rfqQaTOatktrEEYFBuE0aHSJGr3HitydeewEa9Kqvq7gWeczqM4W/F+MW4Hvh0MDMbsPXbvdtCxBM2a0PhrGl9MqzV4bFG5ue4+eunLYfZnMyXtd2y8LuCNFkbF3lIzw== X-Forefront-Antispam-Report: CIP:165.204.84.221;CTRY:US;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10019020)(6009001)(428002)(52604005)(24454002)(479174004)(377454003)(51704005)(189002)(199003)(77096005)(68736005)(65806001)(2950100001)(105586002)(36756003)(62966003)(77156002)(97736004)(59896002)(4001540100001)(4001350100001)(106466001)(83506001)(23676002)(87266999)(189998001)(64126003)(76176999)(33656002)(50986999)(65816999)(92566002)(46102003)(47776003)(5001860100001)(5001920100001)(5001830100001)(110136002)(120886001)(87936001)(80316001)(86362001)(54356999)(19580395003)(50466002)(65956001)(64706001)(101416001);DIR:OUT;SFP:1102;SCL:1;SRVR:CY1PR02MB1118;H:atltwp01.amd.com;FPR:;SPF:None;PTR:InfoDomainNonexistent;MX:1;A:1;LANG:en; X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CY1PR02MB1118; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(520003)(5005006)(3002001);SRVR:CY1PR02MB1118;BCL:0;PCL:0;RULEID:;SRVR:CY1PR02MB1118; X-Forefront-PRVS: 05961EBAFC X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Jun 2015 15:34:55.6058 (UTC) X-MS-Exchange-CrossTenant-Id: fde4dada-be84-483f-92cc-e026cbee8e96 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=fde4dada-be84-483f-92cc-e026cbee8e96;Ip=[165.204.84.221];Helo=[atltwp01.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR02MB1118 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2125 Lines: 75 On 6/3/2015 9:50 AM, Borislav Petkov wrote: > On Tue, Jun 02, 2015 at 03:35:56PM -0500, Aravind Gopalakrishnan wrote: > > >> + >> + buf[cnt - 1] = 0; >> + >> + /* strip whitespaces.. */ >> + strstrip(buf); > Didn't your compiler trigger that: > > drivers/edac/mce_amd_inj.c: In function ‘flags_write’: > drivers/edac/mce_amd_inj.c:146:2: warning: ignoring return value of ‘strstrip’, declared with attribute warn_unused_result [-Wunused-result] > strstrip(buf); > ^ > > ? Oddly, No. The only thing I got was: arch/x86/kernel/cpu/microcode/intel_early.c: In function âget_matching_model_microcode.isra.2.constprop.7â: arch/x86/kernel/cpu/microcode/intel_early.c:348:1: warning: the frame size of 1064 bytes is larger than 1024 bytes [-Wframe-larger-than=] } ^ > > Because it is a valid warning. You need to take the return value. I > fixed it up like this: Thanks for fixing it. -Aravind. > --- > diff --git a/drivers/edac/mce_amd_inj.c b/drivers/edac/mce_amd_inj.c > index c129a8da34b2..5c847fe6e9bd 100644 > --- a/drivers/edac/mce_amd_inj.c > +++ b/drivers/edac/mce_amd_inj.c > @@ -128,7 +128,7 @@ static ssize_t flags_read(struct file *filp, char __user *ubuf, > static ssize_t flags_write(struct file *filp, const char __user *ubuf, > size_t cnt, loff_t *ppos) > { > - char buf[MAX_FLAG_OPT_SIZE]; > + char buf[MAX_FLAG_OPT_SIZE], *__buf; > int err; > size_t ret; > > @@ -142,12 +142,12 @@ static ssize_t flags_write(struct file *filp, const char __user *ubuf, > > buf[cnt - 1] = 0; > > - /* strip whitespaces.. */ > - strstrip(buf); > + /* strip whitespace */ > + __buf = strstrip(buf); > > - err = __set_inj(buf); > + err = __set_inj(__buf); > if (err) { > - pr_err("%s: Invalid flags value: %s\n", __func__, buf); > + pr_err("%s: Invalid flags value: %s\n", __func__, __buf); > return err; > } > > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/