Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1157784

Re: [PATCH V2 3/9] edac, mce_amd_inj: Modify flags attrigute to use string arguments

Path csiph.com!aioe.org!bofh.it!news.nic.it!robomod
From Aravind Gopalakrishnan <aravind.gopalakrishnan@amd.com>
Newsgroups linux.kernel
Subject Re: [PATCH V2 3/9] edac, mce_amd_inj: Modify flags attrigute to use string arguments
Date Wed, 03 Jun 2015 17:40:03 +0200
Message-ID <pxiVR-5gl-19@gated-at.bofh.it> (permalink)
References <px0YW-3Kj-9@gated-at.bofh.it> <px0YY-3Kj-37@gated-at.bofh.it> <pxij8-4fM-11@gated-at.bofh.it>
X-Original-To Borislav Petkov <bp@alien8.de>
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;
Received-Spf None (protection.outlook.com: amd.com does not designate permitted sender hosts)
X-Wss-ID 0NPDKM5-07-H12-02
User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0
MIME-Version 1.0
Content-Type text/plain; charset="utf-8"; format=flowed
X-Originating-IP [10.180.168.240]
Content-Transfer-Encoding 8BIT
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 <CY1PR02MB1118BC011D16550C00CC5E728AB40@CY1PR02MB1118.namprd02.prod.outlook.com>
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 robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 75
Organization linux.* mail to news gateway
X-Original-Cc <dougthompson@xmission.com>, <mchehab@osg.samsung.com>, <linux-edac@vger.kernel.org>, <linux-kernel@vger.kernel.org>, <x86@kernel.org>
X-Original-Date Wed, 3 Jun 2015 10:34:50 -0500
X-Original-Message-ID <556F1E9A.7030601@amd.com>
X-Original-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>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref aioe.org linux.kernel:1157784

Show key headers only | View raw


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/

Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

Re: [PATCH V2 3/9] edac, mce_amd_inj: Modify flags attrigute to use  string arguments Aravind Gopalakrishnan <aravind.gopalakrishnan@amd.com> - 2015-06-03 17:40 +0200
  Re: [PATCH V2 3/9] edac, mce_amd_inj: Modify flags attrigute to use  string arguments Borislav Petkov <bp@alien8.de> - 2015-06-03 18:10 +0200
    Re: [PATCH V2 3/9] edac, mce_amd_inj: Modify flags attrigute to use  string arguments Aravind Gopalakrishnan <aravind.gopalakrishnan@amd.com> - 2015-06-03 18:30 +0200

csiph-web