Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp195608pxk; Thu, 24 Sep 2020 03:23:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzsp22nc1/KBWsT0I8iEOpXMOPHJ6Ba2idyx7iNryWo+Hra8DZ4mdxL/856cE6uAvncyRO8 X-Received: by 2002:a17:906:e918:: with SMTP id ju24mr243640ejb.442.1600942997690; Thu, 24 Sep 2020 03:23:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600942997; cv=none; d=google.com; s=arc-20160816; b=t7RAIOXff2HBhaQLbqCJ81PsL8529a2ppjF+cq508621yo/dbvhv0nDNGKH854XVNa bQCdNqyYu+m5nhoE+XqPfsY6Q0/Y0MvxAhnQ2JozS2socRDBd4CvHBgpVZ0ZYc7j7dyV OQyyf9Ym+pTYSHutg4U4M5szg2B8nuiinxk9O88eZ31XwabPZivkUskzN+KJQ/19W/Jr 8PNbt8Q5arG+jdj/OzIglaKNWKlLMylCLEKygYuFtzK+Npfj+djfePnbDOhGQrdsoOge Ax2l55U9jXlquL86LVlAg/xOApUJ8YZYnYqBsAHbq6mKX+sfklK7g1jFM5iCm6UDRAS9 xRYw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=UnX/s8dZ825hFV3NINASU3thAKHqLnvKzLvNJDhsTxw=; b=H32+hUYRKYtI13Gt+r3ARNUkf7vJEXZnI3GIF4SyGm5+/6TY2MDsns5PwbAbiZQhzo GeHkAJU5kcoBMqroSv9e2HGyMImnQnIJE1K72pZ+Nk6XgSQZs2chsXeAwNzirmDfmy8K IUUZhKaGr32LpYMZrCq9ramwPP+PR6G21WB6A3HV+R6Q5x1LoiBBj8xro73NVowdC7KF f9z+bKE4hxX9oHbEZC4fA3hrIV/Ma4lM2jLRTDFr0LB+4l7Qtks1UW3eL4tiFrmHbwZi dMIR19a2Qh41mcKFJ0zV0xPcG3HezkBVp2o/8HRB8Am/r8E15beCmkn4bfpGsYQ7PLKn aelg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=nH3eZDk3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dr21si2193157ejc.186.2020.09.24.03.22.54; Thu, 24 Sep 2020 03:23:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=nH3eZDk3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727431AbgIXKVB (ORCPT + 99 others); Thu, 24 Sep 2020 06:21:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47622 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726380AbgIXKVA (ORCPT ); Thu, 24 Sep 2020 06:21:00 -0400 Received: from mail-pf1-x441.google.com (mail-pf1-x441.google.com [IPv6:2607:f8b0:4864:20::441]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DA1C2C0613CE for ; Thu, 24 Sep 2020 03:21:00 -0700 (PDT) Received: by mail-pf1-x441.google.com with SMTP id k13so1640466pfg.1 for ; Thu, 24 Sep 2020 03:21:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=UnX/s8dZ825hFV3NINASU3thAKHqLnvKzLvNJDhsTxw=; b=nH3eZDk35EHcCWXWaKQIMkR+yP2F/bGhle8z+L+nODfmh49vfcG+D/AlVlDcNwF93h 7Fa3DZyfzvLB2U5j7+Xjsa5/jBMi0ROHZCDnB4SoKEBoGbrPipDk+jFISQNbL4AGwCuy Om6S0Lwy7DhMMeb7B6X+UUluQOdKRvNTfcr1aiB/kVWRYwec26OpvHPbBBMM5M98Zemf 5tpIzf6p8z2ouj7VU93SiovfoQvUiSpgIDFDiLSbDd949AzNO9OH44VfgxZHr7sImXgA z0OzZjfgKEWmVn8+zbHWU93BWyHGvCslNmiw74IzdzBFgrY9dYo415wMQ/BWvE62o7Gp 5rQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=UnX/s8dZ825hFV3NINASU3thAKHqLnvKzLvNJDhsTxw=; b=Tiw19yas/yF5iF+8iNeIfdoaZmlwosKl0TmdBwmdrOBK+S2iqi4sX7TV8+kMJtitbR 7tQ444KALu7pBtUw8A5cTsLnGDERDDxoUTcRfsBimd1j9lP70WzRshHHFdn6MssBW6nP 5df8GeDm+TnEPGzoYs23uxWZvJ881ESt4j42J6WlmZcX8YJb1cZosazhhUlVO3wVQ4Zl zI4zscoFbepLI9KMujfHSAFL7Vh1G1m8DRXfQvYpHnjwm2jFYIfsnU4wmmiuR8KWZv1x MOM1Ys2d4d12GN9WWARMvTrduyMJONuY91GaPMAzKbOAjxQBJsx3ybpi1HX8H/Gfk0zM kiYw== X-Gm-Message-State: AOAM531wZIOzT0JIHJn3TdbMabVJatPbooXpjPNsdvHPUTFfM0UYe394 qmqvKx4yzVnJ287FNF8cD8M= X-Received: by 2002:a63:2f07:: with SMTP id v7mr3297305pgv.67.1600942860497; Thu, 24 Sep 2020 03:21:00 -0700 (PDT) Received: from localhost ([2001:e42:102:1532:160:16:113:140]) by smtp.gmail.com with ESMTPSA id fz23sm1922444pjb.36.2020.09.24.03.20.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Sep 2020 03:21:00 -0700 (PDT) From: Coiby Xu To: devel@driverdev.osuosl.org Cc: Vaibhav Agarwal , Mark Greer , Johan Hovold , Alex Elder , Greg Kroah-Hartman , Jaroslav Kysela , Takashi Iwai , greybus-dev@lists.linaro.org (moderated list:GREYBUS SUBSYSTEM), linux-kernel@vger.kernel.org (open list), alsa-devel@alsa-project.org (moderated list:SOUND) Subject: [PATCH 3/3] [PATCH] staging: greybus: __u8 is sufficient for snd_ctl_elem_type_t and snd_ctl_elem_iface_t Date: Thu, 24 Sep 2020 18:20:39 +0800 Message-Id: <20200924102039.43895-3-coiby.xu@gmail.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200924102039.43895-1-coiby.xu@gmail.com> References: <20200924102039.43895-1-coiby.xu@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use __8 to replace int and remove the unnecessary __bitwise type attribute. Found by sparse, $ make C=2 drivers/staging/greybus/ drivers/staging/greybus/audio_topology.c:185:24: warning: cast to restricted snd_ctl_elem_type_t drivers/staging/greybus/audio_topology.c:679:14: warning: restricted snd_ctl_elem_iface_t degrades to integer drivers/staging/greybus/audio_topology.c:906:14: warning: restricted snd_ctl_elem_iface_t degrades to integer Signed-off-by: Coiby Xu --- drivers/staging/greybus/audio_topology.c | 2 +- include/uapi/sound/asound.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/greybus/audio_topology.c b/drivers/staging/greybus/audio_topology.c index 56bf1a4f95ad..f6023ff390c2 100644 --- a/drivers/staging/greybus/audio_topology.c +++ b/drivers/staging/greybus/audio_topology.c @@ -182,7 +182,7 @@ static int gbcodec_mixer_ctl_info(struct snd_kcontrol *kcontrol, /* update uinfo */ uinfo->access = data->access; uinfo->count = data->vcount; - uinfo->type = (snd_ctl_elem_type_t)info->type; + uinfo->type = info->type; switch (info->type) { case GB_AUDIO_CTL_ELEM_TYPE_BOOLEAN: diff --git a/include/uapi/sound/asound.h b/include/uapi/sound/asound.h index 535a7229e1d9..8e71a95644ab 100644 --- a/include/uapi/sound/asound.h +++ b/include/uapi/sound/asound.h @@ -950,7 +950,7 @@ struct snd_ctl_card_info { unsigned char components[128]; /* card components / fine identification, delimited with one space (AC97 etc..) */ }; -typedef int __bitwise snd_ctl_elem_type_t; +typedef __u8 snd_ctl_elem_type_t; #define SNDRV_CTL_ELEM_TYPE_NONE ((__force snd_ctl_elem_type_t) 0) /* invalid */ #define SNDRV_CTL_ELEM_TYPE_BOOLEAN ((__force snd_ctl_elem_type_t) 1) /* boolean type */ #define SNDRV_CTL_ELEM_TYPE_INTEGER ((__force snd_ctl_elem_type_t) 2) /* integer type */ @@ -960,7 +960,7 @@ typedef int __bitwise snd_ctl_elem_type_t; #define SNDRV_CTL_ELEM_TYPE_INTEGER64 ((__force snd_ctl_elem_type_t) 6) /* 64-bit integer type */ #define SNDRV_CTL_ELEM_TYPE_LAST SNDRV_CTL_ELEM_TYPE_INTEGER64 -typedef int __bitwise snd_ctl_elem_iface_t; +typedef __u8 snd_ctl_elem_iface_t; #define SNDRV_CTL_ELEM_IFACE_CARD ((__force snd_ctl_elem_iface_t) 0) /* global control */ #define SNDRV_CTL_ELEM_IFACE_HWDEP ((__force snd_ctl_elem_iface_t) 1) /* hardware dependent device */ #define SNDRV_CTL_ELEM_IFACE_MIXER ((__force snd_ctl_elem_iface_t) 2) /* virtual mixer device */ -- 2.28.0