From patchwork Wed Dec 4 01:33:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13893123 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 522A32B9B4; Wed, 4 Dec 2024 01:36:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.16 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733276190; cv=none; b=UeAHQToIiWZUxY0rtQcFOt6OEqz3Oj1KnkL8Tu/o65QrfJ45jlnFVXh+eLwZk+WV4gin47dDL2gkm2KFPzAQqQXyrpw+o2LPhaNh98kcudwkYjT00i4sP+NvMeL+tUxdDsVCcmUy6rK5ilfUu231im85hsB0BVUCJTjjwGgH5aQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733276190; c=relaxed/simple; bh=sxpfgYRL87ZHH1NSsihdavadeHs1MoFRpkN5L2T6KpU=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=c5+b+RIp0hi+FSyt4eTaPmqA8zdqleRxoe3jr4n5WUz4CH3AZyBqrUJs6Ze6SWpV6jqtmq3DCU41UaqhodYKYQAJyjczR2KL4PyUOfkEM/k4GYHylPA/NhMqaaanOt88nzOu/jOB1F77GSymfBRT6GXKOwRRi9moCt6VwRHAezQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=nNoj/w7W; arc=none smtp.client-ip=198.175.65.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="nNoj/w7W" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1733276189; x=1764812189; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=sxpfgYRL87ZHH1NSsihdavadeHs1MoFRpkN5L2T6KpU=; b=nNoj/w7WdqXhaVVyXmOgBfAyyRbtM/+SG3Iygrw/GKiIzWXxMG3VuTBk Zalk6dLHCLl9JrgBgwPOeubiElNK8KeQPF/5U+UzmNYzPtNs3pvjCVbGo uR8aFhypRQlG5wPZv0sXxp6lUuE5+ElrJPIs69XqmhZr/qTtbQKysIFK7 aTggzIgJ0Zn3audKKGjXs5qA6RvCvR+1L8q8lX+F9AJoFUi4p7qxtC8ZB uYbC/kPB9Hp/WWRrNOGMOch1ukqWiDgjZ1GFNZc30UcmZ1STa1sTc7oms 7PRkDPDFJDvwQQkkrG7DP9360jkxIANreSA+AnqDfjRfJmj/NiAs+ch/e A==; X-CSE-ConnectionGUID: OKDw726YQYSP13UHsxAsYg== X-CSE-MsgGUID: YHCZZd0GTyKjVqYuj0tHzw== X-IronPort-AV: E=McAfee;i="6700,10204,11275"; a="33655189" X-IronPort-AV: E=Sophos;i="6.12,206,1728975600"; d="scan'208";a="33655189" Received: from orviesa005.jf.intel.com ([10.64.159.145]) by orvoesa108.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Dec 2024 17:36:25 -0800 X-CSE-ConnectionGUID: g32QDGLpQXehFhsB9Et4wA== X-CSE-MsgGUID: x0FuIzJmRY63mAtgytDZbg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,206,1728975600"; d="scan'208";a="98600612" Received: from black.fi.intel.com ([10.237.72.28]) by orviesa005.jf.intel.com with ESMTP; 03 Dec 2024 17:36:23 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 0BFF227C; Wed, 04 Dec 2024 03:36:21 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Peter Rosin , Jonathan Cameron , Lars-Peter Clausen Subject: [PATCH v1 0/4] iio: afe: rescale: A few cleanups Date: Wed, 4 Dec 2024 03:33:15 +0200 Message-ID: <20241204013620.862943-1-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1336.g36b5255a03ac Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 There are cleanups to the code, most of the + LoCs due to missed inclusions. The patch 3 is kinda interesting as in long term the idea to add multiplication and division macros over the fract structures, which will simplify code that uses rational numbers. Hence the mentioned patch is just a preparatory for making next step easier. Andy Shevchenko (4): iio: afe: rescale: Don't use ^ for booleans iio: afe: rescale: Don't use ULL(1) << x instead of BIT(x) iio: afe: rescale: Re-use generic struct s32_fract iio: afe: rescale: Don't use "proxy" headers drivers/iio/afe/iio-rescale.c | 88 ++++++++++++++++++--------------- include/linux/iio/afe/rescale.h | 5 +- 2 files changed, 51 insertions(+), 42 deletions(-)