Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp7392800rwi; Mon, 24 Oct 2022 14:04:10 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7kgikml2SRQFvRAsAtjucyZ5gGPWhoYOqzK3VxTZxr2osbfJiB1C0orbKHIcbrEjiNC6XI X-Received: by 2002:a17:907:86a9:b0:78d:f741:7fa0 with SMTP id qa41-20020a17090786a900b0078df7417fa0mr29132137ejc.734.1666645450246; Mon, 24 Oct 2022 14:04:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666645450; cv=none; d=google.com; s=arc-20160816; b=vPHUTsSY94btoZWDDy7HEh2ceEOcq6Z98qSVJWaKbgXEncpraE4kioluNk8lJtZuaA wiGfj+DB01DT0I5y1UxKLCyMSjV2QKmONIBIO9n339cp1CKa/Qev7YoDZdpdg1AXL2M8 KoTPPf9duwpkHHYp3SbmGkgr5a30HgZSbnI6Fe+r1dlu8gtBQZiR7uBh7iQthcPjSMN6 PI56zFcyM5t8dOrlxOZSvuuIyp45g9XMTAfyTsVjtq9PlO5OqF5Vbt0CTOiNp6HzU0hK HXGWhXWAaVtqT8Egx/9ihDuuoDOsfZw5HO7SJqjsAM39Crp0qQKkFSbQOJAjDVekGN2w lGgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=qnKFjujepPdHfbu6wRQ2lttGCtGZBN1T6S7yDpV4J5A=; b=GtGVjcudjhq0NjPsBEoUgDzymef8rkORasdx8a3I5lNdYgcmQ9DXIRiUqZZBaJzEAi nOzXDG0jX8excngadrkJUsbUsk9rbrLa1UUD3ffosFw3xaaN/QV3JsdB+J7OfCFNzguf bS/kRJcT972ypC9qWx1Jh0lSFa5B9Pct0iEyNNZj2L7bIyCraWO24gWgQ1M/j2x0HWe8 ZBJJx0dA8Rg1HdFcyYOFvP8KNaM7/jk/4WSKb8lqH60AeR0xCiMTyu39nb/vq6lplPAb XRYgqUoPrmBlFXd2rqMFhF5hMyAIFHD6vt0qnPZbI7R8Dvr48K+ZW+GlRTLmyF/dlsEY cU1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zx2c4.com header.s=20210105 header.b=ETLhNSfS; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=zx2c4.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id eq18-20020a056402299200b00461b0566a29si758643edb.137.2022.10.24.14.03.44; Mon, 24 Oct 2022 14:04:10 -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=@zx2c4.com header.s=20210105 header.b=ETLhNSfS; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=zx2c4.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234583AbiJXUjh (ORCPT + 99 others); Mon, 24 Oct 2022 16:39:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40632 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234580AbiJXUib (ORCPT ); Mon, 24 Oct 2022 16:38:31 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ED19429823 for ; Mon, 24 Oct 2022 11:49:30 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 67BEB61333 for ; Mon, 24 Oct 2022 16:29:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 24361C433C1; Mon, 24 Oct 2022 16:29:40 +0000 (UTC) Authentication-Results: smtp.kernel.org; dkim=pass (1024-bit key) header.d=zx2c4.com header.i=@zx2c4.com header.b="ETLhNSfS" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zx2c4.com; s=20210105; t=1666628977; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=qnKFjujepPdHfbu6wRQ2lttGCtGZBN1T6S7yDpV4J5A=; b=ETLhNSfSiAmLj+AZrLmp7/4zcstrELM+f+w78HntrC8J42WcHfhT1NyCLCMKdrbxlPL7dw a2cXXQvMyOueS+Y1ewL6sMriom1YBMXTu+SZV19/6PXXJYqbfeQ2tUoflGdM8HI6yRaINw FYkss2wQ/Z4MEHcOLzL60m+i2kM+HYA= Received: by mail.zx2c4.com (ZX2C4 Mail Server) with ESMTPSA id 8bdfdced (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Mon, 24 Oct 2022 16:29:37 +0000 (UTC) From: "Jason A. Donenfeld" To: linux-kernel@vger.kernel.org Cc: "Jason A. Donenfeld" , Jaroslav Kysela , Takashi Iwai , alsa-devel@alsa-project.org Subject: [PATCH] ALSA: au88x0: use explicitly signed char Date: Mon, 24 Oct 2022 18:29:29 +0200 Message-Id: <20221024162929.536004-1-Jason@zx2c4.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS 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 With char becoming unsigned by default, and with `char` alone being ambiguous and based on architecture, signed chars need to be marked explicitly as such. This fixes warnings like: sound/pci/au88x0/au88x0_core.c:2029 vortex_adb_checkinout() warn: signedness bug returning '(-22)' sound/pci/au88x0/au88x0_core.c:2046 vortex_adb_checkinout() warn: signedness bug returning '(-12)' sound/pci/au88x0/au88x0_core.c:2125 vortex_adb_allocroute() warn: 'vortex_adb_checkinout(vortex, (0), en, 0)' is unsigned sound/pci/au88x0/au88x0_core.c:2170 vortex_adb_allocroute() warn: 'vortex_adb_checkinout(vortex, stream->resources, en, 4)' is unsigned As well, since one function returns errnos, return an `int` rather than a `signed char`. Cc: Jaroslav Kysela Cc: Takashi Iwai Cc: alsa-devel@alsa-project.org Signed-off-by: Jason A. Donenfeld --- sound/pci/au88x0/au88x0.h | 6 +++--- sound/pci/au88x0/au88x0_core.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sound/pci/au88x0/au88x0.h b/sound/pci/au88x0/au88x0.h index 0aa7af049b1b..6cbb2bc4a048 100644 --- a/sound/pci/au88x0/au88x0.h +++ b/sound/pci/au88x0/au88x0.h @@ -141,7 +141,7 @@ struct snd_vortex { #ifndef CHIP_AU8810 stream_t dma_wt[NR_WT]; wt_voice_t wt_voice[NR_WT]; /* WT register cache. */ - char mixwt[(NR_WT / NR_WTPB) * 6]; /* WT mixin objects */ + s8 mixwt[(NR_WT / NR_WTPB) * 6]; /* WT mixin objects */ #endif /* Global resources */ @@ -235,8 +235,8 @@ static int vortex_alsafmt_aspfmt(snd_pcm_format_t alsafmt, vortex_t *v); static void vortex_connect_default(vortex_t * vortex, int en); static int vortex_adb_allocroute(vortex_t * vortex, int dma, int nr_ch, int dir, int type, int subdev); -static char vortex_adb_checkinout(vortex_t * vortex, int resmap[], int out, - int restype); +static int vortex_adb_checkinout(vortex_t * vortex, int resmap[], int out, + int restype); #ifndef CHIP_AU8810 static int vortex_wt_allocroute(vortex_t * vortex, int dma, int nr_ch); static void vortex_wt_connect(vortex_t * vortex, int en); diff --git a/sound/pci/au88x0/au88x0_core.c b/sound/pci/au88x0/au88x0_core.c index 2ed5100b8cae..f217c02dfdfa 100644 --- a/sound/pci/au88x0/au88x0_core.c +++ b/sound/pci/au88x0/au88x0_core.c @@ -1998,7 +1998,7 @@ static const int resnum[VORTEX_RESOURCE_LAST] = out: Mean checkout if != 0. Else mean Checkin resource. restype: Indicates type of resource to be checked in or out. */ -static char +static int vortex_adb_checkinout(vortex_t * vortex, int resmap[], int out, int restype) { int i, qty = resnum[restype], resinuse = 0; -- 2.38.1