Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3562471imm; Tue, 29 May 2018 09:17:23 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqZoEuzEAmn8nIZibvcKO8tG2dE5XChD1F1MDYFjDEo0Mq7URzaDDzU/WzHt2uAhz9DZoO4 X-Received: by 2002:a17:902:5959:: with SMTP id e25-v6mr18374910plj.351.1527610643767; Tue, 29 May 2018 09:17:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527610643; cv=none; d=google.com; s=arc-20160816; b=uht0VBGEqXnyKwyjikI5JOmDNwkBdlZNEQLmxnAoNdZyBShGjZKmmLjlnZf4m7IPR+ UnrZTqtMKMehlEPb7NFS4AxwGaeprJM/h7fVTs8Yc8RoDrTpnQ3ILch+ND+RLabjmFke pNXr9HCmJ6C9JbbXY6zX2uHCsJPd91DyYmdBAze7kVU9wYOqZzb1vyqiJdGSJBp1Pes0 5inV8kZpVzbSoe5kADAFI1FdlkMGWCvS/VrjWcVhIKfV1zJmJ8yPVdkoiNKsPAzmL2Bo zZg8LrsTCncutcQTjueeWV4vOMdUFVeFRTb8TmNYgwS89MeBzNagdKq7zoFx0ZISBcou eA6g== 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:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id :arc-authentication-results; bh=mma5m2NNeE++T51+/rjNKaJJToTuYeea3paatADyG08=; b=Ab2wO5MWCf0HRObhuKqhCKZR1vt61DPLPe6EFgqD7weWR49q3H4eg6JD0JSKsxB+FF vV7N2AgHg53AGhyCG+crkfZv5ezhH55KVwW43CKB0TF5mL4OfeMZIBC7OXN2W+EJ/7vx FXxov6qgNBTseUoRDP+iO8HB8GRZ8gDTYCzWj8o0sV+pci9xYRXSYzVKE/X/kMMJwi+A zZJ1BlHQ1m3WQRdQrNIjooLTdfRdVtLqUPT3pGDkQD1ZQKkrEKhqLCHd474VvSZRxFqy KC0DXCNjDq/9tl3V7nF3KvSJ1mZMQRmjqw8XFNV8CGOycX8sBos8+sH2COi3U7xTTNEx nPdg== 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 b67-v6si33252317plb.262.2018.05.29.09.17.10; Tue, 29 May 2018 09:17:23 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964830AbeE2QP1 (ORCPT + 99 others); Tue, 29 May 2018 12:15:27 -0400 Received: from smtprelay0018.hostedemail.com ([216.40.44.18]:43394 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S934877AbeE2QP0 (ORCPT ); Tue, 29 May 2018 12:15:26 -0400 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay06.hostedemail.com (Postfix) with ESMTP id C945C182251B2; Tue, 29 May 2018 16:15:25 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::::::::::,RULES_HIT:41:355:379:541:599:800:960:968:973:988:989:1260:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1542:1593:1594:1711:1730:1747:1777:1792:2197:2199:2393:2553:2559:2562:2828:2894:3138:3139:3140:3141:3142:3354:3622:3653:3865:3866:3868:3870:3871:3872:3873:3874:4321:4823:5007:7904:10004:10400:10848:10967:11026:11232:11473:11658:11914:12043:12114:12296:12438:12555:12740:12895:13180:13229:13439:13894:14181:14659:14721:21080:21221:21611:21627:30012:30051:30054:30070:30075:30079:30090:30091,0,RBL:error,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:20,LUA_SUMMARY:none X-HE-Tag: salt44_4c2afb6f9124d X-Filterd-Recvd-Size: 3524 Received: from XPS-9350 (unknown [172.56.41.112]) (Authenticated sender: joe@perches.com) by omf11.hostedemail.com (Postfix) with ESMTPA; Tue, 29 May 2018 16:15:23 +0000 (UTC) Message-ID: <0ccd6834d0c4a24f351050d0cd7581e2d2aecd7c.camel@perches.com> Subject: Re: [PATCH] powerpc/64s: Enhance the information in cpu_show_spectre_v1() From: Joe Perches To: Christophe Leroy , Michal =?ISO-8859-1?Q?Such=E1nek?= Cc: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Mauricio Faria de Oliveira , Nicholas Piggin , Michael Neuling , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Date: Tue, 29 May 2018 09:15:21 -0700 In-Reply-To: <59492aa2-a12d-4f74-0a5a-14f89de64908@c-s.fr> References: <20180424041559.32410-1-mpe@ellerman.id.au> <20180528131914.32231-1-msuchanek@suse.de> <1b720765-faf1-719e-ab76-b3eafa559896@c-s.fr> <20180529164640.02faedcd@kitsune.suse.cz> <59492aa2-a12d-4f74-0a5a-14f89de64908@c-s.fr> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.28.1-2 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2018-05-29 at 15:24 +0000, Christophe Leroy wrote: > On 05/29/2018 02:46 PM, Michal Such?nek wrote: > > On Tue, 29 May 2018 16:13:49 +0200 Christophe LEROY wrote: [] > > diff --git a/arch/powerpc/kernel/security.c > > > > b/arch/powerpc/kernel/security.c index 0239383c7e4d..a0c32d53980b > > > > 100644 --- a/arch/powerpc/kernel/security.c > > > > +++ b/arch/powerpc/kernel/security.c > > > > @@ -120,7 +120,10 @@ ssize_t cpu_show_spectre_v1(struct device > > > > *dev, struct device_attribute *attr, c if > > > > (!security_ftr_enabled(SEC_FTR_BNDS_CHK_SPEC_BAR)) return > > > > sprintf(buf, "Not affected\n"); > > > > - return sprintf(buf, "Vulnerable\n"); > > > > + if (barrier_nospec_enabled) > > > > + return sprintf(buf, "Mitigation: __user pointer > > > > sanitization\n"); > > > > + else > > > > + return sprintf(buf, "Vulnerable\n"); > > > > > > Checkpatch would tell you that an else is unneeded after a return. So > > > just leave it as it was before. > > > > Where did you get your copy of checkpatch? The one in Linux tree does > > not do that. Correct as this particular style is a maintainer preference. > Strange, it should, as checkpatch.pl includes the following code: > > # check indentation of any line with a bare else > # (but not if it is a multiple line "if (foo) return bar; else return baz;") Note this comment and also that this case is if (foo) return bar; else return baz; so no warning is generated. > # if the previous line is a break or return and is indented 1 tab more... > if ($sline =~ /^\+([\t]+)(?:}[ \t]*)?else(?:[ \t]*{)?\s*$/) { > my $tabs = length($1) + 1; > if ($prevline =~ /^\+\t{$tabs,$tabs}break\b/ || > ($prevline =~ /^\+\t{$tabs,$tabs}return\b/ && > defined $lines[$linenr] && > $lines[$linenr] !~ /^[ \+]\t{$tabs,$tabs}return/)) { > WARN("UNNECESSARY_ELSE", > "else is not generally useful after a break or return\n" . > $hereprev); > } > } > > > Anyway, you should remove that 'else' in your patch. > And the other sprintf line is over 80 characters. > > Christophe > > > > > Thanks > > > > Michal > >