Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp962011imm; Fri, 12 Oct 2018 09:25:04 -0700 (PDT) X-Google-Smtp-Source: ACcGV613ZkrHKi/L5l0wHyiEjE5PGy/FcNr2dmHV6r+02JR+BgllRWmqlGI5gQ2DJZpDlpikD76r X-Received: by 2002:a65:66c9:: with SMTP id c9-v6mr6162567pgw.55.1539361504464; Fri, 12 Oct 2018 09:25:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539361504; cv=none; d=google.com; s=arc-20160816; b=fuKEGUCWSPJECvTZx/Uy1K9OFOVj9H5GUxkRd68BrkKbuCE0HgYNT+lcVY6SoFPxSH roVo2lnLa2seQjR1OwkI8qbA4KWuEYiYK50R6ktM1cwjM+XrOTQia8oaGtaxxEZFXOlb 9QMUxyOGj9AWE7vPBfyrb3LcO0C46XwsUwxC1Rja+UDehPRt1qIdqJz6dU7uHWYOxrWB 4tTN2HA13fmjF/FsSeMvK9Z4MqU2HtaHF17jSfi0d+TZcGsspQwzMursG6t6Ks+yDuYB mWRz7jAdYoxauq3LAeRkjOYWr3+2IbYWgIylLiKFU5uHZ22dM1QRimatFqGnMnC0MW/f Q1hw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=2qrtCqGdo+tkKYwFf7GqimMOCbDejc+vn8gn1asps7A=; b=aL5IzI6YRnATyp77b8OxpJIb37CvhbkmgXKpmqeh0nmq6Lwy4hjsk183xVwNIWbWgK 6QyS6BGNwNsqVgJo3EarETouTFpTAMGyYIDvT968tUL1xSoOH0N2Twxrvk3sN6GjjZPQ 7Gqu6D56lrJUGdUO6F8lWukIECLT+O0i/ZtfkVlFLWQnUtIloQ+7g9w1HFGwZxb9j1db /C92+X4Bnhrrvv11G61KF+mPsAXKfbe2rEwjjhh8MfP3KI7YviJEpvrEaniThvGQJJLC S7Oe8D5kOTT/4RjdyIr+yf45/mPAMOQhzoy6XtmsPD3Xq9IWtom6JXv4cQo3/+zYR6Kr 31SQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id cd15-v6si1746334plb.219.2018.10.12.09.24.48; Fri, 12 Oct 2018 09:25:04 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728795AbeJLX5l (ORCPT + 99 others); Fri, 12 Oct 2018 19:57:41 -0400 Received: from mail78-58.sinamail.sina.com.cn ([219.142.78.58]:37303 "HELO mail78-58.sinamail.sina.com.cn" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1728689AbeJLX5l (ORCPT ); Fri, 12 Oct 2018 19:57:41 -0400 Received: from unknown (HELO localhost.localdomain.localdomain)([171.223.32.124]) by sina.com with ESMTP id 5BC0CAAF0000611D; Fri, 13 Oct 2018 00:24:22 +0800 (CST) X-Sender: penghao122@sina.com.cn X-Auth-ID: penghao122@sina.com.cn X-SMAIL-MID: 583336394106 From: Peng Hao To: axboe@kernel.dk Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, Peng Hao Subject: [PATCH] block/sx8 : remove unnecessory check Date: Fri, 12 Oct 2018 12:24:13 -0400 Message-Id: <1539361453-3383-1-git-send-email-penghao122@sina.com.cn> X-Mailer: git-send-email 1.8.3.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Peng Hao TAG_VALID(tag)= ((((tag) & 0xf) == 0xf) && (TAG_DECODE(tag) < 32)). But '(X & 0x1f) < 0x20(32)' is always true. The second half of TAG_VALID is unnecessary. Signed-off-by: Peng Hao --- drivers/block/sx8.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/block/sx8.c b/drivers/block/sx8.c index 4d90e5e..b8e9ebf 100644 --- a/drivers/block/sx8.c +++ b/drivers/block/sx8.c @@ -75,7 +75,7 @@ /* 0xf is just arbitrary, non-zero noise; this is sorta like poisoning */ #define TAG_ENCODE(tag) (((tag) << 16) | 0xf) #define TAG_DECODE(tag) (((tag) >> 16) & 0x1f) -#define TAG_VALID(tag) ((((tag) & 0xf) == 0xf) && (TAG_DECODE(tag) < 32)) +#define TAG_VALID(tag) (((tag) & 0xf) == 0xf) /* note: prints function name for you */ #ifdef CARM_DEBUG -- 1.8.3.1