Received: by 2002:ab2:784b:0:b0:1fd:adc2:8405 with SMTP id m11csp25012lqp; Sun, 9 Jun 2024 14:41:22 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXjg6e9saBwLYdNBsGm08hw64y8YI2lNo1DpfPQysZMcjV3rrtLaf+u3hYy5jLA8MIvuut9epXcklrJD4K8ewkw19KnbnHPP/c+KIQvfg== X-Google-Smtp-Source: AGHT+IFpqbgqOOaYKLs20yWSZE90a89arNcCmyM0XA2g3/ijp2wHx8q1ICrRiK9sEypOrpiuvQwe X-Received: by 2002:a17:902:d50f:b0:1f7:19d6:f9f with SMTP id d9443c01a7336-1f719d6160cmr1842335ad.1.1717969281770; Sun, 09 Jun 2024 14:41:21 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717969281; cv=pass; d=google.com; s=arc-20160816; b=AxvYDqktjYvwIgKdoybVOeen4Nik12fbQldQjy/mn9lf/PCffjVuy0/qrE2un45bP/ xB/evKc3HH6nminbx4xf3T5NpM2YaGatAUZ6409zvXJtwNrhBaIzzpf7F4BuYkCzQG/t 5llyLPc0kZRDUFSyptaaxAIaHykIuD3t7vIYuV93fWVSW6k7ZNRgcVFennebckmBZGbi si+wa6l8rMHl/zzNGpw7L9eFYxzIb/qN+aLICYawiHtl/k5rbiOFZY0a6UBn1XKwwD3v V0WZc0n3UFsI1blWIhkrnPkwQ2VCedi/kUTBP0ApR3iGM2lZhrpl2zgkJcHSK8Rd5iaa oOAg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=ecB0puB5CrDlsinl6SGmOW0Gy36kwzCicVzoDhVT234=; fh=REE3HDeWkRTZ4ZWkfQpPyVHuN1UIxUk4AW/neq5jkKM=; b=rdjUQT9CuhF8Ww6XE9qlOGeyeXyJhpSZcEpD1RXJzxJCBowVcLMvVf7UEjN+XlnDV7 Yb84tjxaWw+ZGJ1JDVe4TnfFqR+T2CCaB8TCNZzNVmcu6SIlSmJzTBGPOdDxsg1NsJvn oRXELtweC5SQvYRBFp6EyC1IFcmjHjaA30Shqw9BHCQxOoWM08ZWcYEv8EAxwU4nA90d w2pSFILfaJDFGOIKxtHCIUlZmimaAp9yiHjWc+WLiPt621z7dwIUEtUW5PdcSUrRNvEr jd/BgNpUFfB60MnttNiZkhTxwImOKoqf7cnxXOBl7oSI2Og8zgklWgC12iwEt+P9KGdB itFg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=X4ZMMV1b; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-207518-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-207518-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id d9443c01a7336-1f70c565bbcsi12160245ad.351.2024.06.09.14.41.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 09 Jun 2024 14:41:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-207518-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=X4ZMMV1b; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-207518-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-207518-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 69645281472 for ; Sun, 9 Jun 2024 21:41:21 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A38D4502B1; Sun, 9 Jun 2024 21:41:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="X4ZMMV1b" Received: from mail-pg1-f171.google.com (mail-pg1-f171.google.com [209.85.215.171]) (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 906101865C; Sun, 9 Jun 2024 21:41:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.171 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717969272; cv=none; b=lOzlzfwao6jtsgoB6TXaGc3xkrrISJ/z1z8tert5nCcbKQr+YU+0Z2iY83yRHQnGHrqp+Liwnv+w99jJZvl6P3nOFGA2TVCTDe3y8yQHhbcb2uNTfwY2OldlY+kAY6633C+4Tzk0e5PJZ9yloys8nfew+yYy1OOFTDTlDZcaHuo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717969272; c=relaxed/simple; bh=/pUyIs0rg9z+B+eOOx1A4RTdvAOOAsqyUvdGdwh+okY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=FEfQ3vlmlPV3bweAt/q0k5mQCpZ3QH7j0yClN++RqmJnriyZybuXTqnEAY+w3cqPn9b6EXSJQ981J2m4EmIAdq4RIrH5cP8pJ2CmLX2Rz/eRM5OrSptmw0a0n1N/9ui+V5WS+Fp3gENXpVLd1x9yLJBJ6ydyzZ2oYk3kRarCvOo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=X4ZMMV1b; arc=none smtp.client-ip=209.85.215.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pg1-f171.google.com with SMTP id 41be03b00d2f7-681ad081695so2829499a12.3; Sun, 09 Jun 2024 14:41:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1717969271; x=1718574071; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=ecB0puB5CrDlsinl6SGmOW0Gy36kwzCicVzoDhVT234=; b=X4ZMMV1bEtpE5vkEEnwLfy6zNT+xv7NUECseTKh/VPsJAfkhhbQbi7olpcsgg/cCoz TH6i2URhHXJ15PdTJ12hK19BqRkFB0EQa76AedJNRpYU9oYl4oV0QnwOckLFPusZAuCc DTbp1EPqa1SMglACE/AIyzJKmHhpnE5aJhEvEAbJsP/Rh7pIOQk34ZQqkp9VWLSA16ih hyoCd7+DMYPuEonNXi42WHgOI0ZFWVkZwUZKuAYRN/XOiya8C3pRSNNIC5qd+2pCKfhU 7Izyt/3AisadabUAPMrZ3+f1nV9HQi0cEywH45HvtxZckUW4gPz0b381zpvlWkd5Ezjs g1eA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717969271; x=1718574071; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=ecB0puB5CrDlsinl6SGmOW0Gy36kwzCicVzoDhVT234=; b=qyQ+mzB0vnbYcldm1Ux+ZYHB2JsGEdwUsLIrPTwpVvq5FuiozdrO80MFSwh5ETqwo3 wj9XVHLgUM90gftrE/pcodx6XIGUMSGBoX5FmZ4V1h02rGqZVOqzaW3/6COBX4CyC7EV idYf7rHcQAUlpx+lojBF510aWbfof6YpRfjuw8HcO8dOT9NrrPOoMnWJMsKUfuYlpTAB ugShrcZRxouh/5Svs0JRR5f/W9N9pEqkzcp+0FcL9wNOheq+ZepLn3/DIzJ7Y2SnEbVR UYdPtOjIz65wJ4EpP3N16cH0CeJmXubs3wPgIed438uKqK1uQjGlkMsNP6qUH7lYPOyw 8GmQ== X-Forwarded-Encrypted: i=1; AJvYcCWqXlvLtAKun28Z9BGBtviJxfimj6KZ/JcbPYkdM9EXWi/rv3uZ9yNLuPoj6baw2yv8mKUBbPD+rtnY5PlQmCdQPJxJT/7hXZbsAdBEOJj82uNspMnDhxBTtHa5WS0Boa0qHSsURAkLRieBwj+JSA8/4OTH6erDIZFvv0Fk054DQd5YSgrHCNn7Tvs= X-Gm-Message-State: AOJu0YwfFsNHNpxghYchvcGmNpTFSYPqEzbEsRhuT8MK19Rs1iKVMB7s MATjeBvga2z2jcogUclMGtMXEIznpa6UXWQrfCJbD3O0QPSj0igI X-Received: by 2002:a05:6a21:27a9:b0:1b5:77db:c76e with SMTP id adf61e73a8af0-1b577dbc806mr3287548637.54.1717969270619; Sun, 09 Jun 2024 14:41:10 -0700 (PDT) Received: from google.com ([2620:15c:9d:2:55a9:13e9:dec7:f9d3]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2c2cd57024csm4817204a91.20.2024.06.09.14.41.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 09 Jun 2024 14:41:10 -0700 (PDT) Date: Sun, 9 Jun 2024 14:41:07 -0700 From: Dmitry Torokhov To: Erick Archer Cc: Benjamin Gaignard , Hans Verkuil , Ricardo Ribalda , Andrzej Pietrasiewicz , Oliver Graute , Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= , ye xingchen , Jason Gerecke , Kees Cook , "Gustavo A. R. Silva" , Justin Stitt , Support Opensource , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org Subject: Re: [PATCH] Input: touchscreen - use sizeof(*pointer) instead of sizeof(type) Message-ID: References: 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=us-ascii Content-Disposition: inline In-Reply-To: On Sat, Jun 08, 2024 at 04:34:49PM +0200, Erick Archer wrote: > It is preferred to use sizeof(*pointer) instead of sizeof(type) > due to the type of the variable can change and one needs not > change the former (unlike the latter). > > The refactoring is mostly trivial except for "usbtouchscreen.c" > file. Here, in the "mtouch_alloc" and "nexio_alloc" functions, > it is necessary to use a variable with a predefined type instead > of the "usbtouch->priv" variable (void * type). This way, the > "sizeof" operator can now know the correct size. Moreover, we > need to set the "usbtouch->priv" pointer after the memory > allocation since now the "kmalloc" return value is not assigned > directly. > > This patch has no effect on runtime behavior. > > Signed-off-by: Erick Archer Applied, thank you. -- Dmitry