From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A4C79C433B4 for ; Sat, 10 Apr 2021 08:59:58 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 22862610F9 for ; Sat, 10 Apr 2021 08:59:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 22862610F9 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linuxfoundation.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=osbMueCRD9gF0yeLL6Z7ax0l1qhKgyRSIDA6ARJZyUg=; b=RII2zRom2VMciSV479NsVWTUS chdYSfUFuDnbgcOOYdFZVA/jYAkV9eTXQ0lC9zRuTr78GGGKp3yr7Iuj6SnXK/jk6RQXAzrPqoFWf xtaCfK1YQwuGJHB2WqF9dO4V7V7gNianP46POsnWtG5hSYMsM2gcJ1HH/2LjKkSF36nqPVvGpVHUC nLhhHcNNJ/sG7nJm8t4riigl4vaoxhuN9yesg2kujdFzPVKJC60odhlxDUkZM4JUi330zKG14ebWi SWJmRG8X+n1UTCqqAQipp6d1vEaH1qcr+SwW4+8Xl2FGJ3A9ErCehsJJPm+pmVm6ZZN5lIMkDxlci bQy7aR9ZA==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lV9Ra-002Tia-Vy; Sat, 10 Apr 2021 08:58:19 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lV9RY-002TiT-Ed for linux-arm-kernel@desiato.infradead.org; Sat, 10 Apr 2021 08:58:16 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=D1COFL81gbTyEWNV23bCXO3s6TIVorn1SdT9XgqW0Fs=; b=f+rr1UZKFf4AreSh+soAoYBT6/ R5/lnGoBxEAZZr7TJPu0OYgImtrPWM7dCrNZLL1hWmLpgGIiAMk/iL/IsnFZMWpJ7Bknd3IQXqsiv P5+StrzWnmgOLMwtc4x63V4A5xrf6l2GrP3rdDhrRGsOi45eTc27BV2Sfrc4Np5F2IUmxCIQOjRm5 +P7dQdT4kDxvuG25wNhcZ6V6EokIkQbWqVkI0TzIXSfjKWDdR10nv4xpUavIqGsvZ1bVB16a1janR GYVPxosRURymh1JIbjxdMBAorPudMZJF0u57ElEt+AYRMOaZOE9jlhh/zGpjTawwAXV+Ml+w/T/2c QrbJFPJg==; Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lV9RV-00500g-PN for linux-arm-kernel@lists.infradead.org; Sat, 10 Apr 2021 08:58:14 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3442B610CD; Sat, 10 Apr 2021 08:58:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1618045091; bh=MDEEwk4xA/g1bJh/pmzvQ0+agfOwNiIO6s3rDzG0Qto=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=bPIa4aGlWfNtEkXQxsAdoz/WId69zqC0oZitbP9+tg0T//tW4WtZ44t8D1nC8zgAu vB6WBG3pe0ic4WWXy+PrY7jjEYABBQkxsq/prU8n6YCaPvDmwZGOg3FYu8+0TODNX4 rMG8JYTVG18bq2RdgKN4s7f72Zma97HSygSgXxec= Date: Sat, 10 Apr 2021 10:58:09 +0200 From: Greg Kroah-Hartman To: Ye Bin Cc: Arnd Bergmann , Michal Simek , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Hulk Robot Subject: Re: [PATCH -next] char: xilinx_hwicap: use DEFINE_MUTEX() for mutex lock Message-ID: References: <20210409095136.2293754-1-yebin10@huawei.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210409095136.2293754-1-yebin10@huawei.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210410_015813_861491_24643220 X-CRM114-Status: GOOD ( 16.26 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Apr 09, 2021 at 05:51:36PM +0800, Ye Bin wrote: > mutex lock can be initialized automatically with DEFINE_MUTEX() > rather than explicitly calling mutex_init(). > > Reported-by: Hulk Robot > Signed-off-by: Ye Bin > --- > drivers/char/xilinx_hwicap/xilinx_hwicap.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/drivers/char/xilinx_hwicap/xilinx_hwicap.c b/drivers/char/xilinx_hwicap/xilinx_hwicap.c > index 067396bedf22..4d586233dfa4 100644 > --- a/drivers/char/xilinx_hwicap/xilinx_hwicap.c > +++ b/drivers/char/xilinx_hwicap/xilinx_hwicap.c > @@ -111,7 +111,7 @@ > /* An array, which is set to true when the device is registered. */ > static DEFINE_MUTEX(hwicap_mutex); > static bool probed_devices[HWICAP_DEVICES]; > -static struct mutex icap_sem; > +static DEFINE_MUTEX(icap_sem); > > static struct class *icap_class; > > @@ -857,7 +857,6 @@ static int __init hwicap_module_init(void) > int retval; > > icap_class = class_create(THIS_MODULE, "xilinx_config"); > - mutex_init(&icap_sem); > > devt = MKDEV(XHWICAP_MAJOR, XHWICAP_MINOR); > retval = register_chrdev_region(devt, > What actually does this help out with? Why is it wrong to explicitly call mutex_init() instead of a magic macro? What good are these changes causing? thanks, greg k-h _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel