Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp6122787rwi; Sun, 23 Oct 2022 18:44:37 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4ERiegQAgbItKEKlqsHhPMY+k4BKA1eym1wsfgb9EOc6r1zlyu5BT/kpClR0SeCasZ/Ifx X-Received: by 2002:a17:906:2681:b0:783:6a92:4c38 with SMTP id t1-20020a170906268100b007836a924c38mr25835420ejc.75.1666575876921; Sun, 23 Oct 2022 18:44:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666575876; cv=none; d=google.com; s=arc-20160816; b=i3gi5loyzWiCg6MjCkTGE2gknFkUd9NcjKUfXPYCAUKtGr9I7NyB9pwQy2IcvRN5ct /RJk366u1EWmxnJG88UUcYIiMGlbBSh8PItssxZZtAzc3olZrDke3+nsOu/ZGcULA2L7 eQ4V+FMhNlA5vguR3GIBmFc5O0BQCFyotgEuMz686Lflg1PDcnE9nie+jPz58AimCEMo S5smRYzOIf2AjVM40i+fyarO4UFPNnyrQfjfRfuj8BkjD3/4xzepbkilW0LmOsIP9Hv0 et2XN3QhL42pPS3Tmdp/ESCGlsLIt9f4U64fbbWt5ot6ok8dKktNVb4eU5zUnrdAZe45 5Y3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:cc:to:from:date:dkim-signature; bh=RBbdDR1qIfFWCpyIS3gw2RrXMuQd+FyAZp7BhoIptWw=; b=kM4q7Cg0ODnju1JvcRbzwUZD3qo29H3H5A0/vrbTlo0TU9SuKXN4nijWjP/Tjy0zcZ PO3LH+N2E8S5Dt1vvGVriCbCsOeEQdtcJRAjnAij5Se6KpTXzOA86giFBRCBJR/fAX8U O1hq3iSyiQFGhL9/7t/G/ZdxO5NZbLh0HCSJA3CD9erTKptsej8bhESG/nT0ivk1w6cn YADywo1r2EmJiBSzOSDEKVMGjvDaPCHj1hcq+LqtA3gQPnQr2h+/btGpfK9D44E2pZqc hwX3RxtXqq2iqmd4LlIylBne9JvH3S5neA4Upu+plnXNJ6Q47QXLQAHHZj7JsFSjkEN7 lNKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=TfEmQ5Fk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a21-20020a1709066d5500b0077082e784easi21451341ejt.957.2022.10.23.18.44.12; Sun, 23 Oct 2022 18:44:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=TfEmQ5Fk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229824AbiJXA5y (ORCPT + 99 others); Sun, 23 Oct 2022 20:57:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35380 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229631AbiJXA5w (ORCPT ); Sun, 23 Oct 2022 20:57:52 -0400 Received: from mail-pj1-x102a.google.com (mail-pj1-x102a.google.com [IPv6:2607:f8b0:4864:20::102a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ED330664D6; Sun, 23 Oct 2022 17:57:51 -0700 (PDT) Received: by mail-pj1-x102a.google.com with SMTP id m14-20020a17090a3f8e00b00212dab39bcdso5160245pjc.0; Sun, 23 Oct 2022 17:57:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=RBbdDR1qIfFWCpyIS3gw2RrXMuQd+FyAZp7BhoIptWw=; b=TfEmQ5FkG7x5JVWSdQrIO7kb0R69TpMR/fvg6OYBSHscSA9xaBfnhT8ppaBNJgGEn+ 79xUr8P7YLN1DNjFnUpxV+Dl6V2GKbQS2mKxv8aRFV+1ImEwOFsgRm15PAwn+UsOMsyY hcKQKpSGl8hJsGpTRfVaGTkvhHoPdU2dkmUMRdS9jQWi9vfungHi15Yck1e00OG6tHdZ T2IEhgTowvYXT+U+qNEWUP8yZeUKQiBedMU6+JG7nU8Oyqmv/hhRVGejiRWK9sXseSuS 9a5Gg8lqPnDtpzNdTIowRYihe3rK3YarBfeAA/c6ibYdKr+qvrt4PE/gAlwP5AqinvS7 /aRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=RBbdDR1qIfFWCpyIS3gw2RrXMuQd+FyAZp7BhoIptWw=; b=npllcqXoNE8LhkIvc3+N8nXgnObSTy57ZARmtsu63bZmnp4mAkk2NesCrjNvaoln4R XuQxMnELyE2GdWC4eBBwX1Lhyb2h+jDfbUDlyOz+qnRjQpd7BElrxOyXrJNOxNe1mSIP lfMQvKLCDd0PGnhbwlhcZMGnRRQwjhUdGoA1VkhjLWWAWeMvsvOaixG8fosn7NbEalzB kfv8Sm0GAiyUVzoQvYYREfc12sPY+4OJC/0fglxFF1YnRKFdjbDEiCKakL8CSy+T1foY 89ue1SyHzQfW1rwT3jR9gGf4s25XnUw2s8GeJOwiJGvSutf5SBhn5J8whyX8aoZ2ze4V 4HAw== X-Gm-Message-State: ACrzQf27ssuBUj1zmVt+GXklOkXVr0zyM5QNtSVrPQAvQsDQWAKqFKzv 9bCpb6l1cbEprTYL/H2DTo8= X-Received: by 2002:a17:90b:254a:b0:200:53f:891d with SMTP id nw10-20020a17090b254a00b00200053f891dmr35813118pjb.168.1666573071288; Sun, 23 Oct 2022 17:57:51 -0700 (PDT) Received: from mail.google.com (122-58-209-93-fibre.sparkbb.co.nz. [122.58.209.93]) by smtp.gmail.com with ESMTPSA id oj17-20020a17090b4d9100b00205d85cfb30sm3235486pjb.20.2022.10.23.17.57.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 23 Oct 2022 17:57:50 -0700 (PDT) Date: Mon, 24 Oct 2022 13:57:42 +1300 From: Paulo Miguel Almeida To: "K. Y. Srinivasan" , Haiyang Zhang , Stephen Hemminger , Wei Liu , Dexuan Cui , Jiri Kosina , Benjamin Tissoires Cc: linux-hyperv@vger.kernel.org, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, paulo.miguel.almeida.rodenas@gmail.com Subject: [PATCH] [next] HID: hyperv: remove unused struct synthhid_msg Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org struct synthhid_msg was meant to be a generic representation of the possible protocol messages sent through VMBus. In practice, only the header is read and depending on the message type, a cast to the actual type is done. Also, SYNTHHID_MAX_INPUT_REPORT_SIZE constant isn't used which I suspect is a leftover from the refactoring made while this driver was at the staging folder. This patch removes struct synthhid_msg and refactor the code accordingly. Signed-off-by: Paulo Miguel Almeida --- drivers/hid/hid-hyperv.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/drivers/hid/hid-hyperv.c b/drivers/hid/hid-hyperv.c index 208cf8d981a5..0be717bb09d4 100644 --- a/drivers/hid/hid-hyperv.c +++ b/drivers/hid/hid-hyperv.c @@ -22,9 +22,6 @@ struct hv_input_dev_info { unsigned short reserved[11]; }; -/* The maximum size of a synthetic input message. */ -#define SYNTHHID_MAX_INPUT_REPORT_SIZE 16 - /* * Current version * @@ -59,11 +56,6 @@ struct synthhid_msg_hdr { u32 size; }; -struct synthhid_msg { - struct synthhid_msg_hdr header; - char data[]; /* Enclosed message */ -}; - union synthhid_version { struct { u16 minor_version; @@ -251,7 +243,7 @@ static void mousevsc_on_receive(struct hv_device *device, struct vmpacket_descriptor *packet) { struct pipe_prt_msg *pipe_msg; - struct synthhid_msg *hid_msg; + struct synthhid_msg_hdr *hid_msg_hdr; struct mousevsc_dev *input_dev = hv_get_drvdata(device); struct synthhid_input_report *input_report; size_t len; @@ -262,9 +254,9 @@ static void mousevsc_on_receive(struct hv_device *device, if (pipe_msg->type != PIPE_MESSAGE_DATA) return; - hid_msg = (struct synthhid_msg *)pipe_msg->data; + hid_msg_hdr = (struct synthhid_msg_hdr *)pipe_msg->data; - switch (hid_msg->header.type) { + switch (hid_msg_hdr->type) { case SYNTH_HID_PROTOCOL_RESPONSE: /* * While it will be impossible for us to protect against @@ -309,7 +301,7 @@ static void mousevsc_on_receive(struct hv_device *device, break; default: pr_err("unsupported hid msg type - type %d len %d\n", - hid_msg->header.type, hid_msg->header.size); + hid_msg_hdr->type, hid_msg_hdr->size); break; } -- 2.37.3