Received: by 2002:a05:6500:1b8f:b0:1fa:5c73:8e2d with SMTP id df15csp185313lqb; Tue, 28 May 2024 12:21:37 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX4HuQ5U4VgunZTRZYDAwYJwxe9BttKs0YxcQr2n0Ksv6z+Xr2Hz4FkSdaLm1tq2kViiigaVsb1EUtRE5KREDdZjS1fsBNuSt+Nx8c/FQ== X-Google-Smtp-Source: AGHT+IGuqEXNEol5usCvCLkoryykZhKRfS6PkaPkc8C67bh1GrTCtYyxIxf/llIRvJghvnMOtZm/ X-Received: by 2002:a17:907:3fa5:b0:a63:147b:b2 with SMTP id a640c23a62f3a-a63147b02c6mr656458366b.66.1716924097278; Tue, 28 May 2024 12:21:37 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716924097; cv=pass; d=google.com; s=arc-20160816; b=Gq4zZxa/RPqwD8mxAvPkzRQQHHqE2mNmueb22bWvAct1DcfZ3OpPlbOw5po50R6M6p MkNu7aGEFjd3S6g0ylmieQFZRTGkXNae1sQuciHB7OgIbHaafq7HFQJas1uEbrkLVXSg gRS2wlUEgb5Ai6utWc386X0C7fJ5pCL5j5stWwZkJ0uf3X4ZlaBfnLZAAVs5lwLgFFaF EPde9sqpq6MxK/DPw05q/fiQEoZsKJN1qV8JJuwYhz+37Uvx+NEC916BctCofKybNMMr cguvCRUITL3/stIECPVfx+LGO3KP7ZBjyfLkzRKNc4YzSW8z8v0593ZBNMB6cDgF5yau t1JA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=yJ1hwXGxp5OziMITpimO5gMUZCDRn1KBiPlKiBihrWA=; fh=uh3W9UOTtNTEaRYGE9iyf06jaGwS5W0JMut91Lc5Gn8=; b=gpgNswQNcxpP/614KqK7jMAnRUH2frJK6H58NslAZLT7082x5yzcStoglH8IxcnQl7 cBbVTzkpWcHBw7Jsv91z69KJ3UnzDV+yyyHPh0CKqk4G1edoJuRRGsyj7VgWXIrd5400 8v2Sk1p5H9oMZcU8whvW6KIau9KvLjKSfpeRuTHfENnHKims0/3l9uFdrHYUU6rOoYx2 7z6pIT4n19IIeTRRdCbIC7suWByoYPMZM1wm8fAsAjrvAXQBjFDT3lAS/VPCQaVvvZI9 x+EcfqhqrthchXPuf5jwCP9i8kTaQTMRRH8sugfKaLL6SvXFoUjN8oZVTVakP0qFZ6T7 XXaw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=4Q0uIKf0; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-192928-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-192928-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a640c23a62f3a-a63397421e0si118829366b.786.2024.05.28.12.21.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 May 2024 12:21:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-192928-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=@linutronix.de header.s=2020 header.b=4Q0uIKf0; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-192928-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-192928-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de 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 B00061F27517 for ; Tue, 28 May 2024 19:18:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5DA26176FA0; Tue, 28 May 2024 19:17:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="4Q0uIKf0"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="dlDZNGS9" Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (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 3F5956DD0D; Tue, 28 May 2024 19:17:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716923842; cv=none; b=ddxNC53wXVGY0vk9YeffR9lJ//NgC/qEarCL9E4l31Bkz8TcoKXFNXNB2W6mZA/3oev1E9jcSz+SRQxipI/GXyZ8ZF/CmJkdIeE8U4x0kEvjbAqSwB4V7Ve9JVH7B60SRC+fiSuxwDMyTOkUU0C1YAyo9SQ79aWHMOgF2M8vnBY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716923842; c=relaxed/simple; bh=CnnAhhfLz0yuidAHDeeEXBYwXWBSYSxgEY9NZ458gW0=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=PbpYEen+ChoF39TpGpm0l+hnl71vmGqxlaEke+afHsc8EQh0fCTxGAzoPtgfI98FyUv6/yYLJmMwNGQ/ougwNtjqUastpY4iYN70h23UhK1aFs3oIjGeclys4GMHBOHpobuGRRoqMoOuYRQm+VtPGcwbIPq+XJLuz+K10Jsm2Io= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=4Q0uIKf0; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=dlDZNGS9; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1716923839; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=yJ1hwXGxp5OziMITpimO5gMUZCDRn1KBiPlKiBihrWA=; b=4Q0uIKf0G8CeKyw1PtsLVCbUOOC9UuZaDRd3Kl9M7VLtjJsA8bmbOw26giQO8UW4MO2dG3 Gfwm7SS/uF+VkocqhAr0TR57SDovXB9WMan8RGB9vefJKqBSbeaMZ861oHFSoQPO2X1V3e QYSPBMCYroAILOusV9zsslgjKzv8f6DG/cgdqJaIO1YVt/ckZPiap++MNv4HIi4yIo4Dy5 CxOEUKQKmb6U5kuCLsdmGpwrEcAhwKCt+28G8toQTtRtPhYGNcUXSHWh+z8eUX71ZKGVLJ hd8gvOb+O9IYhOpIr/C2P8sDSIbDGvwvQMxIszldpcWSLOap31jmVo5fl6DF7g== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1716923839; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=yJ1hwXGxp5OziMITpimO5gMUZCDRn1KBiPlKiBihrWA=; b=dlDZNGS9j37CdmsfrI+XNgAf9uk8CeaU3aUHLYh+8UhnM4BeOT90CsmTSpQJ3nlzgV4tEI jdRGc/Ee4nS5K9Bg== To: Jiaxun Yang , 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 In-Reply-To: <558b1d58-08a5-410d-97b8-e77def7c1cf8@app.fastmail.com> 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> Date: Tue, 28 May 2024 21:17:19 +0200 Message-ID: <878qztbvb4.ffs@tglx> 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=utf-8 Content-Transfer-Encoding: quoted-printable 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 argument ty= pe >> 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_cloc= ksource_init=E2=80=99: > drivers/clocksource/loongson-nodecnt.c:89:36: warning: cast between incom= patible function types from =E2=80=98u64 (*)(void)=E2=80=99 {aka =E2=80=98l= ong long unsigned int (*)(void)=E2=80=99} to =E2=80=98u64 (*)(struct clocks= ource *)=E2=80=99 {aka =E2=80=98long long unsigned int (*)(struct clocksour= ce *)=E2=80=99} [-Wcast-function-type] > 89 | nodecnt_clocksource.read =3D (u64 (*)(struct clocksource = *))nodecnt_read_fn; > What about making the actual read functions have the required function signature? The clocksource argument is not used in those real functions. Thanks, tglx