From patchwork Fri Nov 1 22:17:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Lechner X-Patchwork-Id: 13859814 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 21A9315AAC1 for ; Fri, 1 Nov 2024 22:17:18 +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=1730499441; cv=none; b=e1SUUf4WkwKgBk0b06b9x95+NW4FfkUvb3+JpkaVAm78Sh94JAbLpDnmZUWsn2eUshmwKzNtyt8Wk7z97sc8sHY6kfS081nV5aba2LfWq+J6qZqs+iCnMkmXreOyerSMoWVsOq/PdMADoWAH5iBdaDf4r0282WnhJ3wkJJOXHBY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730499441; c=relaxed/simple; bh=pdrEtCsutVMsD7ZdyXTHnxVP1yiOgDXGeFRgfIDy81o=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Rh55L+w7QCcBAdVxRNNukwpyCm8pslU4RL3RUMmlfo0J5HO4v2Y0IxfEUn9TYzyGrwmXG9PS1YLCKutHRa2znNRunR7Qdd3bVgGV1bXfzCGtvlJipmeYrZd54qWk3N0UKiIJ+L0U/M7GbmyCOa7C2G0t8+P5yoX0Mo7rJzgdH3o= 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.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="BY5VmYvy" Received: by mail-ot1-f44.google.com with SMTP id 46e09a7af769-71850708dc9so1471330a34.0 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=flJo58//ivV7ultPxuQsdBik4+w7GNMeqYpASymt2011ZnCfCfYWgiFfjl1ATRNgTL olAISUcK986wjWs8DqS7A0vj0l/e2IYqzkjxK0acKcDyXHtBumsGqedMYImM0jfLNOWA jiOKsXHlF2jMxxPWN31Q3tZWIrCQTL4KWtamPexb3sDwieIUJetqEDRPsZeZi0iNBNTu +gbbwnTLTa1kyXUrx+OvG9e6u5E1FtXLl5SKQ81ZauQeQh/aW+CrrOZEKGlbLF5CQty3 MhzCB1ox5edxLJ8j/WHEgEtbzxgCs0VTRX7Ao8PmiOx5WtqMJLxVRj686c8sgltoz45b g4uQ== X-Gm-Message-State: AOJu0Ywc6crDr4pJv36Hg7Vh3myEUrZSg5+aVYXrJgmLmnhwd1nmchSH zv6zo1sLn7g6XuggPp7BHNXgwfi3jV0V5DgYIkLimk+1noJvTYkEkLT07BSb3OjCbYCwBXDj81T 2 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-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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/dummy/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: From patchwork Fri Nov 1 22:17:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Lechner X-Patchwork-Id: 13859815 Received: from mail-ot1-f53.google.com (mail-ot1-f53.google.com [209.85.210.53]) (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 C8FA01E7C37 for ; Fri, 1 Nov 2024 22:17:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730499443; cv=none; b=a6hA0nrUauFoY5o33/Hy2pYuJQ0fysIH5dwUYrpL4EzSKxkfA77LgOsfkfYKqW5q4tyAbTYIZwjo95Fv/Xnax7aOWPl17bjAXA0eO8IoU8vc6LC8Txpn8Xhz2MFaAYM46XdZWqxSoksl2zf7CJl9awcTd5TAklBdf6p/pJwzbBs= 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.53 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-f53.google.com with SMTP id 46e09a7af769-7180ab89c58so1159156a34.1 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=eLeruq9OPoDB7/4mI58PRqh1coZZPELqsX/JQkYcacSkFXQuqOXwg6KUXIOf3mhdE6 rdyJw0tj36i48+mnlQi8GyiNaKZYB0o9rO/cErH+QDFjjujcZB1LDUaMUX9Lqj+HG83i K1Ufy/vyDljnTCBTT1sLAu+tra7uBzryicCaUqJqAkLD2PqMKRwbiqbDwZyDFk9ZrtPi So2ZDwCbVkn9WD4E9+1L6OE8Ses48z7ZxRyG3zOrucftIKE6Lj/A/TKsp2mT4E/xJTaO +hZbaGGxdtVkhKnr8jUvkJ0K07FcIaNh1a9YH68HKUtGvGOM4OvD6BZojjGlVvVbc3Mu 4QYQ== X-Gm-Message-State: AOJu0YzM6P6jUuD9MqkOo7SKxCQh2X/2CzDsOv7OAWv7j6i2cbCVmhe/ 0NECuFV7fsEI3/3OA7N1TYBjU8ml4ANA9Ivn06m5FiiLeYaUCY/lkW2NP5i7y5w= 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-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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, void *private) if (ev_step_detect->enabled && (stepcnt != data->stepcnt)) { data->stepcnt = 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); } @@ -1042,20 +1042,18 @@ static irqreturn_t mma9553_event_handler(int irq, void *private) /* ev_activity can be NULL if activity == 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); 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); From patchwork Fri Nov 1 22:17:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Lechner X-Patchwork-Id: 13859816 Received: from mail-ot1-f45.google.com (mail-ot1-f45.google.com [209.85.210.45]) (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 377821EB9F9 for ; Fri, 1 Nov 2024 22:17:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730499446; cv=none; b=PUEj7URdSFY4NF2/+fh6hTym1pRH598uJyLxz15jm+b1Zf7KC91SjKKkXfOzhvZ/62CcQ0STHa/abPObMdT4zn17DAX0JW6wEkt01LTHql3sKzzUSqS58TwqNYepSGBjqlu/tro19zq5nef9HDvM096omVjE/HY5ymEZKTNFc50= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730499446; c=relaxed/simple; bh=howDg03PUqT5uHKdURne7uP61TjoAOHxS8hGuGevvVI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=A32Dju34A5ol86EKHNrGaauxmz/WItomTAHaMiAYcDiTXZO50tJ9Og2sQieZ+TeMraTyaUwDVB78UTCdQoX6dNHwJ32benWaUHi+gAi0qXDXwI67VtGNFbbEgHMESy1ekjri2QJy9rro1i+A2byN6rcfjBphb23Em/2j2vEmH7U= 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.45 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-f45.google.com with SMTP id 46e09a7af769-718998df806so1215106a34.1 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=KO50X356BLAsR14emmhRXTjCgH1UPBNvnQo75KAVsB/0R66I0mqohblFebrwHini2N rp/rVPXuGY0XqKwJnz7P5MIvCUFqMoBpe7xUmbEdVwwX4YC/APreh7mmfj0kt9KcZuVT xHGbAgyYWhHOq6jCT6Ydqx9d0NgCnvsHVRuKaOUzNiiD1v9p9JIJOsTIkGJH9den+zeq coH0MGB5NCb+zQ9VtbzGPqcwuPPO7etLvAi6g3TMpxzDojcyhTyH2t5d+W8JaZzQhLNg 5p9j2IFgZeyFSFz1lpYtp9MJwNOurHpzH6C4h+R6Pesib+z8lVddw9QoShsLbYmg4JGc dFmA== X-Gm-Message-State: AOJu0YzGYonOSnPQqLA8SQQwuQwyUfRqU3ZCruh7uBoJ9IPzs/YRgZTQ XdeAYx6I5YrGzCyySNRLEEWoX2goKvZFMlII6mEtSFjV+dlSNcU/ODdq1tCULRE= 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-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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 /** - * 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 one + * directly. */ -#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 @@ #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) /** * IIO_UNMOD_EVENT_CODE() - create event identifier for unmodified (non @@ -53,7 +56,7 @@ */ #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) /** * IIO_DIFF_EVENT_CODE() - create event identifier for differential channels @@ -65,6 +68,6 @@ */ #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) #endif