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=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no 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 E1B34C433B4 for ; Thu, 22 Apr 2021 06:35:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A2F986144D for ; Thu, 22 Apr 2021 06:35:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234909AbhDVGfe (ORCPT ); Thu, 22 Apr 2021 02:35:34 -0400 Received: from mga05.intel.com ([192.55.52.43]:7070 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229655AbhDVGfd (ORCPT ); Thu, 22 Apr 2021 02:35:33 -0400 IronPort-SDR: +wiVnhqi3qWiQpkMQRa6OnEdSRjlXeMCw/bs+ArZELeQvzxf2bi4+p4ICZ54RVGDW0Qh/g4Oux nZB1SBaM85iA== X-IronPort-AV: E=McAfee;i="6200,9189,9961"; a="281164951" X-IronPort-AV: E=Sophos;i="5.82,241,1613462400"; d="scan'208";a="281164951" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Apr 2021 23:34:58 -0700 IronPort-SDR: N/VdHPgKMmnCktx4S1kk0xv2cVIku/kjvc542q4RO5SjiE13e4jhIuMmjIFzPAycFgCO8IQ/Tx lru/cqQLORNw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,241,1613462400"; d="scan'208";a="453172193" Received: from um.fi.intel.com (HELO um) ([10.237.72.62]) by FMSMGA003.fm.intel.com with ESMTP; 21 Apr 2021 23:34:56 -0700 From: Alexander Shishkin To: Yu Kuai , mcoquelin.stm32@gmail.com, alexandre.torgue@foss.st.com Cc: linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, yukuai3@huawei.com, yi.zhang@huawei.com, zhangxiaoxu5@huawei.com, alexander.shishkin@linux.intel.com Subject: Re: [PATCH] stm class: initialize static variable in declaration In-Reply-To: <20210407125358.4135345-1-yukuai3@huawei.com> References: <20210407125358.4135345-1-yukuai3@huawei.com> Date: Thu, 22 Apr 2021 09:34:55 +0300 Message-ID: <87o8e6esj4.fsf@ashishki-desk.ger.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Yu Kuai writes: > mutex lock can be initialized automatically with DEFINE_MUTEX() > rather than explicitly calling mutex_init(). > > list head can be initialized automatically with LIST_HEAD() rather > than explicitly calling INIT_LIST_HEAD(). > > srcu_struct can be initialized automatically with DEFINE_STATIC_SRCU() > rather than explicitly calling init_srcu_struct(). What's missing is the "why". We can do these or we can keep them as they are. Each choice has impact on .text/.data, for instance. Why is one preferred over the other? Each patch should contain some form of analysis that shows that the author thought about why they made the patch in the first place. And please learn not to spam the STMicro people with patches for System Trace Module. Sometimes the same acronym can mean multiple different things. This is another sign that the patch author spent zero time getting to know the code that they are patching. Regards, -- Alex 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=-3.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no 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 6753EC433B4 for ; Thu, 22 Apr 2021 06:37:09 +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 0203861424 for ; Thu, 22 Apr 2021 06:37:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0203861424 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com 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:MIME-Version:Message-ID:Date:References:In-Reply-To: Subject:Cc:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Y/mDPhFXdBSOf8nNezsvAwgMAUv0JlIFK7SVyPu+N1A=; b=nChSwDdvssut5MisOcGidRC37 0MR16dsRjQTIMm4YZIdQACvwBhvVXaKQt0flpIjpHK3ocOaW2rJX5ZeV7dzw3XnCNw3COhUXiO61c tXiD7qgrT1TVWMD00SM5W3D4h1TcayZkXrV6J/8w8jY4bcWYkZA1LjFIBjZYou+sL2GzLuUIVyO3z Y7cU5Y7nYe+O5ej7tLSIPJgf+VsSDz3TvdCH5G36krP7DwYTUZsDTg/6eOroPiwP5whI9WQGMUSnr Vl/oR1EcP+n24iYKkjDKXeXPhhyg0tDIjJbFxDt/l1UQzgou9MvqKlQDTP8u3IDSyRV5a0V481yer +VtYD0Wsw==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lZSvh-00G1BV-Vm; Thu, 22 Apr 2021 06:35:14 +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 1lZSvc-00G1B7-LA for linux-arm-kernel@desiato.infradead.org; Thu, 22 Apr 2021 06:35:08 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Type:MIME-Version:Message-ID: Date:References:In-Reply-To:Subject:Cc:To:From:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=0z5ImEcxsoG30pm6Oe1GxwLpNovH9t72xk62XiWWAE8=; b=GVBg3+bW2WLdC+WTO67hzgBiVm 61xqCw9iIS80tCXPhy1QkP9VLrX4/UG0ixdQX0AFlEJDpY537BxW5S5Buu4wc4E9OEwjZSGSgh7IM DoLzluZM1PKAwUk2e8HNjFD8sU6pJe11LuSxgI8cljhUMlwGCFjta8AJ0TScTDAM7/HxuPF35T1eJ 3zj6KbNUigNHQpWmo6ISToXJHhG9FC74pQbjdqU5kKCxxq1g2w8M0hXz0FF2pSJy4NkxnO4jCt0Fv U5DeofOGjxdziUHED+KafhefeIT+dz2URg0n+LTTpMjvS4Hy6lH8XMSXMMTuZmcPw7td1qACvVEBq NYKN9gCg==; Received: from mga01.intel.com ([192.55.52.88]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lZSvW-00DPpg-Me for linux-arm-kernel@lists.infradead.org; Thu, 22 Apr 2021 06:35:07 +0000 IronPort-SDR: nFEWTZGppTb1y3S8PXAmcvmPUDxdG1LUgBOu+M8qJ7XQzIn5Pg1UfsWeVJsebGZYU/HCQafmNA QB5A+Wtsj9HA== X-IronPort-AV: E=McAfee;i="6200,9189,9961"; a="216498821" X-IronPort-AV: E=Sophos;i="5.82,241,1613462400"; d="scan'208";a="216498821" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Apr 2021 23:34:58 -0700 IronPort-SDR: N/VdHPgKMmnCktx4S1kk0xv2cVIku/kjvc542q4RO5SjiE13e4jhIuMmjIFzPAycFgCO8IQ/Tx lru/cqQLORNw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,241,1613462400"; d="scan'208";a="453172193" Received: from um.fi.intel.com (HELO um) ([10.237.72.62]) by FMSMGA003.fm.intel.com with ESMTP; 21 Apr 2021 23:34:56 -0700 From: Alexander Shishkin To: Yu Kuai , mcoquelin.stm32@gmail.com, alexandre.torgue@foss.st.com Cc: linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, yukuai3@huawei.com, yi.zhang@huawei.com, zhangxiaoxu5@huawei.com, alexander.shishkin@linux.intel.com Subject: Re: [PATCH] stm class: initialize static variable in declaration In-Reply-To: <20210407125358.4135345-1-yukuai3@huawei.com> References: <20210407125358.4135345-1-yukuai3@huawei.com> Date: Thu, 22 Apr 2021 09:34:55 +0300 Message-ID: <87o8e6esj4.fsf@ashishki-desk.ger.corp.intel.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210421_233502_774112_DE9D7264 X-CRM114-Status: GOOD ( 11.23 ) 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 Yu Kuai writes: > mutex lock can be initialized automatically with DEFINE_MUTEX() > rather than explicitly calling mutex_init(). > > list head can be initialized automatically with LIST_HEAD() rather > than explicitly calling INIT_LIST_HEAD(). > > srcu_struct can be initialized automatically with DEFINE_STATIC_SRCU() > rather than explicitly calling init_srcu_struct(). What's missing is the "why". We can do these or we can keep them as they are. Each choice has impact on .text/.data, for instance. Why is one preferred over the other? Each patch should contain some form of analysis that shows that the author thought about why they made the patch in the first place. And please learn not to spam the STMicro people with patches for System Trace Module. Sometimes the same acronym can mean multiple different things. This is another sign that the patch author spent zero time getting to know the code that they are patching. Regards, -- Alex _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel