From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6200793894660079616 X-Received: by 10.182.107.162 with SMTP id hd2mr10501124obb.29.1443734833146; Thu, 01 Oct 2015 14:27:13 -0700 (PDT) X-BeenThere: outreachy-kernel@googlegroups.com Received: by 10.107.11.197 with SMTP id 66ls566350iol.10.gmail; Thu, 01 Oct 2015 14:27:12 -0700 (PDT) X-Received: by 10.66.146.73 with SMTP id ta9mr10331914pab.21.1443734832578; Thu, 01 Oct 2015 14:27:12 -0700 (PDT) Return-Path: Received: from mail-pa0-x22c.google.com (mail-pa0-x22c.google.com. [2607:f8b0:400e:c03::22c]) by gmr-mx.google.com with ESMTPS id uv4si1345014pac.0.2015.10.01.14.27.12 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Oct 2015 14:27:12 -0700 (PDT) Received-SPF: pass (google.com: domain of shivanib134@gmail.com designates 2607:f8b0:400e:c03::22c as permitted sender) client-ip=2607:f8b0:400e:c03::22c; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of shivanib134@gmail.com designates 2607:f8b0:400e:c03::22c as permitted sender) smtp.mailfrom=shivanib134@gmail.com; dmarc=pass (p=NONE dis=NONE) header.from=gmail.com Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com Received: by mail-pa0-x22c.google.com with SMTP id lk4so84921773pab.3 for ; Thu, 01 Oct 2015 14:27:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:subject:message-id:mime-version:content-type :content-disposition:user-agent; bh=zVwHaqXxI3H3TKpr2OTTxfY3PVTVpWzHGC3gCuo9txo=; b=S8I1gRgOG6oGHGj1uKpoUmS7PdKzff7rW+R/2Suf89zEgN36dyf4KZ/weK0XAjq3TU l9tR/2xHkvGeXOCas7QPc7z7c5HMjAuxuyFsqMdEiukvv+/myba8/Dc5K95edJKN80WV EGJm60EWzVxF1KFes2clSULPKdJ+4zvu044N397R5BLBr6j57zD7Q1zxs7jPzIURX1I4 jsLXzNALPQhT+nOaX+iJXf3992o5Zd+9kjw31MKxBV7y4yPH3LzBm3BPzn0tbAGCI2TE w8c+YnS7349wKDxMXw1sqXIESoMnUN3LV88lCQOfSJzmagnYs/SSEgFPJG5UYKO3Z0Jt pBtQ== X-Received: by 10.68.68.133 with SMTP id w5mr14886040pbt.143.1443734832460; Thu, 01 Oct 2015 14:27:12 -0700 (PDT) Return-Path: Received: from ubuntu ([124.124.47.116]) by smtp.gmail.com with ESMTPSA id zn9sm8516916pac.48.2015.10.01.14.27.10 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 01 Oct 2015 14:27:11 -0700 (PDT) Date: Fri, 2 Oct 2015 02:57:03 +0530 From: Shivani Bhardwaj To: outreachy-kernel@googlegroups.com Subject: [PATCH] Staging: xgifb: vb_util: Fixed sparse warning of bit truncation due to cast Message-ID: <20151001212702.GA30608@ubuntu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) Fixed the warning generated by sparse that 'cast truncates bits from constant value' by typecasting unsigned values to u8 as their logical operation is being performed with and stored in a u8 type variable. Signed-off-by: Shivani Bhardwaj --- drivers/staging/xgifb/vb_util.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/xgifb/vb_util.h b/drivers/staging/xgifb/vb_util.h index 7bd395f..f613f54 100644 --- a/drivers/staging/xgifb/vb_util.h +++ b/drivers/staging/xgifb/vb_util.h @@ -18,7 +18,7 @@ static inline void xgifb_reg_and_or(unsigned long port, u8 index, u8 temp; temp = xgifb_reg_get(port, index); - temp = (temp & data_and) | data_or; + temp = (u8) ((temp & data_and) | data_or); xgifb_reg_set(port, index, temp); } @@ -27,7 +27,7 @@ static inline void xgifb_reg_and(unsigned long port, u8 index, unsigned data_and u8 temp; temp = xgifb_reg_get(port, index); - temp &= data_and; + temp = (u8) (temp & data_and); xgifb_reg_set(port, index, temp); } -- 2.1.0