Received: by 2002:ab2:6d45:0:b0:1fb:d597:ff75 with SMTP id d5csp302597lqr; Wed, 5 Jun 2024 06:40:51 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVni6EuRtjMlciuG06gjtHR2kyOQ6CwDMZw5vp+SMMdSBPvZEEMJaAW4JG3xV/BFHPXWZOZb96fqSxttZftJomO7GeGNRR3WfgY0I4Vcg== X-Google-Smtp-Source: AGHT+IGaQWav1CGVkLbXgd4+XQIkXcjLtEVr6OWIpz3ZWHhz0SoiNGxfyKlSfq4kBVZtGWSmcvQ1 X-Received: by 2002:a50:9509:0:b0:57a:3046:1cd8 with SMTP id 4fb4d7f45d1cf-57a8b697867mr2257168a12.7.1717594851271; Wed, 05 Jun 2024 06:40:51 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717594851; cv=pass; d=google.com; s=arc-20160816; b=nohHSHkMax8pXJsKiSCmwk2hr9lQpHpWOOb7FdQUcOq2KKJ77jJuf4gU7nvzI8hqjk +MVsYNwJl/oYr4QpZEd6VEF5n73CSlFPMszFXQsxu2RO//G/Phvl+0XR63PpbIj1H12r mgWwLiXT/YmFFK+iGZrkrI8g4tmphLDnfy0QQTn9srus9KSeOl/G4Lr02SOv6Wq3V5wg LAPopQnIJoaIoaJZGg7YpN0JYODEhTKleIgOXQuf3n0eYZUbok80daBqTtbpSWLp9DpK RM3X14ubzKG6j6xJJz2zPk6/yqc6cAzBu3LklDBr52Ky1fK9UH7bkGvVBhBHagUZoctk MFIA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:subject:cc:to:from:date:references :in-reply-to:message-id:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:user-agent:feedback-id:dkim-signature :dkim-signature; bh=N2eL8RwybwiJUKVprjaoTWy+fNNjx5dXfQ7CD829ifE=; fh=5tqjwBrQnXSQcNdhEa7UsLjLfb0wCK6uVGlxAHxXmGM=; b=XiJEecZFvJi0SYGwoflBIqDSZHkFOTNLLN9e9UeNp944GiKuqgtGZBpHjCqIossMin keJRd8WX+cfkhCJhULSbdFj3LbTD8kt/vDWt+B/Mg+gyXRtkugtz5YTAo56qqjwZ6GMr m/ySFl91/T8wpb/0q9yrAqHYHLf577HzHEI5gUD1YUpkKSf20hfQd7ZU/Cii2voxj8kN PPYk5e39cLrZ/sGm0coTPEmYeoM+QyWCno9H6GDvQTlZ38BokdBHdOOKepVXGISNK54G /cE/luLKfn482E+1Hrmjh/6sPFiCbd48x48vUJ7MFFufvpAiTruHteAg/q79jZ7YWSeK 0Qtw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@flygoat.com header.s=fm2 header.b=b+tDXKHS; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=XhxRBfMk; arc=pass (i=1 spf=pass spfdomain=flygoat.com dkim=pass dkdomain=flygoat.com dkim=pass dkdomain=messagingengine.com dmarc=pass fromdomain=flygoat.com); spf=pass (google.com: domain of linux-kernel+bounces-202691-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-202691-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=flygoat.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-57a31ca573dsi6316207a12.512.2024.06.05.06.40.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jun 2024 06:40:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-202691-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@flygoat.com header.s=fm2 header.b=b+tDXKHS; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=XhxRBfMk; arc=pass (i=1 spf=pass spfdomain=flygoat.com dkim=pass dkdomain=flygoat.com dkim=pass dkdomain=messagingengine.com dmarc=pass fromdomain=flygoat.com); spf=pass (google.com: domain of linux-kernel+bounces-202691-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-202691-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=flygoat.com 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 am.mirrors.kernel.org (Postfix) with ESMTPS id CD7441F269A4 for ; Wed, 5 Jun 2024 13:40:50 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6189F1993B7; Wed, 5 Jun 2024 13:18:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=flygoat.com header.i=@flygoat.com header.b="b+tDXKHS"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="XhxRBfMk" Received: from fout8-smtp.messagingengine.com (fout8-smtp.messagingengine.com [103.168.172.151]) (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 9101E19924D; Wed, 5 Jun 2024 13:17:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.151 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717593480; cv=none; b=iQuaTiuivbi2pvte2LeKGB+Bcl/LpMK9CwwlRoO2PMME2eOBGtJ1nCjby2MfGU/X2KpZogK0gRMa4i9PdlsIoP2HAYEW2Kzzy+FwSFPeQxIq7P5+3NJrBKAnoIPuajXKcUBBcUSrlmw7FVxRWoqzLWgMcLnlIrF6yK1cQ9Isf3U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717593480; c=relaxed/simple; bh=78/x5XUPo5xusPgNw/FNUoT8dnpyBDLoUYTIoTMbIkI=; h=MIME-Version:Message-Id:In-Reply-To:References:Date:From:To:Cc: Subject:Content-Type; b=r3VwWDCF5y/GJmcclUZclWQRIn9R/KZq63CKxPBSGP887luioE2SRdEHI8Ej/N8ABigeNyOVh7kSDDHlrfK/tQ05F7xXVCgBpM2PpNp6Lf/jF4Wbfd7ddegs+CvpWFDl8c7eVTa/VjohKSjQ/YChXHF0Nbt8ivu520TGDwu9OjQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=flygoat.com; spf=pass smtp.mailfrom=flygoat.com; dkim=pass (2048-bit key) header.d=flygoat.com header.i=@flygoat.com header.b=b+tDXKHS; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=XhxRBfMk; arc=none smtp.client-ip=103.168.172.151 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=flygoat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flygoat.com Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailfout.nyi.internal (Postfix) with ESMTP id 9AB20138008D; Wed, 5 Jun 2024 09:17:57 -0400 (EDT) Received: from imap44 ([10.202.2.94]) by compute3.internal (MEProxy); Wed, 05 Jun 2024 09:17:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=flygoat.com; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm2; t=1717593477; x=1717679877; bh=N2eL8RwybwiJUKVprjaoTWy+fNNjx5dXfQ7CD829ifE=; b= b+tDXKHSZUiRtQKPGC5EZY89buxGvF7wJQIfNACRZgkiqnL5kS/TiYkw9na32eWc UnMp7+r6j7nyE773712+a570z3NAUG0ygd38JI1fydRKHn2EWA4ds1aWQ+KzyT5A xsIdYrOvoyjjTYvMWQq/oztPCun0CZV0YpfeIU+rN4xiMlSfRk4EjyNygK9oRm4i HZkQG0TNeXHI/Gu0hG1IZRe9irjAIzZ4BcQwXvR7SU9FxfkqCTDvN1GoH3bqxOD8 KirLCtXgZb6vORHR7qZbTJm5wtkJklT2b6StSPo4iapD7RLjN8u9ADnFJNA0Smk3 GGnRq2eymrEFophjm84dTA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1717593477; x= 1717679877; bh=N2eL8RwybwiJUKVprjaoTWy+fNNjx5dXfQ7CD829ifE=; b=X hxRBfMkDblW4U9mMyDka2s4QLmNQMLA+rGZP97Q5uoEF6vuShzzIxHGyosgvmca8 WCuc+6+zj0vQIgoxCq6bgZy3pZkemtvzfSpo/zxoZlQtIoZuEezgSTLyRhe6siE4 SQOxlMpMUHBFTNSU07WwRQvJn9rkyAh106QS+gSfqLRb/DpVmGh/tYpu0uk8x3/Z 6GtekL9c+iy4293mzELBWmnt7W8CnTi0q+x+eZkdZWqai3LyZyQbpYO08B/cPGRO G9fdoL9Z/FMB39uM7Cy71wZHookk8rQdpeOi4PqlfQIGn/qnL57dI+BYcqFBqy4h JkJmg+2gQ3sFTgmdgrQdw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrvdeliedgieefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvfevufgtgfesthhqredtreerjeenucfhrhhomhepfdfl ihgrgihunhcujggrnhhgfdcuoehjihgrgihunhdrhigrnhhgsehflhihghhorghtrdgtoh hmqeenucggtffrrghtthgvrhhnpedufeegfeetudeghefftdehfefgveffleefgfehhfej ueegveethfduuddvieehgfenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmh grihhlfhhrohhmpehjihgrgihunhdrhigrnhhgsehflhihghhorghtrdgtohhm X-ME-Proxy: Feedback-ID: ifd894703:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id E7DE336A0074; Wed, 5 Jun 2024 09:17:56 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.11.0-alpha0-497-g97f96844c-fm-20240526.001-g97f96844 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <310c2bce-e6cb-4268-858b-8466c92266dd@app.fastmail.com> In-Reply-To: <878qztbvb4.ffs@tglx> References: <20240517-loongson_nodecnt-v2-1-5bd0bb20ff5f@flygoat.com> <87sey3b6de.ffs@tglx> <9947f7a5-1a95-48f2-b0eb-0385eb2b3d55@app.fastmail.com> <558b1d58-08a5-410d-97b8-e77def7c1cf8@app.fastmail.com> <878qztbvb4.ffs@tglx> Date: Wed, 05 Jun 2024 14:17:38 +0100 From: "Jiaxun Yang" To: "Thomas Gleixner" , "Huacai Chen" , "Thomas Bogendoerfer" , "Daniel Lezcano" Cc: linux-kernel@vger.kernel.org, "linux-mips@vger.kernel.org" Subject: Re: [PATCH v2] clocksource: Add node counter timer driver for MIPS/Loongson64 Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: quoted-printable =E5=9C=A82024=E5=B9=B45=E6=9C=8828=E6=97=A5=E4=BA=94=E6=9C=88 =E4=B8=8B=E5= =8D=888:17=EF=BC=8CThomas Gleixner=E5=86=99=E9=81=93=EF=BC=9A > On Tue, May 28 2024 at 15:31, Jiaxun Yang wrote: >> =E5=9C=A82024=E5=B9=B45=E6=9C=8827=E6=97=A5=E4=BA=94=E6=9C=88 =E4=B8=8B= =E5=8D=885:32=EF=BC=8CJiaxun Yang=E5=86=99=E9=81=93=EF=BC=9A >>> =E5=9C=A82024=E5=B9=B45=E6=9C=8827=E6=97=A5=E4=BA=94=E6=9C=88 =E4=B8= =8B=E5=8D=884:51=EF=BC=8CThomas Gleixner=E5=86=99=E9=81=93=EF=BC=9A >>>> Jiaxun! >>>> >>> Hi Thomas, >>> [...] >>>> >>>> What's this indirection for? Why dont you update=20 >>> [...] >>>> >>>>> +static struct clocksource nodecnt_clocksource =3D { >>>>> + .name =3D "nodecnt", >>>>> + .read =3D nodecnt_clocksource_read, >>>> >>>> the read function pointer here and spare the indirection? >>> Smart! sched_clock takes slightly different function pointer argumen= t type >>> but as we don't use the argument anyway, it should be safe to relax = this >>> indirection. >> >> Sadly, I'm unable to remove it with force type catsing :-/ >> >> drivers/clocksource/loongson-nodecnt.c: In function =E2=80=98nodecnt_= clocksource_init=E2=80=99: >> drivers/clocksource/loongson-nodecnt.c:89:36: warning: cast between i= ncompatible function types from =E2=80=98u64 (*)(void)=E2=80=99 {aka =E2= =80=98long long unsigned int (*)(void)=E2=80=99} to =E2=80=98u64 (*)(str= uct clocksource *)=E2=80=99 {aka =E2=80=98long long unsigned int (*)(str= uct clocksource *)=E2=80=99} [-Wcast-function-type] >> 89 | nodecnt_clocksource.read =3D (u64 (*)(struct clocksou= rce *))nodecnt_read_fn; >> > > What about making the actual read functions have the required function > signature? The clocksource argument is not used in those real function= s. Sadly sched_clock requires another signature :-/ I can see timer-clint hit into the same pitfall. Thanks > > Thanks, > > tglx --=20 - Jiaxun