Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp195625rwi; Tue, 25 Oct 2022 22:57:51 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4HZwpVCsNN4U2aRQ7XDV49hgo1d1giHUrpzzbGOIzmF5+6JR63I7r8qYid+jWNuCNEax1o X-Received: by 2002:a65:56c4:0:b0:458:85e:9e65 with SMTP id w4-20020a6556c4000000b00458085e9e65mr36625248pgs.358.1666763871229; Tue, 25 Oct 2022 22:57:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666763871; cv=none; d=google.com; s=arc-20160816; b=eoRwbOp6lTqM8/VmI6PhpGSMkjjXH4MZyeV/nexJ9VkVhNE2m+UMolV532Nl6a+GM+ y4wCROGu5uS6bQoCNTXrtCpDGkLFOoZ3FQX2+f8qmZS+0aw5oynPzOArb/9tDDBVNMuf MD9NxpjT7PPlbrIT2yDp+OYPVcvqpmzOPNYmRqYh4l4cFv9JcUt0oKnKQtnmOiIljPcU NMjI8qdVdAlW2k9VA15q1Ztws0h4cPLQEHfyqRMu1hpPxHNDk4qlS2RnoOJVk9bJ2Z8w 2ccvFugTcjhmTmQZgTPfh7NaZNuxcjjbgMNfyd0qfYgOIS8Qe19BxH8zqTUxnsmTDlVI 3IQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:in-reply-to :subject:cc:to:from:message-id:date:dkim-signature:dkim-signature; bh=+7AfhfBH1W/lDI87QrEInzFsz78KYHY+XmnT7RfHHwc=; b=u43N5AvmeDI5W84XAldJc6IaVZMIaJJCI1/jcA2qo+NTBthXfTFciMIE6dwDqOG54+ AfB0hLcFLuWT5wfQpON3RhT2AEsp+rYLLM7sTLHM4Hnmc/D2guCx8kEeO80JNiT9KDAC tyICHqHW226vm2zUDD/kaKheUoXiVEHukG7SevVV4b1gqqDZ4tpY6p4q/SqTDFg0jpdm vXyLAJ6PXwTazBV1v6tVK/XmEQTWa0K27YsVG+HBHnPpoHWOBKsjjug/C+rVV62OYrlB IPwy3vWq9g40kxfRQvr6EpEyw7niyWUMcBPtl8eH8jFwtNweeoMM9q+GiCqGPEdtSEnN CFJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=pxGz0nmB; dkim=neutral (no key) header.i=@suse.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q4-20020a170902f34400b00176c891c8a0si4948983ple.6.2022.10.25.22.57.38; Tue, 25 Oct 2022 22:57:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=pxGz0nmB; dkim=neutral (no key) header.i=@suse.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231628AbiJZF23 (ORCPT + 99 others); Wed, 26 Oct 2022 01:28:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45130 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230345AbiJZF21 (ORCPT ); Wed, 26 Oct 2022 01:28:27 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C04B88D0E3 for ; Tue, 25 Oct 2022 22:28:26 -0700 (PDT) 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-out2.suse.de (Postfix) with ESMTPS id 5168D1FA95; Wed, 26 Oct 2022 05:28:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1666762105; 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=+7AfhfBH1W/lDI87QrEInzFsz78KYHY+XmnT7RfHHwc=; b=pxGz0nmBf24gIGVkb1+CAFcQw5DRiN2MDkZt7Vs56Nfdu53ValiIsrx3vtrwX/WPNsUEwl M4suuvFHIFiioMwKVUt60kpHd9gkGO26phIUM/IPezouHhpcelThV5aGG68BpLOTOKL7UN nNmnBlsdXh0LXUCM42jgmiTBAMpyR2A= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1666762105; 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=+7AfhfBH1W/lDI87QrEInzFsz78KYHY+XmnT7RfHHwc=; b=/lseX0IScTek2Fcw5dpMmtZK4ZvBpO5kkrvCBXCT4l9mDDgwyv1ZKt8bmAgdDeiMvKXImc gmrbZNGUiewIIcCg== 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 1147613A3B; Wed, 26 Oct 2022 05:28:25 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id TXViA3nFWGNGZgAAMHmgww (envelope-from ); Wed, 26 Oct 2022 05:28:25 +0000 Date: Wed, 26 Oct 2022 07:28:26 +0200 Message-ID: <87pmefp30l.wl-tiwai@suse.de> From: Takashi Iwai To: Mark Brown Cc: wangkailong@jari.cn, perex@perex.cz, tiwai@suse.com, lgirdwood@gmail.com, motolav@gmail.com, cezary.rojewski@intel.com, mkumard@nvidia.com, pierre-louis.bossart@linux.intel.com, kai.vehmanen@linux.intel.com, peter.ujfalusi@linux.intel.com, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] ALSA/ASoC: replace ternary operator with min() In-Reply-To: References: <3d74bcaf.5.1840fa4d439.Coremail.wangkailong@jari.cn> 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 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 25 Oct 2022 19:01:32 +0200, Mark Brown wrote: > > On Tue, Oct 25, 2022 at 10:56:11PM +0800, wangkailong@jari.cn wrote: > > Fix the following coccicheck warning: > > > > sound/soc/soc-ops.c:817: WARNING opportunity for min() > > > kfree(uctl); > > - return err < 0 ? err : 0; > > + return min(err, 0); > > I don't think this is a good warning, while I'm no big fan of the > ternery operator the new code is less clear about the intent than the > old code. Agreed. That use of ternery is a standard idiom. If we have to eliminate the use of ternery inevitably, it'd be better to introduce a new macro for clarity instead. thanks, Takashi