From patchwork Mon Jan 8 21:54:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rasmus Villemoes X-Patchwork-Id: 10150663 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 012B3602CA for ; Mon, 8 Jan 2018 21:54:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EDE1928755 for ; Mon, 8 Jan 2018 21:54:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E2DBD28769; Mon, 8 Jan 2018 21:54:21 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable 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 42FD728755 for ; Mon, 8 Jan 2018 21:54:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755689AbeAHVyI (ORCPT ); Mon, 8 Jan 2018 16:54:08 -0500 Received: from mail-wm0-f67.google.com ([74.125.82.67]:44766 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753986AbeAHVyH (ORCPT ); Mon, 8 Jan 2018 16:54:07 -0500 Received: by mail-wm0-f67.google.com with SMTP id t8so16799058wmc.3 for ; Mon, 08 Jan 2018 13:54:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rasmusvillemoes.dk; s=google; h=from:to:cc:subject:date:message-id; bh=zlZyiqLWyrX/3s1EGAiDiTOEq4ZgOMLdQyk+G1TumQU=; b=YJaiGl8nVM486dOkSzTOdvYVx5O4aBlBSnJX++ZxE8diMgWQxfvuFB+m3R3IHE18Fm f8UfmuiPRc5LZx/EXjF6sE6LTdJWu3x22Y1k1SHTLLhz/F2nwOIuxcXiiG6k4vA1N4cP wZTdtcZmNjhTK4W5V7Lxm7WXeX/ekQm0Z7ZaE= 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; bh=zlZyiqLWyrX/3s1EGAiDiTOEq4ZgOMLdQyk+G1TumQU=; b=e506Y0HUcd0S6PPAGI0ca5wHHdZmT/SXJYYAaxLzyAkmW0c1NHxqL04oLdz54m8RMR THYw02aK8vnRyLCbe6C3WZ8zf3JTypGYBs/iP6v2oziZNpcs/qVjnQCzN3YyqyV5kNc6 T7MgHA0ETVLdCsDvNA1xegglNuTZXGKLc+yTg0GG4aBncMA1rsIHKdCxDANf0nhT9mkr W7LZnjNGJCaRLdqCkIw3fg84n3NhSa87JYxbh6YxE3njls02DH78hNcwsQ0vwxAn0W18 8/Z2TVoW/qI/rBaqf7jQGag5IeJRy9Pp/91l9SoRg2r10i+l0OCkDwm94QWEa18/NuZO 5VZw== X-Gm-Message-State: AKGB3mKgK+hLqPzSIef0hy8Vbz+1QunvmKXSDZgwJRmhouFf51mOSUbp xOmXskfWn04APyh71H9vFu5V7A== X-Google-Smtp-Source: ACJfBosS86nbwpk3SdxwZTWHYzFvDnz+wDEk0ac7pRu2199knqdMhsvoe13pWQvyRJ9ykw8Vukjkhg== X-Received: by 10.80.195.75 with SMTP id q11mr18482890edb.254.1515448446355; Mon, 08 Jan 2018 13:54:06 -0800 (PST) Received: from prevas-ravi.waoo.dk (dhcp-5-186-124-8.cgn.ip.fibianet.dk. [5.186.124.8]) by smtp.gmail.com with ESMTPSA id c2sm6838516edi.66.2018.01.08.13.54.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 08 Jan 2018 13:54:05 -0800 (PST) From: Rasmus Villemoes To: Dmitry Torokhov Cc: Rasmus Villemoes , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] Input: cyapa - remove duplicated macro definitions Date: Mon, 8 Jan 2018 22:54:02 +0100 Message-Id: <20180108215402.25612-1-linux@rasmusvillemoes.dk> X-Mailer: git-send-email 2.15.1 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 Apart from whitespace differences, this block of macros is repeated twice: $ x=./drivers/input/mouse/cyapa_gen3.c; diff -w -u <(sed -n '139,181p' $x) <(sed -n '182,224p' $x) $ Signed-off-by: Rasmus Villemoes --- drivers/input/mouse/cyapa_gen3.c | 43 ---------------------------------------- 1 file changed, 43 deletions(-) diff --git a/drivers/input/mouse/cyapa_gen3.c b/drivers/input/mouse/cyapa_gen3.c index 1cbfa4a6e830..076dda4a66da 100644 --- a/drivers/input/mouse/cyapa_gen3.c +++ b/drivers/input/mouse/cyapa_gen3.c @@ -136,49 +136,6 @@ static const u8 bl_exit[] = { 0x00, 0xff, 0xa5, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07 }; - /* for byte read/write command */ -#define CMD_RESET 0 -#define CMD_POWER_MODE 1 -#define CMD_DEV_STATUS 2 -#define CMD_REPORT_MAX_BASELINE 3 -#define CMD_REPORT_MIN_BASELINE 4 -#define SMBUS_BYTE_CMD(cmd) (((cmd) & 0x3f) << 1) -#define CYAPA_SMBUS_RESET SMBUS_BYTE_CMD(CMD_RESET) -#define CYAPA_SMBUS_POWER_MODE SMBUS_BYTE_CMD(CMD_POWER_MODE) -#define CYAPA_SMBUS_DEV_STATUS SMBUS_BYTE_CMD(CMD_DEV_STATUS) -#define CYAPA_SMBUS_MAX_BASELINE SMBUS_BYTE_CMD(CMD_REPORT_MAX_BASELINE) -#define CYAPA_SMBUS_MIN_BASELINE SMBUS_BYTE_CMD(CMD_REPORT_MIN_BASELINE) - - /* for group registers read/write command */ -#define REG_GROUP_DATA 0 -#define REG_GROUP_CMD 2 -#define REG_GROUP_QUERY 3 -#define SMBUS_GROUP_CMD(grp) (0x80 | (((grp) & 0x07) << 3)) -#define CYAPA_SMBUS_GROUP_DATA SMBUS_GROUP_CMD(REG_GROUP_DATA) -#define CYAPA_SMBUS_GROUP_CMD SMBUS_GROUP_CMD(REG_GROUP_CMD) -#define CYAPA_SMBUS_GROUP_QUERY SMBUS_GROUP_CMD(REG_GROUP_QUERY) - - /* for register block read/write command */ -#define CMD_BL_STATUS 0 -#define CMD_BL_HEAD 1 -#define CMD_BL_CMD 2 -#define CMD_BL_DATA 3 -#define CMD_BL_ALL 4 -#define CMD_BLK_PRODUCT_ID 5 -#define CMD_BLK_HEAD 6 -#define SMBUS_BLOCK_CMD(cmd) (0xc0 | (((cmd) & 0x1f) << 1)) - -/* register block read/write command in bootloader mode */ -#define CYAPA_SMBUS_BL_STATUS SMBUS_BLOCK_CMD(CMD_BL_STATUS) -#define CYAPA_SMBUS_BL_HEAD SMBUS_BLOCK_CMD(CMD_BL_HEAD) -#define CYAPA_SMBUS_BL_CMD SMBUS_BLOCK_CMD(CMD_BL_CMD) -#define CYAPA_SMBUS_BL_DATA SMBUS_BLOCK_CMD(CMD_BL_DATA) -#define CYAPA_SMBUS_BL_ALL SMBUS_BLOCK_CMD(CMD_BL_ALL) - -/* register block read/write command in operational mode */ -#define CYAPA_SMBUS_BLK_PRODUCT_ID SMBUS_BLOCK_CMD(CMD_BLK_PRODUCT_ID) -#define CYAPA_SMBUS_BLK_HEAD SMBUS_BLOCK_CMD(CMD_BLK_HEAD) - /* for byte read/write command */ #define CMD_RESET 0 #define CMD_POWER_MODE 1