Message ID | 20221214-uvc-status-alloc-v3-0-9a67616cc549@chromium.org |
---|---|
Headers | show
Return-Path: <linux-media-owner@kernel.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 05420C4167B for <linux-media@archiver.kernel.org>; Thu, 15 Dec 2022 10:57:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229972AbiLOK5j (ORCPT <rfc822;linux-media@archiver.kernel.org>); Thu, 15 Dec 2022 05:57:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57122 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229990AbiLOK5g (ORCPT <rfc822;linux-media@vger.kernel.org>); Thu, 15 Dec 2022 05:57:36 -0500 Received: from mail-ej1-x630.google.com (mail-ej1-x630.google.com [IPv6:2a00:1450:4864:20::630]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 65DA95FC8 for <linux-media@vger.kernel.org>; Thu, 15 Dec 2022 02:57:34 -0800 (PST) Received: by mail-ej1-x630.google.com with SMTP id t17so51378921eju.1 for <linux-media@vger.kernel.org>; Thu, 15 Dec 2022 02:57:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=cc:to:message-id:date:from:content-transfer-encoding:mime-version :subject:from:to:cc:subject:date:message-id:reply-to; bh=MBQ6hVnZML0By6HKfqAr16DEf49bHB/ZZHyANQ8cfk4=; b=goA+oAoyMvDOA83zxszqQSuR4mN9HGUiBm4OsL7yYfwxHBm04W0N1gRvs3raa13s6I 2GgMxv8tp37aEFMY2kjtameIBLqrLpjneZPW73zRIP9UW6BAGepx17ebRHvKVz1ds6Yn 9XN6LcshTcmQ4nKPxpxynY+b7cyPICQGrkKHo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:message-id:date:from:content-transfer-encoding:mime-version :subject:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=MBQ6hVnZML0By6HKfqAr16DEf49bHB/ZZHyANQ8cfk4=; b=HsJem8Bjpk+wbm0mnhMBY9pfkeTzJxTMuh5umo2u6CBLQbxUuQGx8/RvHa7dwo7t+j jGaV5+qlj2SoeClG1nOT3/etb1qN2fqPOgxOfflOTZBOcXo2chkjUXAcyvdPSzFLtzUJ MeSBqm4rt2JFI4POcA6WTn+GSA70/fjHeep/f7Q765PBMIcpSe380uSa0VmiDlcpDRN2 4n+M/eNsfFvdbSHHFB7YuFqRh6tKpM5p/Vw5j5fHxh7igwYQRtb2/YdzlZ9SpGvgM9YL RRYRSpzqzeDsh8Btnv2hwcWoKowRu8csRlRwWJ72HYMN5Y8P4e0rWjTiIq9/tHaXntiK ouag== X-Gm-Message-State: ANoB5pnb0TuFSjBK7faCL5AeBH6yhYl2XmbYD7CfMtiqyEImpyhVRVf8 Pqp/bduCcFBDMSm2t4ciE0sZxRT4D4SW2xKewIw= X-Google-Smtp-Source: AA0mqf5H9toxOvdlWy5KYDrSoWbtkQ5KFtswBQRwoWKsJgdCXt0izz4m+MmRRli29dX9LkOSxg83Zg== X-Received: by 2002:a17:906:94c2:b0:7c0:e0d9:d20d with SMTP id d2-20020a17090694c200b007c0e0d9d20dmr23308220ejy.37.1671101852962; Thu, 15 Dec 2022 02:57:32 -0800 (PST) Received: from alco.roam.corp.google.com (80.71.134.83.ipv4.parknet.dk. [80.71.134.83]) by smtp.gmail.com with ESMTPSA id e8-20020a056402148800b0046c5dda6b32sm7339381edv.31.2022.12.15.02.57.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Dec 2022 02:57:32 -0800 (PST) Subject: [PATCH v3 0/2] media: uvcvideo: Code cleanup for dev->status MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-B4-Tracking: v=1; b=H4sIAI39mmMC/4XNTQrDIBAF4KsU17X4ExrtqvcoXejERMEoaBRKyN 07dNlFuxreg/fNTqorwVVyO+2kuB5qyAmDPJ8IeJMWR8OEmQgmBBd8oK0DrZvZWqUmxgxUS+vAjk oqrQjOrKmO2mISeBymFiOWPtQtl9fnTed4Hj/EzimjhjGtpglG0PIOvuQ1tPWSy0Ke6HXxzxBoyJ mDNdcZRjl8GcdxvAEmyhvf/AAAAA== From: Ricardo Ribalda <ribalda@chromium.org> Date: Thu, 15 Dec 2022 11:57:17 +0100 Message-Id: <20221214-uvc-status-alloc-v3-0-9a67616cc549@chromium.org> To: Max Staudt <mstaudt@chromium.org>, Jonathan Cameron <Jonathan.Cameron@huawei.com>, Sergey Senozhatsky <senozhatsky@chromium.org>, Ming Lei <tom.leiming@gmail.com>, Mauro Carvalho Chehab <mchehab@kernel.org>, Laurent Pinchart <laurent.pinchart@ideasonboard.com>, Yunke Cao <yunkec@chromium.org> Cc: Ricardo Ribalda <ribalda@chromium.org>, Christoph Hellwig <hch@lst.de>, linux-usb@vger.kernel.org, Alan Stern <stern@rowland.harvard.edu>, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org X-Mailer: b4 0.11.0-dev-696ae X-Developer-Signature: v=1; a=openpgp-sha256; l=1868; i=ribalda@chromium.org; h=from:subject:message-id; bh=f3vt5vV6S4YKdMY0W+NJsexZg7N1/1PGQBWqQnOC0z0=; b=owEBbQKS/ZANAwAKAdE30T7POsSIAcsmYgBjmv2PptmDYlP18vZwvL2gkIADmZ0iBHbN5/pK6Z3j 6JMY2SeJAjMEAAEKAB0WIQREDzjr+/4oCDLSsx7RN9E+zzrEiAUCY5r9jwAKCRDRN9E+zzrEiLPJD/ 9Ae/C6WjpTUsgEpw5Hn/My4q1WId3iB6he7Mlmi50/GMmZRiLJRSAIw7YgKuZopsusPoXBCu6xGD/W MomFraaRs30tPqOZ3ZPmJu6xfye8LaxcI+ceJ99YBdyygCYFmqnYjxWWXqIvZ9dG65TV87DXeR9mI4 sC0sIqIThf1YumGT9fM7nN0l1lIg3qz4253g4kf1iz2XstpegimkheGr+7Wt8uv5RITzJ86VMvb8Xc zNXg0GPnKLEAZLgKvhUdExx0iFQ9YjvKYNiwHPQe51JqCoykHb8TsGqY2qvMd1cSYLb8gajE94Xmkl yPh4fyLKoq/LU82a5SI61VL6YcxPpWAZGIVC7yr5xoK0sLzikTZ02bPYwKD0JQddhf10BBBpxArsto 1QNunbzaP6vtWyot/k1eP+m6AuxuXd3P6RSiJbk+TDz5JQUYCLujg/lIkPav9euuou1b6ZmX7BUXZs lWdHknIO8uqD7cSixDzx1Oaz495pyjjoy7uTr7trvqsLY5d9uue68ImYXHoARyMpnPuPa91+d2IKJJ iSEazgE9kKYKc0LGWT5PdUa2RM5MIo4CLLXKr5A5iZk/s0ntN3cYcQiu/6v3hVyHp4Y7ryfmEEqEwb duIsmuVgvOjykH7YygDOWLKOf8/pcRrMnwundf3Kfotrj4s4JcHx+4B68dlQ== X-Developer-Key: i=ribalda@chromium.org; a=openpgp; fpr=9EC3BB66E2FC129A6F90B39556A0D81F9F782DA9 Precedence: bulk List-ID: <linux-media.vger.kernel.org> X-Mailing-List: linux-media@vger.kernel.org |
Series |
media: uvcvideo: Code cleanup for dev->status
|
expand
|
There is no need to make a kzalloc just for 16 bytes. Let's embed the data into the main data structure. Now that we are at it, lets remove all the castings and open coding of offsets for it. [Christoph, do you think dma wise we are violating any non written rules? :) thanks] Cc: Christoph Hellwig <hch@lst.de> Cc: Alan Stern <stern@rowland.harvard.edu> Cc: linux-usb@vger.kernel.org To: Ming Lei <tom.leiming@gmail.com> To: Jonathan Cameron <Jonathan.Cameron@huawei.com> To: Yunke Cao <yunkec@chromium.org> To: Sergey Senozhatsky <senozhatsky@chromium.org> To: Max Staudt <mstaudt@chromium.org> To: Laurent Pinchart <laurent.pinchart@ideasonboard.com> To: Mauro Carvalho Chehab <mchehab@kernel.org> Cc: linux-media@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Ricardo Ribalda <ribalda@chromium.org> --- Changes in v3: - Split the patch in two - Add linux-usb, Alan and Christoph for the allocation change. - Link to v2: https://lore.kernel.org/r/20221214-uvc-status-alloc-v2-0-3f1cba6fc734@chromium.org Changes in v2: - using __aligned(), to keep the old alignment - Adding Johnathan Cameron to:, as he has some similar experience with iio - Adding Ming Lei, as this patch kind of revert his patch - Link to v1: https://lore.kernel.org/r/20221214-uvc-status-alloc-v1-0-a0098ddc7c93@chromium.org --- Ricardo Ribalda (2): media: uvcvideo: Remove void casting for the status endpoint media: uvcvideo: Do not alloc dev->status drivers/media/usb/uvc/uvc_status.c | 69 ++++++++++++-------------------------- drivers/media/usb/uvc/uvcvideo.h | 29 ++++++++++++++-- 2 files changed, 47 insertions(+), 51 deletions(-) --- base-commit: 0ec5a38bf8499f403f81cb81a0e3a60887d1993c change-id: 20221214-uvc-status-alloc-93becb783898 Best regards,