From nobody Sun Nov 24 20:27:23 2024 Received: from mail-ot1-f41.google.com (mail-ot1-f41.google.com [209.85.210.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 138DC15820E for ; Fri, 1 Nov 2024 22:17:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730499442; cv=none; b=fapJmDNgsGASBaolEp+y3uHrzxR7RLTRsez4B9kJOSoiBhZjx4ye7X1MZpFsKiVARW5U6zVQ4G7apnMc7IbnOxjjufJ6OvrNnyGHyuJTDEehz1BJudNNn3U1J321iBr8IUEodYh3+CHe6nA5Qk6u8FhMZiGdMh6OkF02Hj8Ehh8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730499442; c=relaxed/simple; bh=pdrEtCsutVMsD7ZdyXTHnxVP1yiOgDXGeFRgfIDy81o=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=DGneSOBNFU8nwYSVVhsVM8mAQfmmxDKE/k+QzWaNZWyG58MaS3rfSmm+jK91lhP4NdJczVVSgxKjqqPGx8FaGs6LXag0dKtj4enNV+pcLDuz27M3CScuBSkID7TC4k/7fYKaPQVDxHtdlbu2KHWpBreUluAabkJQ2A7JuJTdEAM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=BY5VmYvy; arc=none smtp.client-ip=209.85.210.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="BY5VmYvy" Received: by mail-ot1-f41.google.com with SMTP id 46e09a7af769-7181eb9ad46so1270690a34.1 for ; Fri, 01 Nov 2024 15:17:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1730499438; x=1731104238; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=xLqOXH+eJdFKT3oFXoLVHge15ZV+4BlbLGdxueVt+Hk=; b=BY5VmYvyKYp2402/ynbeprqAx7UIPNWjS4B/YEz1Ie1UDGNlTnCAWnLCvrtHghOZbr XWQ8F1qoEIuLg7I8+lTxxWJbjRjy98aiPe7Mu67teSC2DnKSmpI4OnjZeSHwjf46+6jH 6rxPLqmPFVozkNthc1jQWhqMs/hA7SyRD5ecfj9bAZFGSMyJ1rhImH3Ts5uHVX20HaLB fV3kauBLj3SrmHjwGp+6KCvVAPFC01pQX48r534c9ih1CdGnMheIC4R0s6el/FgPiGzT SDGfDGzvH8GTerF0SidTCEOjYpL0DZ72c6XtqSIq+MEliK77Z7cv69Ehk7hn4mwQ3BN4 21rQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730499438; x=1731104238; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xLqOXH+eJdFKT3oFXoLVHge15ZV+4BlbLGdxueVt+Hk=; b=nM8CGTNkq20xNoshTOmrWV349/Rq+Pxq32L+4INeDhi77FTNB1jsHCOmO5+3O4WE6K Mro1Ufh/yKWi8sfWaL6Px5huSd4+jk3uyHGX3B0STHvhd9ouUYkQPkefqFJ37wGFvcLY Nkm0aUBPYGUU/MGO0kAH+NWHqkk+SjgzmoIo3CH+hdGRNrEOpxF0WswQj+uEPo8GGjyZ wzXyE0WZp2FwfTaDyn8jAklVkzaO0mICcG0LVLxigcTXNuycCy3KpX8Utya2WjZ/TVJK STQNcD5uDfji/YjhoWYrD3ROhjv1AU1hylqzSY0gPGsgJdlKpuel3/NDMs2uRQIUJcyg DnJA== X-Forwarded-Encrypted: i=1; AJvYcCWgTXXEAH2yRoaS/uCL5Zc3DW4l+pMZ6k9LVC/eMIceV00q5MjsiOr6F8axT1cFulomoNOK2Pz+D+PQ/dk=@vger.kernel.org X-Gm-Message-State: AOJu0YwJbTjGAKCWyzJGTAneExPcdV2P91Hw4loVkVr2aDXaPb1Uaqsa kiBDz8E3c0geTvRoqDJJTqseni7wk+4T8Fs98zsTgbfeEaElyNZRgx9TscDeon0= X-Google-Smtp-Source: AGHT+IEVHFylBhGTVRnutothbagJB8enBNQj4LhsoJItGeX4ocpWlbNECxlA0RranBN9azfEBkq85Q== X-Received: by 2002:a05:6830:6c88:b0:719:cc74:dfd9 with SMTP id 46e09a7af769-719cc74e0f4mr3121612a34.3.1730499438153; Fri, 01 Nov 2024 15:17:18 -0700 (PDT) Received: from [127.0.1.1] (ip98-183-112-25.ok.ok.cox.net. [98.183.112.25]) by smtp.gmail.com with ESMTPSA id 006d021491bc7-5ec70698049sm789817eaf.48.2024.11.01.15.17.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Nov 2024 15:17:16 -0700 (PDT) From: David Lechner Date: Fri, 01 Nov 2024 17:17:08 -0500 Subject: [PATCH 1/3] iio: dummy: use specialized event code macros 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 Message-Id: <20241101-iio-fix-event-macro-use-v1-1-0000c5d09f6d@baylibre.com> References: <20241101-iio-fix-event-macro-use-v1-0-0000c5d09f6d@baylibre.com> In-Reply-To: <20241101-iio-fix-event-macro-use-v1-0-0000c5d09f6d@baylibre.com> To: Jonathan Cameron Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, David Lechner X-Mailer: b4 0.14.1 Simplify the code by using IIO_UNMOD_EVENT_CODE and IIO_MOD_EVENT_CODE instead of IIO_EVENT_CODE. Signed-off-by: David Lechner --- drivers/iio/dummy/iio_simple_dummy_events.c | 30 ++++++++++++++-----------= ---- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/drivers/iio/dummy/iio_simple_dummy_events.c b/drivers/iio/dumm= y/iio_simple_dummy_events.c index c7f2d3a4d60b..b51ec21b6309 100644 --- a/drivers/iio/dummy/iio_simple_dummy_events.c +++ b/drivers/iio/dummy/iio_simple_dummy_events.c @@ -183,36 +183,34 @@ static irqreturn_t iio_simple_dummy_event_handler(int= irq, void *private) switch (st->regs->reg_data) { case 0: iio_push_event(indio_dev, - IIO_EVENT_CODE(IIO_VOLTAGE, 0, 0, - IIO_EV_DIR_RISING, - IIO_EV_TYPE_THRESH, 0, 0, 0), + IIO_UNMOD_EVENT_CODE(IIO_VOLTAGE, 0, + IIO_EV_TYPE_THRESH, + IIO_EV_DIR_RISING), st->event_timestamp); break; case 1: if (st->activity_running > st->event_val) iio_push_event(indio_dev, - IIO_EVENT_CODE(IIO_ACTIVITY, 0, - IIO_MOD_RUNNING, - IIO_EV_DIR_RISING, - IIO_EV_TYPE_THRESH, - 0, 0, 0), + IIO_MOD_EVENT_CODE(IIO_ACTIVITY, 0, + IIO_MOD_RUNNING, + IIO_EV_TYPE_THRESH, + IIO_EV_DIR_RISING), st->event_timestamp); break; case 2: if (st->activity_walking < st->event_val) iio_push_event(indio_dev, - IIO_EVENT_CODE(IIO_ACTIVITY, 0, - IIO_MOD_WALKING, - IIO_EV_DIR_FALLING, - IIO_EV_TYPE_THRESH, - 0, 0, 0), + IIO_MOD_EVENT_CODE(IIO_ACTIVITY, 0, + IIO_MOD_WALKING, + IIO_EV_TYPE_THRESH, + IIO_EV_DIR_FALLING), st->event_timestamp); break; case 3: iio_push_event(indio_dev, - IIO_EVENT_CODE(IIO_STEPS, 0, IIO_NO_MOD, - IIO_EV_DIR_NONE, - IIO_EV_TYPE_CHANGE, 0, 0, 0), + IIO_UNMOD_EVENT_CODE(IIO_STEPS, 0, + IIO_EV_TYPE_CHANGE, + IIO_EV_DIR_NONE), st->event_timestamp); break; default: --=20 2.43.0 From nobody Sun Nov 24 20:27:23 2024 Received: from mail-ot1-f44.google.com (mail-ot1-f44.google.com [209.85.210.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C36121E7C2C for ; Fri, 1 Nov 2024 22:17:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730499443; cv=none; b=sZLHocXt+TjVN6x1jqe/k9YhbIdGpkGHOYYqC+uROP9duPb0vvWhkRvZ+xnfzLblm454dngJifgkeWdIhp+AZOmp4fQtFQF/3m5yu0xzC12XgF5BQ1mYlV2Ztp1WQYAeseOA75fZZZAlu6m4cQFmhDpRQQNZQOGJtaDC/2QXu38= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730499443; c=relaxed/simple; bh=m1YPenGQkWl/zDdbYUdX2RWyx9UwmWv7bbCPVpnxn78=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=IKNnDfnCfCx3weM/uLjP4WbfjSaTwh0u1untOV0MG0c1xqH8jsKuL4w+nlBkLNKdPuShMujS+Wqw6ZxybxylIjruyQrqCBAOyPbIa/4kOSGx5Oa5Oco26NbCAvQgh1kyCuck3pEfVdXhyV5NKcUeyS5qzCctMAbujVMlDXe/rrI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=MNX2sM4b; arc=none smtp.client-ip=209.85.210.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="MNX2sM4b" Received: by mail-ot1-f44.google.com with SMTP id 46e09a7af769-71809fe188cso1244454a34.0 for ; Fri, 01 Nov 2024 15:17:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1730499441; x=1731104241; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=8NG086UAVHhHYbTY4/rXpdjHhnow1FtKZ4XRiPy3fDw=; b=MNX2sM4bkazFk/vdMUJ5AXplFlPq8T0sNJGR9kfFrQn18u38jXHC7R8Xoiv0Dx6/nt 5t7WDrPiYxyDKRCdkpGYorZR+hDws3idrpoUUB9zdIiCMCoqcmoilm8UfSSdMlwjj9nr FUrj+Hc00y5ML41t7km6XGMAfAamxctv+j4l4cqm1W7TW/E/URKhu224O6UW+8bMTvbl xTWg2OVxE1AEvuEnywCAZuVW1BkxXTC2c4lsgzCmlXSPeqZpR8Dr2y+Fm/hs3Y0aS0HS cs/uW7UtMaH0kb0vbT72Nmcb/CokP0te+jIb7NGDLLEKY2G7ZwRKa+kgPHgrkEo9cr6o Tx4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730499441; x=1731104241; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8NG086UAVHhHYbTY4/rXpdjHhnow1FtKZ4XRiPy3fDw=; b=Bm6RUDRi5jDWACYIah83WyoTZmxICmEIzqiMSff8G5k7DDfTjCUHYXbQ9ks7mk6LO5 gQbk3Uh2ED+RJbd7flt6x4AU7PWjfk/1jeij5dYaRz0W0C0P44Uzam88xFYMuaB6vPwF +OqX8yEEUNsQpsrQvRQPmkxE5t80I9PmmB1R6OFUUaMWIc9r9CfxQHXaHZapxbWxH1ab kREX0JO5Xocn8JlgtATAa5HjWblUXysk3QCWRpvVvPRNJ0qx+rl9U98plz2X83N2Gmhl i8l/GYEldE6DB11QwKYG6yOfABdPXuV7f4MWAH93urpuZJ7C11X8D/sBcQD74Y2eqt5y Flvw== X-Forwarded-Encrypted: i=1; AJvYcCV/5BYExK21zFmaWOwNpjcwU5CmppDT6TIjKVDgrl57dWKThFOlv32iZ9NHCCev4zOKFPWSbN7BcBdjhSE=@vger.kernel.org X-Gm-Message-State: AOJu0YzevGyO/iEIWSWb/kw0TqAl142JArr8XjamoBBOlzbSdPUVt59z QKxXVWGq5Ms/Fe96piXt6h6vcI5KDOcQwZmyh6fwsOBKL3n97pYBK7eu8Kg+5x8= X-Google-Smtp-Source: AGHT+IGuiRggc/VEOXvy/hqc6GPaEDJwMTU6wKNAh5o/gkpRr3AvH9ZaGnzuQSPoyBxVCuiCZVBdfw== X-Received: by 2002:a05:6830:4406:b0:718:8dc:a5e with SMTP id 46e09a7af769-7189b4df036mr6875600a34.9.1730499440886; Fri, 01 Nov 2024 15:17:20 -0700 (PDT) Received: from [127.0.1.1] (ip98-183-112-25.ok.ok.cox.net. [98.183.112.25]) by smtp.gmail.com with ESMTPSA id 006d021491bc7-5ec70698049sm789817eaf.48.2024.11.01.15.17.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Nov 2024 15:17:19 -0700 (PDT) From: David Lechner Date: Fri, 01 Nov 2024 17:17:09 -0500 Subject: [PATCH 2/3] iio: accel: mma9553: use specialized event code macros 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 Message-Id: <20241101-iio-fix-event-macro-use-v1-2-0000c5d09f6d@baylibre.com> References: <20241101-iio-fix-event-macro-use-v1-0-0000c5d09f6d@baylibre.com> In-Reply-To: <20241101-iio-fix-event-macro-use-v1-0-0000c5d09f6d@baylibre.com> To: Jonathan Cameron Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, David Lechner X-Mailer: b4 0.14.1 Simplify the code by using IIO_UNMOD_EVENT_CODE and IIO_MOD_EVENT_CODE instead of IIO_EVENT_CODE. Signed-off-by: David Lechner --- drivers/iio/accel/mma9553.c | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/drivers/iio/accel/mma9553.c b/drivers/iio/accel/mma9553.c index 43ba04c606a4..8536743a6886 100644 --- a/drivers/iio/accel/mma9553.c +++ b/drivers/iio/accel/mma9553.c @@ -1031,9 +1031,9 @@ static irqreturn_t mma9553_event_handler(int irq, voi= d *private) if (ev_step_detect->enabled && (stepcnt !=3D data->stepcnt)) { data->stepcnt =3D stepcnt; iio_push_event(indio_dev, - IIO_EVENT_CODE(IIO_STEPS, 0, IIO_NO_MOD, - IIO_EV_DIR_NONE, - IIO_EV_TYPE_CHANGE, 0, 0, 0), + IIO_UNMOD_EVENT_CODE(IIO_STEPS, 0, + IIO_EV_TYPE_CHANGE, + IIO_EV_DIR_NONE), data->timestamp); } =20 @@ -1042,20 +1042,18 @@ static irqreturn_t mma9553_event_handler(int irq, v= oid *private) /* ev_activity can be NULL if activity =3D=3D ACTIVITY_UNKNOWN */ if (ev_prev_activity && ev_prev_activity->enabled) iio_push_event(indio_dev, - IIO_EVENT_CODE(IIO_ACTIVITY, 0, - ev_prev_activity->info->mod, - IIO_EV_DIR_FALLING, - IIO_EV_TYPE_THRESH, 0, 0, - 0), + IIO_MOD_EVENT_CODE(IIO_ACTIVITY, 0, + ev_prev_activity->info->mod, + IIO_EV_TYPE_THRESH, + IIO_EV_DIR_FALLING), data->timestamp); =20 if (ev_activity && ev_activity->enabled) iio_push_event(indio_dev, - IIO_EVENT_CODE(IIO_ACTIVITY, 0, - ev_activity->info->mod, - IIO_EV_DIR_RISING, - IIO_EV_TYPE_THRESH, 0, 0, - 0), + IIO_MOD_EVENT_CODE(IIO_ACTIVITY, 0, + ev_activity->info->mod, + IIO_EV_TYPE_THRESH, + IIO_EV_DIR_RISING), data->timestamp); } mutex_unlock(&data->mutex); --=20 2.43.0 From nobody Sun Nov 24 20:27:23 2024 Received: from mail-ot1-f50.google.com (mail-ot1-f50.google.com [209.85.210.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0FCFC1E7C37 for ; Fri, 1 Nov 2024 22:17:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730499445; cv=none; b=GGLlZRghaSIlbmyFkmw0Rj6VUQ5xNGTa8wv/kOWAltEd3Neo899L/fYqZGNb4cjS7fB85Yr5c+fsxfY96qcv5lDK0RUqG/9wgVYMdSzTo+lR9vBfft/aZMsPgY4eQWGGO0Gbc9Z+13K3GXKJXHaJSnBZSkF3GN1CUnQUSw3C3Xo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730499445; c=relaxed/simple; bh=howDg03PUqT5uHKdURne7uP61TjoAOHxS8hGuGevvVI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=S2EYj0LtIRkFTB8WaxsjgPdpnvrsCNxxk9vuwPYSiNXvFv0J7nGte+QsE50FgzBfi/qH2AQejSQXi7E0KId/Rrd8/1KuJwgviZ+niDgPy/32s26soRhLarrNFg1VhBuRyc2LQHHezekhSw3NyVIOPFmArgmD+gpWCHrTI0PLbVY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=MmQKJi8n; arc=none smtp.client-ip=209.85.210.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="MmQKJi8n" Received: by mail-ot1-f50.google.com with SMTP id 46e09a7af769-7181285c7c4so1236100a34.0 for ; Fri, 01 Nov 2024 15:17:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1730499443; x=1731104243; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=p5Y1tvObaqLtYvvCPOD8mS69Ek9mYQwEF5EMFUWXabY=; b=MmQKJi8nIJpLcpBz+K6jwSaeBBtOIw/xPY5q/R6ClpR9Cws5eSGT5o4qyxTrCyZJEd +YmYst5qZd4MetlcQu+332IXj3dTfIs31oXx403HwmfJYJkAm1c8Conn65MHHX7JVQ83 3c4mj/f4T+RMgaitEum7Sdp/mS5Pa9eWtgZxrbxTyMVUMI5P5gVgZNOSt1ZUZN5I0eUy hfG97IhQZF/i6fV9H6JI4aIBBuGM3CwJKw/bb7G/ymqBHewbNANjh8TdEFMpvdzvRmUG YaYs69+m7efsKPQYvJMCmbirCSFFzYriKX3zLRuCJK+BOU82fypGX2Ynw60fclpJ3vS1 3lcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730499443; x=1731104243; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=p5Y1tvObaqLtYvvCPOD8mS69Ek9mYQwEF5EMFUWXabY=; b=mHWEt63uPWTK1FR81LILPxKgkLAollcHNn7unolbn3fr3B59lPaRmQEjjjY9eB97P8 TLIKN4KX9RGkZrqhGKMwUNQJP7QOlyayMyZlRioEdUIyXFhLF5RYZcBlcG4X2wB5f0XI A10QEx9+Ir653FHOvpXmJZGmHhyG2UsUkPqn1Jt1UAaWtzbyDjHdKCd408iUSWvXszLk LzMocaD5VE+YAXfjvEixiy74Cu22JJuRSO802wucVgomFQCsn44tWvbe/AjxwMJ1CyU8 oMQUsHi2MayQ8k/Pagedd5UHVi7sWkJsl6IkQJFRD3hYvO1GBFxNT9PfpIntHrV2chDW 9zRA== X-Forwarded-Encrypted: i=1; AJvYcCXbF7ZiXsRONTPCem4BEXRidV4fyB27mTnIHuAbYlQxe2rcl1cEgWA7T9HFdsUtewfvkSiQIE/5eNk7+zE=@vger.kernel.org X-Gm-Message-State: AOJu0Yw1R9hYbYxCdW8zt5lXJIPGhlXfJ7sYwX7r783lUvk9rfWq8OGj zlUQfq73MRE5GpvkWJ/lrrlYIRxxMLh1aSilpgvY9at+2BcEVE4jp8TnhxYvTaA= X-Google-Smtp-Source: AGHT+IFwkbWKQ4IGA+r9HW9czIJ7AoQH9s1W0J0JftvMv3EZw3NwVqMe4Cj+MED97B4IZFL9AP8xkQ== X-Received: by 2002:a05:6830:3748:b0:718:9c7c:2b33 with SMTP id 46e09a7af769-719ca2472b6mr5863742a34.23.1730499443202; Fri, 01 Nov 2024 15:17:23 -0700 (PDT) Received: from [127.0.1.1] (ip98-183-112-25.ok.ok.cox.net. [98.183.112.25]) by smtp.gmail.com with ESMTPSA id 006d021491bc7-5ec70698049sm789817eaf.48.2024.11.01.15.17.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Nov 2024 15:17:21 -0700 (PDT) From: David Lechner Date: Fri, 01 Nov 2024 17:17:10 -0500 Subject: [PATCH 3/3] iio: events: make IIO_EVENT_CODE macro private 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 Message-Id: <20241101-iio-fix-event-macro-use-v1-3-0000c5d09f6d@baylibre.com> References: <20241101-iio-fix-event-macro-use-v1-0-0000c5d09f6d@baylibre.com> In-Reply-To: <20241101-iio-fix-event-macro-use-v1-0-0000c5d09f6d@baylibre.com> To: Jonathan Cameron Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, David Lechner X-Mailer: b4 0.14.1 Make IIO_EVENT_CODE "private" by adding a leading underscore. There are no more users of this macro in the kernel so we can make it "private" and encourage developers to use the specialized versions of the macro instead. Signed-off-by: David Lechner --- include/linux/iio/events.h | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/include/linux/iio/events.h b/include/linux/iio/events.h index eeaba5e1525e..72062a0c7c87 100644 --- a/include/linux/iio/events.h +++ b/include/linux/iio/events.h @@ -10,7 +10,7 @@ #include =20 /** - * IIO_EVENT_CODE() - create event identifier + * _IIO_EVENT_CODE() - create event identifier * @chan_type: Type of the channel. Should be one of enum iio_chan_type. * @diff: Whether the event is for an differential channel or not. * @modifier: Modifier for the channel. Should be one of enum iio_modifier. @@ -19,10 +19,13 @@ * @chan: Channel number for non-differential channels. * @chan1: First channel number for differential channels. * @chan2: Second channel number for differential channels. + * + * Drivers should use the specialized macros below instead of using this o= ne + * directly. */ =20 -#define IIO_EVENT_CODE(chan_type, diff, modifier, direction, \ - type, chan, chan1, chan2) \ +#define _IIO_EVENT_CODE(chan_type, diff, modifier, direction, \ + type, chan, chan1, chan2) \ (((u64)type << 56) | ((u64)diff << 55) | \ ((u64)direction << 48) | ((u64)modifier << 40) | \ ((u64)chan_type << 32) | (((u16)chan2) << 16) | ((u16)chan1) | \ @@ -41,7 +44,7 @@ =20 #define IIO_MOD_EVENT_CODE(chan_type, number, modifier, \ type, direction) \ - IIO_EVENT_CODE(chan_type, 0, modifier, direction, type, number, 0, 0) + _IIO_EVENT_CODE(chan_type, 0, modifier, direction, type, number, 0, 0) =20 /** * IIO_UNMOD_EVENT_CODE() - create event identifier for unmodified (non @@ -53,7 +56,7 @@ */ =20 #define IIO_UNMOD_EVENT_CODE(chan_type, number, type, direction) \ - IIO_EVENT_CODE(chan_type, 0, 0, direction, type, number, 0, 0) + _IIO_EVENT_CODE(chan_type, 0, 0, direction, type, number, 0, 0) =20 /** * IIO_DIFF_EVENT_CODE() - create event identifier for differential channe= ls @@ -65,6 +68,6 @@ */ =20 #define IIO_DIFF_EVENT_CODE(chan_type, chan1, chan2, type, direction) \ - IIO_EVENT_CODE(chan_type, 1, 0, direction, type, 0, chan1, chan2) + _IIO_EVENT_CODE(chan_type, 1, 0, direction, type, 0, chan1, chan2) =20 #endif --=20 2.43.0