From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 95787C77B7F for ; Mon, 8 May 2023 11:41:41 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id D10C31214; Mon, 8 May 2023 13:40:48 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz D10C31214 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1683546098; bh=43I8yczN1rZ3ZVWlV2gWBrGu6oj8XlZWUfCJJG/eJ8M=; h=Date:From:To:Subject:In-Reply-To:References:CC:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=JPbEDukWeOsB/D55xmMP3NVwfqb0KtXEBdxP9bk6esK9Y+ra6eBs2bxB8YnybFtNw ioiAO20gmzc3zJ/IfVEpNmSfgEu0abOjadEVSKnPdgLhnOgFrDDk/bMPHCvYOReZ19 o0EUp3ubhOv9iqY2XMDJGlLpW5oINwjAU1TLd8Z4= Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id BE7E1F80087; Mon, 8 May 2023 13:40:23 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id D6373F8032D; Mon, 8 May 2023 13:40:19 +0200 (CEST) Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 74CB2F80087 for ; Mon, 8 May 2023 13:40:16 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 74CB2F80087 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=W9nONUun; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=lsNad85G Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 9F50B21E7B; Mon, 8 May 2023 11:40:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1683546015; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=eErYPT69S21/56/YRy4rPGoZf2EI6kuOXxSmR+kAGKA=; b=W9nONUun/LRtlJkXlldo0pLlrwR8MTJWvHDnwCNoiUQ4Pl10TR8RnPN28hOpARM1qtz8kx W8+OsOi6sL32zqzyawiG3yAZ2DFLd6ekwJMcDF3pcDg0eBn/5PQQqwj43kZP+RkLz0x6Qr PaGAOicKXSPap4G7SLuOkJePkWRsdZc= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1683546015; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=eErYPT69S21/56/YRy4rPGoZf2EI6kuOXxSmR+kAGKA=; b=lsNad85G0Yi3IH8DrFHixZ+2Np2cawnjwXvqWKg73d/5UtJBjSzXMkQ3A8uTbU22C51SXj 5LeZKUItV4Gw17BQ== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 7253F1346B; Mon, 8 May 2023 11:40:15 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id e1LKGp/fWGQlMwAAMHmgww (envelope-from ); Mon, 08 May 2023 11:40:15 +0000 Date: Mon, 08 May 2023 13:40:14 +0200 Message-ID: <874jon831d.wl-tiwai@suse.de> From: Takashi Iwai To: Oswald Buddenhagen Subject: Re: [PATCH] ALSA: emu10k1: macro-ize snd_emu10k1_ptr_{read,write}() In-Reply-To: References: <20230428095941.1706263-1-oswald.buddenhagen@gmx.de> <878rdzfg7a.wl-tiwai@suse.de> User-Agent: Wanderlust/2.15.9 (Almost Unreal) Emacs/27.2 Mule/6.0 MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII Message-ID-Hash: NW3H4EMBLF2XWPCCRDBQ5TCO2NIMNN3G X-Message-ID-Hash: NW3H4EMBLF2XWPCCRDBQ5TCO2NIMNN3G X-MailFrom: tiwai@suse.de X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: alsa-devel@alsa-project.org X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On Mon, 08 May 2023 13:14:12 +0200, Oswald Buddenhagen wrote: > > On Mon, May 08, 2023 at 09:14:01AM +0200, Takashi Iwai wrote: > > Must those be macros? > > > yes. at least with the additional checks i've added in v2. Hmm, it's not clear why it must be a macro. Isn't it a snd_BUG_ON() and the check itself is non-inlined, right? > > Not only that macro isn't really safe to use for obvious reasons, > > > i don't see anything obviously bad. please be specific. It's a generic problem of a macro; you're referring the arguments that are expanded in multiple times. At least, it could be a static inline? > > the expansion would cost significantly as they are called in many > > places. > > > after i fixed the calls with a non-const register in v2, the code size > increases by less than 400 bytes (with ~95 call sites). i'd say that's > negligible. But it's more. I'd like to know why those have to be expanded inevitably with a macro with that cost, and if any, it should be described. Takashi