Received: by 2002:a05:7412:ba23:b0:fa:4c10:6cad with SMTP id jp35csp1996460rdb; Sun, 21 Jan 2024 03:00:19 -0800 (PST) X-Google-Smtp-Source: AGHT+IHyp2xFvdj9rlm5IHpqW+1KIAMieSqlsID39CpZcr1W1iFNafCRMUCkG+OyDj3eUX1PESpA X-Received: by 2002:ad4:5de7:0:b0:686:67fb:8e20 with SMTP id jn7-20020ad45de7000000b0068667fb8e20mr948042qvb.77.1705834819199; Sun, 21 Jan 2024 03:00:19 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705834819; cv=pass; d=google.com; s=arc-20160816; b=lXv9/Bpds3ijBxz8ggEHmWpRtnW9FHaIUaffQDKLTymWLS33ey2wAhOT689wdbSZL4 I9O6qS8HUopTf5sgKCJLUAjTra8AsHCdPUYe4sXNKA52jAT/oZSGlrEaGs67TiEtsByq CNJ+kFol898W5LEmBhPEFAWFOgHJ4AOm2p9bvCzW04XDolYhzh57JFUfSWz3RtVsX2AL K14V69QrsXIgFn5WhbC4n2mRAolPW+oUkQ0zuXBGrCFbWwlpfx50qkoCVVWXt2vomMAs kRmBY/fP4BJleaWcjbpq+D6ZmiWlGC+q8QP18ja7iYqtEOmVCchZXs1qKfVgQUi5lPX4 PFsA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:references:message-id:in-reply-to:subject:cc:to:from :date:dkim-signature; bh=UWN54G8DcZhwd8CcYCFZ1mep8750dTOYSTQEJt94oPc=; fh=F9UWz/vWmabl/13q6uRPuHh1UT7SWcMG2M2xSl/2pW8=; b=On//zAmeQR0IHLIxg1tgvgA963T25SSlEqu4vAdwylL0sCIviZN1teoFAeh6psIzkD WqkXvoK/57zUn5Eq+9R+ndKcl3+ikBVdjUz1991qvQYZIT4dRcI9vRzygyWlLgKV/B/Z gE7+RVFrD54UjZEYqVkCZ/w1ncGBHFOmGD3ZKaLuf/xEZmsS/RUQxFjDL7KvddM3+L/G mv+nvByvLFmWIzjB7xes4NtgoTIaw1M1BRqjEwE4CGO06UObv1tuDVrr+MDw88q4cxS5 DFqUx/wKk7mK2flE9KQhKPvBkiW7+2MDEXgpF7fbPayPqgWydKD3LPtOjnSM7SQEHwsr 38IQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@inria.fr header.s=dc header.b=pNUlJpFo; arc=pass (i=1 spf=pass spfdomain=inria.fr dkim=pass dkdomain=inria.fr dmarc=pass fromdomain=inria.fr); spf=pass (google.com: domain of linux-kernel+bounces-32017-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-32017-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=inria.fr Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id i13-20020a0cf38d000000b006818be1a1a2si3319797qvk.364.2024.01.21.03.00.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 21 Jan 2024 03:00:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-32017-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@inria.fr header.s=dc header.b=pNUlJpFo; arc=pass (i=1 spf=pass spfdomain=inria.fr dkim=pass dkdomain=inria.fr dmarc=pass fromdomain=inria.fr); spf=pass (google.com: domain of linux-kernel+bounces-32017-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-32017-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=inria.fr Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id EF6BF1C20BF4 for ; Sun, 21 Jan 2024 11:00:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 74894364D6; Sun, 21 Jan 2024 11:00:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=inria.fr header.i=@inria.fr header.b="pNUlJpFo" Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ED76D3613E for ; Sun, 21 Jan 2024 11:00:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.134.164.83 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705834811; cv=none; b=qkw7RAcWforqSXMD/mT23Ck5DfiLUSjKya2PorDEUVfW0BgW83q18/AQnt0nZJxPwzq+o/UpOSzCcfLhr44VRoctdOZMEWV7gmc5KBNCwKr+MqoexxaVLCVO6FuulpMyb/La8KIFw0LmPQHfMVP1hOGTMnZbuj1IE6cAu6tBLQI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705834811; c=relaxed/simple; bh=mpx2L0PpidQmn6LII8E4mdM0zc9ViLhNoJxMy+C3hKc=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References: MIME-Version:Content-Type; b=SLz4me0usk1XsPIxGNPH6Fpm3k63H4XPwEwULgBnkuqI8mKooL2HwqwUvSJfyayximFcP11c4BpU7tnmJ3eXK1LOX5TwVci+qv3YIskUoPON3b1FzD0w1xLTKMDqh294PlUBcS2cvhbT1S8X85aa2WjoE+iYX8L3uXgytQ/6p10= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=inria.fr; spf=pass smtp.mailfrom=inria.fr; dkim=pass (1024-bit key) header.d=inria.fr header.i=@inria.fr header.b=pNUlJpFo; arc=none smtp.client-ip=192.134.164.83 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=inria.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=inria.fr DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=inria.fr; s=dc; h=date:from:to:cc:subject:in-reply-to:message-id: references:mime-version; bh=UWN54G8DcZhwd8CcYCFZ1mep8750dTOYSTQEJt94oPc=; b=pNUlJpFoM8WUIuaolUNsU5Nq6sK9B4liqDlyzJOIsDTh2M0+7139ZDf4 +9HohTrYH2FXLvQ+ikHA1Ub1rLTVaacZMuO94GJ30VRjoyVvKTiobSGcH sLu1+D5MtTjtfxl8iiCrKtpuWtH3C2J/xqFv4EA9a33gyC6zrWhCK5S3A U=; Authentication-Results: mail2-relais-roc.national.inria.fr; dkim=none (message not signed) header.i=none; spf=SoftFail smtp.mailfrom=julia.lawall@inria.fr; dmarc=fail (p=none dis=none) d=inria.fr X-IronPort-AV: E=Sophos;i="6.05,209,1701126000"; d="scan'208";a="147776685" Received: from 231.85.89.92.rev.sfr.net (HELO hadrien) ([92.89.85.231]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Jan 2024 12:00:01 +0100 Date: Sun, 21 Jan 2024 12:00:00 +0100 (CET) From: Julia Lawall X-X-Sender: jll@hadrien To: Markus Elfring cc: Li Zhijian , cocci@inria.fr, LKML , Nicolas Palix Subject: Re: [cocci] [v2] coccinelle: device_attr_show: Adapt to the latest Documentation/filesystems/sysfs.rst In-Reply-To: Message-ID: References: <20240119062057.4026888-1-lizhijian@fujitsu.com> User-Agent: Alpine 2.22 (DEB 394 2020-01-19) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII On Sun, 21 Jan 2024, Markus Elfring wrote: > > I subsequently simplified the patch case to contain the following: > > > > - snprintf(BUF, SZ, FORMAT > > + sysfs_emit(BUF, FORMAT > > ,...); > > > > This also works for the case where there are only three arguments. > > It has the benefit that the change is recognized as a line replacement, so > > no extra {} are added when the call is in an if branch. > > Would you like to consider the application of the following SmPL code variant? > > -snprintf > +sysfs_emit > (BUF, > - SZ, > FORMAT, > ... > ); It's ok too. julia > > Regards, > Markus >