From 613b1f96b0535563d98376e46ea3ed5ad0252ea7 Mon Sep 17 00:00:00 2001 From: chrfranke Date: Sun, 2 Dec 2018 15:46:22 +0000 Subject: [PATCH 234/291] ataprint.cpp: Fix Form Factor string with bits set in reserved area - Happens with APPLE SSD SD0256F Patch provided by Harry Mallon. git-svn-id: http://svn.code.sf.net/p/smartmontools/code/trunk@4841 4ea69e1a-61f1-4043-bf83-b5c94c648137 --- smartmontools/ChangeLog | 5 +++++ smartmontools/ataprint.cpp | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/smartmontools/ataprint.cpp b/smartmontools/ataprint.cpp index 5fccf4ba..495d5401 100644 --- a/smartmontools/ataprint.cpp +++ b/smartmontools/ataprint.cpp @@ -404,9 +404,10 @@ static inline std::string format_st_er_desc( static const char * get_form_factor(unsigned short word168) { + // Bits 0:3 are the form factor // Table A.32 of T13/2161-D (ACS-3) Revision 4p, September 19, 2013 // Table 236 of T13/BSR INCITS 529 (ACS-4) Revision 04, August 25, 2014 - switch (word168) { + switch (word168 & 0xF) { case 0x1: return "5.25 inches"; case 0x2: return "3.5 inches"; case 0x3: return "2.5 inches"; -- 2.19.1