From patchwork Tue Feb 7 15:52:18 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 9560483 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3EE806047A for ; Tue, 7 Feb 2017 15:52:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2C87E282E2 for ; Tue, 7 Feb 2017 15:52:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 216FD28438; Tue, 7 Feb 2017 15:52:28 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A3CCF282E2 for ; Tue, 7 Feb 2017 15:52:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754983AbdBGPw0 (ORCPT ); Tue, 7 Feb 2017 10:52:26 -0500 Received: from mail-pf0-f196.google.com ([209.85.192.196]:34951 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754564AbdBGPwY (ORCPT ); Tue, 7 Feb 2017 10:52:24 -0500 Received: by mail-pf0-f196.google.com with SMTP id f144so9565959pfa.2 for ; Tue, 07 Feb 2017 07:52:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=/D//gggbPctBi+LqgrCnjhdNraB1n64CW/0vUM/hA3M=; b=NqjG4/MUzxaDMxeWw3DPN8nUMux6FqzyvX3DX376vajMSfN6glx+xm2zuftF43Ad5H qxhZescULTIEMoPXthsaqcvvZYiXZg2mdK5ovD0YMR76v3v0GL1RJt3Z6kQCZKWKrZ0K MyIOFao6VDa/sU3auxqu5fGFdjAVm0lkLwQsRrRDjAp3pdNtZ7D2IAnpMPLceQmrjgIP TG0snrg+PKBIGvkQgOSkKhmzGkDQTw7QwouBXvEy/86Oe5eAmP8/ieLWDQvTGT7KFA8Y 15skInBwP2xIuajasGfkSPpT2VqEv1eLopMDREbfo5avQGqgKWtvY1KUr5C3Agvaty8w 8WKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=/D//gggbPctBi+LqgrCnjhdNraB1n64CW/0vUM/hA3M=; b=jtrWnBtAgHj4/JqfyEGEn69BfJREd/7hQEgtLaF2W6IVr6MnU9nnntUW4R/Vk1GAp1 O/kGoUkvdt6g7J6HtA+jvU09XWlxihJV8Xm/EtATgIlLARTnRF1g8ChmBX7Pay+2RAzf 68UR2WqBIEI3hO5oP3hDnCyyc2PC/2+zCEXOSDKrYQG7UanhfzbBPqFmgLIGn6krUMEF llmxpLq2fEy4XQyGRMjJXrKfMDMFe9aHqBwCZBx2a3PjPoMGjpkTu8QnVWI8mrC4B6OJ Czz7tsod4fHdnQkTo0uAiJ8sY1eP6510eejHvFP+3GbCQRQsBZERfvAQmKP8O+uxGo6l UKBA== X-Gm-Message-State: AIkVDXJv+FOy2LPrYgvUPq2jGlH/6f3MgFFkDwMcY0kE0EqrpNwFmF+GtsWo8BawyUtzXg== X-Received: by 10.84.225.150 with SMTP id u22mr27232276plj.157.1486482743598; Tue, 07 Feb 2017 07:52:23 -0800 (PST) Received: from 192.168.0.37 (ec2-52-192-197-227.ap-northeast-1.compute.amazonaws.com. [52.192.197.227]) by smtp.gmail.com with ESMTPSA id n123sm8457939pga.9.2017.02.07.07.52.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 Feb 2017 07:52:23 -0800 (PST) From: Wei Yongjun To: Jiri Kosina , Benjamin Tissoires , Marcel Hasler Cc: Wei Yongjun , linux-input@vger.kernel.org Subject: [PATCH -next] HID: hid-mf: convert list_for_each to entry variant Date: Tue, 7 Feb 2017 15:52:18 +0000 Message-Id: <20170207155218.3296-1-weiyj.lk@gmail.com> X-Mailer: git-send-email 2.9.3 MIME-Version: 1.0 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Wei Yongjun convert list_for_each() to list_for_each_entry() where applicable. Signed-off-by: Wei Yongjun --- drivers/hid/hid-mf.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-input" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/hid/hid-mf.c b/drivers/hid/hid-mf.c index 03f1051..572e378 100644 --- a/drivers/hid/hid-mf.c +++ b/drivers/hid/hid-mf.c @@ -68,8 +68,6 @@ static int mf_init(struct hid_device *hid) struct list_head *report_list = &hid->report_enum[HID_OUTPUT_REPORT].report_list; - - struct list_head *report_ptr; struct hid_report *report; struct list_head *input_ptr = &hid->inputs; @@ -80,9 +78,7 @@ static int mf_init(struct hid_device *hid) int error; /* Setup each of the four inputs */ - list_for_each(report_ptr, report_list) { - report = list_entry(report_ptr, struct hid_report, list); - + list_for_each_entry(report, report_list, list) { if (report->maxfield < 1 || report->field[0]->report_count < 2) { hid_err(hid, "Invalid report, this should never happen!\n"); return -ENODEV;