Received: by 2002:a25:1104:0:0:0:0:0 with SMTP id 4csp444892ybr; Fri, 22 May 2020 10:15:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzNx+H8Acod4ckDpupf/tvd1GRPlcvaEoLEsy2/OphWGXk0I6EzKRbbZu/dALvDnnWILVFq X-Received: by 2002:a17:906:868f:: with SMTP id g15mr8868385ejx.208.1590167718697; Fri, 22 May 2020 10:15:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590167718; cv=none; d=google.com; s=arc-20160816; b=sGWpjWFZavyffGcssa6vZbn7yv4CdlhtSMv+Ye9BsrM5QtGbM0YHiBk4jftmpiJZxW w6bylkTF22iRlDfbCZn+lSXvEqfJ9UmHCHY8hwYPdt9rzaJGoHp/PfV683yJZzeJ5ApZ NmfFee3ozcQshx1aTFNtNgasxnbSuxdM9ENTIwwPqtMSS0OmN+Ibi0X+9V9mMheL1bpW 5GkGhhBZ3zC0K7+SmCu1rdWIfEoHjv4xG0g1b05j/VM5m3LsXQe8nixj7IJgHck03SGG v2A3wiGFqcLCdPhjssV2qQ0qwIx2MzLI4DexmsuENIUifmW/a1KNETzIH/7CTfkPGAbD BFpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:organization:in-reply-to :content-disposition:mime-version:references:mail-followup-to :message-id:subject:cc:to:from:date; bh=TJnSANQ4xjU/P/GBTPu0yOL/Tq4Kf+5xAf4tduXoZbc=; b=FsYAfn0ktsDETlzK6gdEviXNAdohBIAppG7iW9FmcoKwRYK+Zmctk40XFsg7s6S8VV c8ggzxOKx/wTCf65ivr9wyu8yaB8AGRpdYJtan+snO2ELOF1Qnrj+7izNuQNQ5QDl+xF qAFw3jSc3xgEo01b+XWKpPvxnH5+H5vEmhhqjC+zbSpiqRxH4mLhp7xWm/be0YzQeaTk lJqQLjKmJ8lwYoUfWZK2FgE+vzvL2SI1ZOQckubnOQvG1FmvbCwdfPsdDHUyrCHGvbod h7XXPBMwxMXdYlXSz2reYrJkbcBD01HKqDcxLtCKx1XG5v+RqwnMZz8eO7IgUP6IeDK7 EGFA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f19si5013058eje.519.2020.05.22.10.14.55; Fri, 22 May 2020 10:15:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730774AbgEVRNW (ORCPT + 99 others); Fri, 22 May 2020 13:13:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51280 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730536AbgEVRNV (ORCPT ); Fri, 22 May 2020 13:13:21 -0400 Received: from hera.aquilenet.fr (hera.aquilenet.fr [IPv6:2a0c:e300::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8A8B1C061A0E for ; Fri, 22 May 2020 10:13:21 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 69A153968; Fri, 22 May 2020 19:13:17 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id xn3rcvaificZ; Fri, 22 May 2020 19:13:15 +0200 (CEST) Received: from function (unknown [IPv6:2a01:cb19:956:1b00:9eb6:d0ff:fe88:c3c7]) by hera.aquilenet.fr (Postfix) with ESMTPSA id 7B3002E76; Fri, 22 May 2020 19:13:15 +0200 (CEST) Received: from samy by function with local (Exim 4.93) (envelope-from ) id 1jcBEO-00HA74-1l; Fri, 22 May 2020 19:13:12 +0200 Date: Fri, 22 May 2020 19:13:12 +0200 From: Samuel Thibault To: Joe Perches Cc: Dan Carpenter , MugilRaj , devel@driverdev.osuosl.org, Kirk Reiser , Greg Kroah-Hartman , speakup@linux-speakup.org, linux-kernel@vger.kernel.org, Chris Brannon Subject: Re: [PATCH] taging: speakup: remove volatile Message-ID: <20200522171312.s2ciifuxozwav2ym@function> Mail-Followup-To: Samuel Thibault , Joe Perches , Dan Carpenter , MugilRaj , devel@driverdev.osuosl.org, Kirk Reiser , Greg Kroah-Hartman , speakup@linux-speakup.org, linux-kernel@vger.kernel.org, Chris Brannon References: <1590138989-6091-1-git-send-email-dmugil2000@gmail.com> <20200522103406.GK30374@kadam> <6ab4139ec78928961a19e5fdbda139bb8cff9cb5.camel@perches.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6ab4139ec78928961a19e5fdbda139bb8cff9cb5.camel@perches.com> Organization: I am not organized User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Joe Perches, le ven. 22 mai 2020 09:36:05 -0700, a ecrit: > On Fri, 2020-05-22 at 13:34 +0300, Dan Carpenter wrote: > > On Fri, May 22, 2020 at 02:46:28PM +0530, MugilRaj wrote: > > > fix checkpatch.pl warning, which is Use of volatile is usually wrong: see > > > Documentation/process/volatile-considered-harmful.rst > > > Signed-off-by: MugilRaj > > > > Please put a blank before the Signed-off-by line. > > > > Probably there should be a space between your first and last name. It's > > supposed to your legal name like for signing a legal document so use > > whatever is appropriate legal documents in your country. > > > > Also the Documentation/process/volatile-considered-harmful.rst explains > > that people often use "volatile" when they should be using locking for > > synchronization. That seems to be the case here. So the correct fix is > > to add locking. That's a little bit complicated to do and requires > > testing. > > > > If we apply this patch, then we have silenced the warning so now someone > > will have to look for the bug. But if we leave it as-is, then everyone > > will know that the code is buggy. So let's leave it as-is until we are > > able to fix the bug. > > > > It's always better to have easy to find bugs, than hidden bugs. > > And better still to comment known opportunities to > improve the code so the next time someone tries to > remove this volatile, there's a comment right there > showing what's necessary instead. Actually I don't think adding the suggestion is a good thing if it's only a "rule-of-thumb-replace-volatile-with-lock". Actually possibly volatile might not even be needed because there could be already a lock protecting this. Put another way: I don't think putting any hint here would help, on the contrary, somebody has to really look at what protection is needed, without getting influenced by rules-of-thumb. Samuel