Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp2128427ybz; Thu, 23 Apr 2020 12:05:40 -0700 (PDT) X-Google-Smtp-Source: APiQypKyoRbXAhoDYTCfyybZswAE3uEyjn91bu2ztZHiTe3KTKZ9eDcNeOFN1xNUV7JfUR9K+ce/ X-Received: by 2002:a05:6402:686:: with SMTP id f6mr4256053edy.136.1587668740395; Thu, 23 Apr 2020 12:05:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587668740; cv=none; d=google.com; s=arc-20160816; b=sLn1MJaTt0aEdkjmxJtc0VE0DL9kY8/NB0Rqs73UkwmDipV68pXFoaSHkrhTSKfah6 5Odp7Z4FXrn1KoFgsCPuD4DmrY4oJaz5dQ7n4aOjWNwbTMgfcPalbiTvIstwTxQAA9oW 4DRpwhlMNjkxIq7I8Ha1QLvNasp2FCAaEISJdmPaHvFhK6ZwbmK6ql1AvB7oBUBYEqy9 /Ygn1UEuljc4yjFzWXXjtFQIm43zhWIgWuLTfBQg9isbFTvmTj+LESVfMi5IwR/BQ7xU x1/GPVL7zi0SxZoVBEw7/AZ4Qlm1WNC8Foq1o2SOC8O1845XxkqVEvoBGWWDaAg0GR0h Cthg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=zQp/+NnZT7xuP7zQ8iR6+6K7f5pp2S+U2r/fnGuT0Ss=; b=NICpZ9sALT0jNZ0xo9wCJl8TEbsyRChF9ag+F6dW9h0p5N+PhEBd79pFn6yvERzDnu sxLwhlwQS2PC7YfkCg6wiu0ONOB21EK5KYxhQNeWK53CGGPhAzb9zwkcoTcg2k80dg1w pYp15kfNhXDTYR5fJkzcn7YgFJOouV6RGOcimIhegdUAjT20uMRyzJFXJEdpkDFTdsOL WynrCIqqsXJ0UcdcZ0Ws80AWO8uugmA8BbVkDKP4lKkEANKydaOCYl95TPBcD/VRrLW3 9CrmXJjfAo+AUnDqYTb9D/wNwJAj0Kj9XrfM3X/hBUqEX0nm0y49psD2Z8TF6qjbxQ39 FbyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HGdvKG3D; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s20si1581024edr.444.2020.04.23.12.04.59; Thu, 23 Apr 2020 12:05:40 -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; dkim=pass header.i=@linaro.org header.s=google header.b=HGdvKG3D; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726726AbgDWMW1 (ORCPT + 99 others); Thu, 23 Apr 2020 08:22:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52200 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726077AbgDWMW1 (ORCPT ); Thu, 23 Apr 2020 08:22:27 -0400 Received: from mail-ua1-x942.google.com (mail-ua1-x942.google.com [IPv6:2607:f8b0:4864:20::942]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1CC92C08E934 for ; Thu, 23 Apr 2020 05:22:27 -0700 (PDT) Received: by mail-ua1-x942.google.com with SMTP id 36so1351878uaf.9 for ; Thu, 23 Apr 2020 05:22:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=zQp/+NnZT7xuP7zQ8iR6+6K7f5pp2S+U2r/fnGuT0Ss=; b=HGdvKG3DWQOKq1jelJ/RuzPy/tbrJMWphiFTtCkymuxBRKdjlGhNtZEi0Kt0bmdV2a xv5A+t2HqrfGrEBgWa6pm40bDm/Mt2MnMzs/reNMk9qtbAPAsJ2vOjmhRnMrcD4DPupT py150V+OjRpFRb7Js3Y1+qiRop7emtt+QvDKjXFTqBDG2+hj/NJUXvh+e6L3T8VkCbYs 6VCt0cXj1xKujb80FDNI8QwpbPoUe08QlFEViKzgkYVFBnkryx7zXQmnleUySwGv1fUj 4oAxFklpVn5O/8ZEvAmWA1QeI5t6xWV0GXBCtpZT0NjbUNJQ8CiOq5QYefsmruUCADJ8 EodQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=zQp/+NnZT7xuP7zQ8iR6+6K7f5pp2S+U2r/fnGuT0Ss=; b=bUaaumfyncOI5HNw5oqrBV3Kmt1kC5aX+Vjj/9YM6z88mlC0fCdWnrG3mk72BEYtTs Nrctd4Hzl0O7om2Sf4NsDDzCN4q0fKA6/LXBGXjujRe7dFuoieMCanhWJi8pyjR6Kqey EqFmFc7JzhpSA7WVepdVBh8cdro9I7GbIqAayeQ3qJ8i6RwwzRPBIvKOH3r2ZaCHyZW0 rytxykFe/23G41YsPYayyopqDacWrI2WXq4LcHtiQizxHzyCf6GAJpj78Y1nticp/kmC SEIqOn1yqsOZlNPmhtYjD1h4SeIQx3rBVZ2xoNh8tIZzvFDtx9UQi6Vw0b6vYIIEmAvt X1eA== X-Gm-Message-State: AGi0PuYHJF99CAjuWqDKuSX5baRc3qRBSR3WrTuQ6dkmDqXB6Ms2lHFV MavcSHs7Hwf45aZoOwicEVYmR9b3Nn9ZkyW0oE2n0w== X-Received: by 2002:a67:f24b:: with SMTP id y11mr2692108vsm.165.1587644545946; Thu, 23 Apr 2020 05:22:25 -0700 (PDT) MIME-Version: 1.0 References: <1587633319-19835-1-git-send-email-zou_wei@huawei.com> In-Reply-To: From: Ulf Hansson Date: Thu, 23 Apr 2020 14:21:50 +0200 Message-ID: Subject: Re: [PATCH -next] mmc: core: Use DEFINE_DEBUGFS_ATTRIBUTE instead of DEFINE_SIMPLE_ATTRIBUTE To: "Zouwei (Samuel)" Cc: "linux-mmc@vger.kernel.org" , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 23 Apr 2020 at 13:55, Zouwei (Samuel) wrote: > > Hi Ulf, > > Thanks for your review and reply. > > 1. DEFINE_SIMPLE_ATTRIBUTE + debugfs_create_file() imposes some significa= nt overhead as compared to DEFINE_DEBUGFS_ATTRIBUTE + debugfs_create_file_u= nsafe(). > You can refer to the patch of 1a2b3666da58 ("mt76: fix debugfs_simple_a= ttr.cocci warnings") I see. > 2. debugfs_create_file_unsafe(...&mmc_clock_fops) is corresponds to DEFIN= E_DEBUGFS_ATTRIBUTE(mmc_clock_fops...), so I only modified this one. I have now read the complete function header of debugfs_create_file_unsafe() and realized that this is indeed okay. > > -----=E9=82=AE=E4=BB=B6=E5=8E=9F=E4=BB=B6----- > =E5=8F=91=E4=BB=B6=E4=BA=BA: Ulf Hansson [mailto:ulf.hansson@linaro.org] > =E5=8F=91=E9=80=81=E6=97=B6=E9=97=B4: 2020=E5=B9=B44=E6=9C=8823=E6=97=A5 = 19:17 > =E6=94=B6=E4=BB=B6=E4=BA=BA: Zouwei (Samuel) > =E6=8A=84=E9=80=81: linux-mmc@vger.kernel.org; Linux Kernel Mailing List = > =E4=B8=BB=E9=A2=98: Re: [PATCH -next] mmc: core: Use DEFINE_DEBUGFS_ATTRI= BUTE instead of DEFINE_SIMPLE_ATTRIBUTE > > On Thu, 23 Apr 2020 at 11:09, Zou Wei wrote: > > > > Fixes coccicheck warning: > > > > drivers/mmc/core/debugfs.c:222:0-23: WARNING: mmc_clock_fops should be > > defined with DEFINE_DEBUGFS_ATTRIBUTE > > > > Use DEFINE_DEBUGFS_ATTRIBUTE rather than DEFINE_SIMPLE_ATTRIBUTE for > > debugfs files > > > > Fixes: 703aae3d09a4b ("mmc: add a file to debugfs for changing host > > clock at runtime") > > Fixes: a04c50aaa916f ("mmc: core: no need to check return value of > > debugfs_create functions") > > Reported-by: Hulk Robot > > Signed-off-by: Zou Wei Applied for next, thanks! Kind regards Uffe > > --- > > drivers/mmc/core/debugfs.c | 6 +++--- > > 1 file changed, 3 insertions(+), 3 deletions(-) > > > > diff --git a/drivers/mmc/core/debugfs.c b/drivers/mmc/core/debugfs.c > > index 09e0c76..9ec84c8 100644 > > --- a/drivers/mmc/core/debugfs.c > > +++ b/drivers/mmc/core/debugfs.c > > @@ -219,7 +219,7 @@ static int mmc_clock_opt_set(void *data, u64 val) > > return 0; > > } > > > > -DEFINE_SIMPLE_ATTRIBUTE(mmc_clock_fops, mmc_clock_opt_get, > > mmc_clock_opt_set, > > +DEFINE_DEBUGFS_ATTRIBUTE(mmc_clock_fops, mmc_clock_opt_get, > > +mmc_clock_opt_set, > > "%llu\n"); > > > > void mmc_add_host_debugfs(struct mmc_host *host) @@ -232,8 +232,8 @@ > > void mmc_add_host_debugfs(struct mmc_host *host) > > debugfs_create_file("ios", S_IRUSR, root, host, &mmc_ios_fops); > > debugfs_create_x32("caps", S_IRUSR, root, &host->caps); > > debugfs_create_x32("caps2", S_IRUSR, root, &host->caps2); > > - debugfs_create_file("clock", S_IRUSR | S_IWUSR, root, host, > > - &mmc_clock_fops); > > + debugfs_create_file_unsafe("clock", S_IRUSR | S_IWUSR, root, ho= st, > > + &mmc_clock_fops); > > Apologize for my ignorance, but why convert to the *_unsafe option for th= is one, but not for the others? > > [...] > > Kind regards > Uffe