Received: by 2002:a05:7208:13ce:b0:7f:395a:35b6 with SMTP id r14csp157740rbe; Wed, 28 Feb 2024 15:55:20 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXEWAixGRiAN8QB66vecXQTP+m0UPCmnn2KVLeOTWigxnp/uefY1wx13YjZuhZ4grfIrEUckYqgWbdhsp/sQlrvhw075eEGmyqEMI47yQ== X-Google-Smtp-Source: AGHT+IEozM108em/Z4MS0jomLlpUrrgXqZyATHEZ6gseiKtGrXj4ZXOMlaalEuh24kyzLZv7k3Y+ X-Received: by 2002:ad4:4141:0:b0:690:77f:211a with SMTP id z1-20020ad44141000000b00690077f211amr773294qvp.23.1709164520013; Wed, 28 Feb 2024 15:55:20 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709164520; cv=pass; d=google.com; s=arc-20160816; b=Zjyl7hNdo0IRtYcNhT3TCxGHlIdZbTUxoV4HtBSYZs7un7sEJlqPULsftzQ5Gm5s6f U7v6lSFxuWyj+z7TrSWjufCulfCJnAOmfIzDOCilYh6NlORcDy4Jr28x3E5ZDW2nmqmZ 4H3b8H7ePccmtjcKA+cjULjkEoVcOblhjilUXAdWUd1h9lHImmRylpLybhAWbTgXQiQN qQnDWAxJiqWza4H6eYfR5yz9TluAtxn5pdvpsMDBgSb6GTnwe5AzSiPXsKymtXYVn+ax b1uO+nnYHr5WM6lfPoS5htNfoA3Ksar72i4cGVYWgxYw5WW5q5EwBCMVvBc6lW4cUbrO NUTA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=pPXa+ucMkbzg+JSAu1bfUtuEMy9DKcRW43G4pzRr21Y=; fh=SDJEwBjUOHB9dr3Xf35E782n6oCWBirh57Q+2DGhRIA=; b=Y7gIpLhMCNlim3OA/gITpOqo81d7c7PV2KLirBePDwEK+9S67jSFqKUyAvGpXooCGi 7zBDdu91QgyYwZ5y2uAaX9lYBTDgAhqHj/s4cEMyqpWgyF6Z609YgWNy9BRyJ3msayb8 wtjYz546v5iZgQm8AI7SCRb3rk/DCPxjeuh+6NJEiuJR/ZIY7zjq9fcc70ifGOXaDceg pp04bSvIGnVhPep5jPVDDVQPtiYkF3yLoyWxNiKntbCDzZXv4SpOu+Xb9UTdij4xTHgg miP0aNrv/dKE71N0syeyznSCCBEgPAda+qzhSFNLHeIY1x62fc4cJmillw17n/+nHcrk AyjA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=cHLGXjRQ; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-85689-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-85689-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id gw11-20020a0562140f0b00b0068f425e583dsi200111qvb.527.2024.02.28.15.55.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Feb 2024 15:55:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-85689-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=cHLGXjRQ; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-85689-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-85689-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 7268F1C2666D for ; Wed, 28 Feb 2024 20:50:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 509E21649C8; Wed, 28 Feb 2024 20:49:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="cHLGXjRQ" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.17]) (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 CD63215DBAF; Wed, 28 Feb 2024 20:49:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.17 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709153385; cv=none; b=dQOHCN3grEA0N5xNwweRgigcDgzx16f25iry8fkULB4I1ACmh7LhsB8kN3f2r0jC1GqePzpqeKV9YLo1HCGBbxgNOFulFTY82yz8fDiUbyD1c5Kh+CrZvvSEAKkYOA9fmF7T8HqXtPPA3rDA2iSkRAnktOx74Q0t4cDTdCr0Flk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709153385; c=relaxed/simple; bh=/llCeBOq/akHF/gxzRufHNlRAWfKFNHHOOSUCKXMrCA=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=r/9mrnXi3bBhnM620hlobSzMJP7X1CVaHHxTh5XzHi80EFxJ0eaSG5qpI10R8TFhdudYvltiOYbADvW2S8gt6vzRpkwMlJy/6UWD7/DH66LmxDtERXZeyepLmXz9yJCCe98VMWs+A9hpyLCvMk835SbKmiWTZzZcLwqqhW/kjwA= 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=cHLGXjRQ; arc=none smtp.client-ip=192.198.163.17 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1709153384; x=1740689384; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=/llCeBOq/akHF/gxzRufHNlRAWfKFNHHOOSUCKXMrCA=; b=cHLGXjRQlnHK/NHK2RUQAb8ubhD4SkqTdAqpUXBNBfEHRlUU3QSV8p/W faVQOxSAP2gA4TEMt9CTyG8ZguKjKtmDqbPP58UqMipsIj4A7FLxzx5+Q DKqkfz8e55YGCKTZbO08J/tDpNl+0z6pAMZt0DHcaksxU2vKTyUf9+sLp KO9luGtCTZQAZRLQbn+43fq9O7mJqX7f+k1kW7n9L38XpIE3yegMm0jLk lvqccnpwvCODnGfMSi/Gbl6VxvSWpLCCLorCBN4nZexleVl96R81gV6Eo /563T3qQdNuKy9CPoz45SiPBeJlYwSp7vktcwR20GJO29Tg/7OZomYWBI Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10998"; a="3428709" X-IronPort-AV: E=Sophos;i="6.06,191,1705392000"; d="scan'208";a="3428709" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmvoesa111.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Feb 2024 12:49:40 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10998"; a="937034657" X-IronPort-AV: E=Sophos;i="6.06,191,1705392000"; d="scan'208";a="937034657" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga001.fm.intel.com with ESMTP; 28 Feb 2024 12:49:35 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 01E211C5; Wed, 28 Feb 2024 22:49:33 +0200 (EET) From: Andy Shevchenko To: Vinod Koul , Linus Walleij , Jonathan Cameron , Andy Shevchenko , Mark Brown , Kees Cook , linux-arm-kernel@lists.infradead.org, dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org, linux-spi@vger.kernel.org, netdev@vger.kernel.org, linux-hardening@vger.kernel.org Cc: Jonathan Cameron , Lars-Peter Clausen , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , "Gustavo A. R. Silva" Subject: [PATCH v4 0/8] iio: core: New macros and making use of them Date: Wed, 28 Feb 2024 22:41:30 +0200 Message-ID: <20240228204919.3680786-1-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1.gbec44491f096 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Added new macros to overflow.h and reuse it in IIO. For the sake of examples a few more places were updated (requested by Kees). In case maintainers are okay, tags will be appreciated. v4: - dropped applied patches - refactored macros and code to make them simpler (Jonathan) - moved (renamed) macros to overflow.h v3: https://lore.kernel.org/r/20230724110204.46285-1-andriy.shevchenko@linux.intel.com - dropped applied patches - use switch-case for the supported clocks (Jonathan) - redone opaque_struct_size() to be simpler (Uwe) - dropped wrong hunk for krealloc_array() conversion (Jonathan) - dropped initcall move (Jonathan) v2: - sprintf() --> sysfs_emit() (Nuno) - added tag (Nuno) Andy Shevchenko (8): overflow: Use POD in check_shl_overflow() overflow: Add struct_size_with_data() and struct_data_pointer() helpers iio: core: NULLify private pointer when there is no private data iio: core: Calculate alloc_size only once in iio_device_alloc() iio: core: Use new helpers from overflow.h in iio_device_alloc() spi: Use new helpers from overflow.h in __spi_alloc_controller() net-device: Use new helpers from overflow.h in netdevice APIs dmaengine: ste_dma40: Use new helpers from overflow.h drivers/dma/ste_dma40.c | 12 ++++++------ drivers/iio/industrialio-core.c | 16 +++++++++------- drivers/spi/spi.c | 6 +++--- include/linux/netdevice.h | 3 ++- include/linux/overflow.h | 29 +++++++++++++++++++++++++++-- net/core/dev.c | 10 +++++----- 6 files changed, 52 insertions(+), 24 deletions(-) -- 2.43.0.rc1.1.gbec44491f096