Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp1239828iob; Fri, 29 Apr 2022 00:21:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxCLSmOPx7/yjwoGbc6gfeeq9WjVBNL2VO0yMqQw7fz/SeBNV9gr19zVwLZX79Jxymst/y2 X-Received: by 2002:a17:90a:fd85:b0:1d9:6281:d158 with SMTP id cx5-20020a17090afd8500b001d96281d158mr2369435pjb.187.1651216872032; Fri, 29 Apr 2022 00:21:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651216872; cv=none; d=google.com; s=arc-20160816; b=JzuT3yUmUvR1JW31P83WZZnaW6jkRXnM6Abx8bcofMPO+1g/7qwL3YULVCWn0ID2im YLMd+b/nkK6mLliMeGSxgLKEwHrcry7d02EFULO6tqN6ehzJ9SxiNgSjtXEO7k1OiRQ3 +1w4rDMcUxNheUpeNM+XOpFJj7E1RQWA7WEAfEJ9qq6fHTVZChyu5b3Rihi5gJoiA3/k NpHYwDbyKSKQFh3y8yEf5QPXC/YT+b0uZGG5GP+BbdKybwvCXS2HPvm9qoj/MO398BAW 2udrySUXEvzIqO7Cp1qRj0cyciC9QqQB1wOE554/bWi+5t/cY4MneJBtKsXxkvhtajw2 Ot2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:content-transfer-encoding:in-reply-to :from:references:cc:to:content-language:user-agent:mime-version:date :message-id:dkim-signature; bh=gvJz6sqFlaEQGD6lcXzp69sVdGtInkBQvjRmlLbR5ak=; b=Cdfou1X5xk2hrUo5iXQprxTJ9a5wz7UGuahvSHStsVZKwCBvZzy+K1GVbbxyllMZnA nZj1L/350arW65vs36oxN9cvK34aoG3yZ/YkrBErwquC6Nq34bHWkdreaPFmk+k0dZPL RFMeKk+t7eIFAo1Y0rMrOTz5haqJMIP1PI6htbcxKUViib9ahVEqX5dz0FoilxN0UDIO 0hnTIcD6WGaawk0fTCLKUtYFe1OrJ6OS3mRv2PPJzX+FJgceTLylOEXEKtMkFICRU6tG mQ8k+opIwNZ5MMADlpVD1k6ZbflL55s9XLpY9iu3ZZjtGvmNIGGKGn3LI3CaFmYAlF94 goTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@deltatee.com header.s=20200525 header.b=qixCMonD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=deltatee.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s14-20020a63770e000000b003ab0293ef20si6632256pgc.834.2022.04.29.00.20.57; Fri, 29 Apr 2022 00:21:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@deltatee.com header.s=20200525 header.b=qixCMonD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=deltatee.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349593AbiD1PsQ (ORCPT + 99 others); Thu, 28 Apr 2022 11:48:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43320 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234445AbiD1PsO (ORCPT ); Thu, 28 Apr 2022 11:48:14 -0400 Received: from ale.deltatee.com (ale.deltatee.com [204.191.154.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D6B27B82FF; Thu, 28 Apr 2022 08:44:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=deltatee.com; s=20200525; h=Subject:In-Reply-To:From:References:Cc:To: MIME-Version:Date:Message-ID:content-disposition; bh=gvJz6sqFlaEQGD6lcXzp69sVdGtInkBQvjRmlLbR5ak=; b=qixCMonDiIRsFDEpSRl3891/1+ tT/M5WDnhgOwXTofaaBSbmdRZkWUZwhxQt7z7IDqZJGYA99f38sgg8P2Is/MdpUYmjEKkIU/9F86G tMJdqmvH5U60F+heJPUJGBVT2y5SsbDYGZRkjELobUZBkmD1Omz84wWQRvXldlJKn1hh46AiNwUOg Uk0gI2cCDuVjKiwZNTY5A6cinBUmW+lwvZxALpaKsLQiBaz6YX4jpwaOopZKI6kXqMe3lw9bf6ijb WYjNp6k8jPTVEk7y2+aq7EfskukWBDCSgzKofs0k22wOFZaS5Kw/s8Ou7im/cPkS4iMouxx+lHsvn Mm2JMvlw==; Received: from s0106a84e3fe8c3f3.cg.shawcable.net ([24.64.144.200] helo=[192.168.0.10]) by ale.deltatee.com with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1nk6K6-001693-Ci; Thu, 28 Apr 2022 09:44:56 -0600 Message-ID: <78a6ffae-7701-e0dd-3130-a9a95473d16b@deltatee.com> Date: Thu, 28 Apr 2022 09:44:52 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 Content-Language: en-CA To: Guoqing Jiang , linux-kernel@vger.kernel.org, linux-raid@vger.kernel.org, Song Liu Cc: Christoph Hellwig , Stephen Bates , Martin Oliveira , David Sloan , Christoph Hellwig References: <20220420195425.34911-1-logang@deltatee.com> <20220420195425.34911-2-logang@deltatee.com> <2a6d5554-4f71-6476-6d14-031da52005f5@linux.dev> <19d88098-7e52-38de-ceb7-a68debfbbd10@linux.dev> From: Logan Gunthorpe In-Reply-To: <19d88098-7e52-38de-ceb7-a68debfbbd10@linux.dev> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 24.64.144.200 X-SA-Exim-Rcpt-To: guoqing.jiang@linux.dev, linux-kernel@vger.kernel.org, linux-raid@vger.kernel.org, song@kernel.org, hch@infradead.org, sbates@raithlin.com, Martin.Oliveira@eideticom.com, David.Sloan@eideticom.com, hch@lst.de X-SA-Exim-Mail-From: logang@deltatee.com X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_PASS, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 Subject: Re: [PATCH v2 01/12] md/raid5: Factor out ahead_of_reshape() function X-SA-Exim-Version: 4.2.1 (built Sat, 13 Feb 2021 17:57:42 +0000) X-SA-Exim-Scanned: Yes (on ale.deltatee.com) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2022-04-27 19:49, Guoqing Jiang wrote: > > > On 4/28/22 12:07 AM, Logan Gunthorpe wrote: >> >> On 2022-04-26 19:28, Guoqing Jiang wrote: >>>>    +static bool ahead_of_reshape(struct mddev *mddev, sector_t sector, >>>> +                 sector_t reshape_sector) >>>> +{ >>>> +    if (mddev->reshape_backwards) >>>> +        return sector < reshape_sector; >>>> +    else >>>> +        return sector >= reshape_sector; >>>> +} >>> I think it can be an inline function. >> Marking static functions in C files as inline is not recommended. GCC >> will inline it, if it is appropriate. >> >> https://yarchive.net/comp/linux/inline.html >> https://www.kernel.org/doc/local/inline.html > > Thanks for the link, then I suppose those can be deleted > linux> grep "static inline" drivers/md/md.h -r It's standard practice to annotate small functions in headers with "static inline". Without the inline annotation, any C file that includes the header and doesn't use the function will emit a "defined but not used warning". Functions in headers also should, by definition, be small and specifically inline-able (ie they are used as a type-safe macro). static functions in C files (not headers) should not have the inline keyword as GCC can optimize them and inline them as it sees fit and the inline keyword doesn't actually do anything. Logan