Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751431AbdFZJQu (ORCPT ); Mon, 26 Jun 2017 05:16:50 -0400 Received: from mail-vk0-f48.google.com ([209.85.213.48]:36833 "EHLO mail-vk0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751353AbdFZJQo (ORCPT ); Mon, 26 Jun 2017 05:16:44 -0400 MIME-Version: 1.0 In-Reply-To: References: <1498455936-2108-1-git-send-email-abdallah.meziti.pro@gmail.com> From: Frans Klaver Date: Mon, 26 Jun 2017 11:16:42 +0200 Message-ID: Subject: Re: [PATCH] staging: sm750fb: always take the lock To: Geert Uytterhoeven Cc: AbdAllah-MEZITI , Sudip Mukherjee , Teddy Wang , Greg Kroah-Hartman , Linux Fbdev development list , driverdevel , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 668 Lines: 20 On Mon, Jun 26, 2017 at 11:11 AM, Geert Uytterhoeven wrote: > On Mon, Jun 26, 2017 at 7:45 AM, AbdAllah-MEZITI > wrote: >> This patch >> - will always take the lock > > Why? > > "The current code only takes the lock if multiple instances are in use. > This is error-prone, and confuses static analyzers. > As taking the lock in case of a single instance is harmful and cheap, > change the code to always take the lock." I would argue that it's not harmful, lest people get confused about it. And I agree that this explanation is much more useful than just mentioning the warnings that you saw. Thanks, Frans